SourceGuardian Changelog

What's new in SourceGuardian 13.0

Feb 18, 2022
  • Full support for PHP8.1 encoding, including all the latest language features. Note, files encoded with an older versions of SourceGuardian need to be re-encoded with SourceGuardian 13 in order to run under PHP8.1
  • PHP8.1 language features including enums, readonly properties, first-class callable syntax, intersection types and more.
  • New loaders for PHP8.1 Please check our PHP blog and the loaders page for new versions.
  • A fully rebuilt GUI. You will not notice many visual changes but the updated version supports hi DPI monitors and has some other minor refinements.
  • Communication with sourceguardian.com website uses SSL connection now.
  • We removed PHP 4.3 to 5.2 versions support. They are too old to use and support.
  • We removed support of 32-bit (x86) encoders and loaders for Linux and FreeBSD. Embedded platforms support did not change (loaders for which we will update soon).

New in SourceGuardian 12.0 (Mar 10, 2021)

  • Version 12 introduces encoding for PHP8 - a great new version of PHP for years:
  • Full support of PHP8 encoding including all the latest language features. Note, files encoded with older versions of SourceGuardian need to be re-encoded with SourceGuardian 12 in order to run underPHP8.
  • New fully supported PHP8 language features include: named parameters, attributes, union types, mixed pseudotype, null-safe operator, match expressions, using throw-in expressions, constructor properties, and others.
  • Due to native support for attributes (annotations) in PHP8, PHP frameworks that uses annotations like Symfony must work with encoded files out of the box (after the frameworks get updated accordingly by their authors).
  • New loaders for PHP8.
  • New Features:
  • Multiple external license file names may be specified when locking to a license. Separate license filenames, paths, or URLs by a comma in the --external or an appropriate GUI option. Please note, the license files will be checked in the order they are specified. You may mix local file names, paths or URLs. If neither of the license files is found and running of the protected file fails with a "a license file is required" error, the error message will include only the first license file name. This is normal and by design.
  • Sg_get_const() if called without parameters returns an array of all the constants.
  • Locking to a machine id is refined for Linux. Please note, Linux lacks of a strict machine-id algorithm. Ifyou are getting unstable machine id result when running protected scripts on Linux, consider lockingto MAC address(es) instead of machine id as an alternative approach.
  • Update for PHP 7.x code:
  • We have fixed some critical issues in PHP 7.x family of encoders and loaders. This means files encoded with version 12 of SourceGuardian for PHP 7.x will not run with older loaders. If you use version 12 of SourceGuardian, please make sure you install and/or deploy the recent loaders.

New in SourceGuardian 11.3 (Apr 25, 2019)

  • Full support of PHP 7.3 encoding including all the latest language options.
  • We fixed some issues with unexpected segfaults on PHP7+ and some other problems. If you experienced issues like that with your cc re-encode with the latest version 11.3 of SourceGuardian and install the recent loader. Note, files encoded with SourceGuardian 11.0, 10.x or older need to be re-encoded with SourceGuardian 11.3 in order to run them undE
  • New loaders for PHP 7.3, updated loaders for older versions of PHP We updated loaders and created new ones for PHP 7.3.
  • We update the following loaders on request. Please check our blog and the loaders page for new versions.
  • New Features:
  • Experimental licensing for Docker. If you are installing SourceGuardian to your Docker, licensing must work correctly now letting you install and use SourceGuardian on this Docker machine. So, if you are using SourceGuardian from a Docker container during the deployment process of your files, this must work now since you installed and registered your copy of SourceGuardian as usual. Note, every separate installation of SourceGuardian still requires an additional license as one license lets you install and use SourceGuardian only on one machine.
  • Installing to Docker needs a special approach and mapping of /var/run/docker.sock Please refer to a new section Installing to Docker in the user manual.
  • We are introducing a new locking option which is available in the full version of the encoder - locking to a machine ID. Use the new loader method sg_get_machine_id() to obtain a machine ID on your client machine and then specify the machine ID on the Lock screen in GUI or use the new command line option --machine-id of the encoder or licgen tool. Encoded PHP scripts locked to a machine ID will only run on that machine (or machines if you specify multiple machine IDs). Please refer to the Locking options section for further information.
  • Note: as sg_get_machine_id() is a binary method of the loader, an appropriate loader must be installed to the client machine in order for this method to be available from your code. We recommend that you create a mini project, encode it and include the loaders for obtaining the machine ID from the client, in that case loaders will be found automatically as for any other PHP script encoded with SourceGuardian.
  • We are also introducing a new locking option for CLI PHP scripts. It was always a problem to lock such the scripts as neither IP nor domain locking may be used for them. Locking to MAC address was only a solution in that case, but it's not always convenient to lock to MAC addresses. Now you may use a special verification URL to validate the CLI script and make sure it works on the same machine as your web based part of the project.
  • However, if your CLI PHP script works on its own and is not a part your your web based project, then you still may use the new machine ID locking option for it as well as good old locking to MAC addresses.
  • Please refer to the Locking options section for further information about using of the remote verification URL option.
  • Option to add custom auto-globals. For CLI use: --auto-global MYAUTO If you use GUI, add this CLI option to 'addiitonal command line options' in Advanced options.
  • Options to ignore IP/domain check for the scripts running with CLI PHP. It means if you have encoded the entire project with locking to a IP/domain and selected the option to ignore the IP/domain check for CLI, your protected files will require to be run under the specified IP/domain(s) for web but the same files will be run OK with CLI PHP. This simplifies running PHP CLI scripts like cron jobs but still have them encoded in the same project along with web scripts.
  • However, you may consider the risk of using this option as it does what it does - lets run your IP/domain locked encoded files with PHP CLI bypassing the domain check. For CLI use: --ip-ignore-cli. --domain-ignore-cli or the appropriate tickboxes on the Lock screen in GUI. Regardless these are the new options, please consider locking CLI scripts to the verification URL instead.
  • PHP doc comments are now removed by default. Use --keep-doc-comments option to keep them e.g. if the framework you use require doc comments. We added an appropriate tickbox to the Advanced options window in GUI.
  • Error text for sourceguardiansestrict_unencoded=1 updated to include the file name
  • GUI updates:
  • File associations work now on Windows and Mac OS. It means clicking a .sg project file in Explorer/Finder will launch SourceGuardian and opens this project in GUI. Note, for this to work, SourceGuardian must be installed using the installer on Windows, on Mac OS, you need to launch SourceGuardian at least once for file associations to start working.
  • Hex registration code is now displayed in Help/Registration information which is useful if you are using multiple installations of SourceGuardian and need to manage or reset a particular license in the online user profile, now you may easily find it there.
  • You may access your SourceGuardian online user profile directly from the application, click Help/SourceGuardian User Profile.
  • CLI updates:
  • Days option was replaced with --expire 00d 00m 00h 00s • New command line options described above: —ip-ignore-cli, --domain-ignore-cli, --machine-id, —machine-id-encrypt, --remote-verification-url, -- keep-doc-comments, --auto-global
  • Bug Fixes:
  • Using self:: from within nested function which in its turn is defined in a private member was not working

New in SourceGuardian 11.2 (Jul 3, 2018)

  • Version 11.2 introduces encoding for PHP 7.2 and other new options for the command line encoder. We were glad to receive comments and suggestions and want to thank you very much for sharing your ideas! We are looking forward to hearing about other suggestions for improving SourceGuardian. Here is a list of all the version 11.2 changes.
  • Full support of PHP 7.2 encoding including all the latest language options: converting numeric keys in object/array casts, counting of non-countable objects, object typehint, new optimized opcodes.
  • We fixed some issues with unexpected segfaults on 7.1 and some other problems. If you experienced issues like that with your code, please re-encode with the latest version 11.2 of SourceGuardian and install the recent loader.
  • Note, files encoded with SourceGuardian 11.0, 10.x or older need to be re-encoded with SourceGuardian 11.2 in order to run them under PHP 7.2
  • New loaders for PHP 7.2, updated loaders for older versions of PHP
  • We updated loaders and created new ones for PHP 7.2. Loaders for the following operating systems are available:
  • Windows 32-bit (VC6, VC9; VC11 PHP 5.5, 5.6; VC14 PHP 7.0, 7.1; VC15 PHP 7.2) Windows 64-bit (VC11 PHP 5.5, 5.6; VC14 PHP 7.0, 7.1, VC15 PHP 7.2) MacOSX (universal binaries, include i386, x86_64) Linux (i386, x86_64)
  • We update the following loaders on request. Please check our blog and the loaders page for new versions:
  • FreeBSD (i386, x86_64) Linux ARM (armel) Linux ARM (armhf) Raspberry Pi (including Pi version 3) and other boards
  • We are happy to work with our customers if they need bespoke loaders for other custom operating system. Please contact [email protected] if you are interested.
  • We do not include loaders for all supported operating systems to the GUI package. Please visit out loaders page if you can't find the loader for your OS in the Copy Loaders dialog.
  • Command line encoder updates:
  • A minor addition which may be a great help for the users who encode from the command line. We added "+" and "-" options for --phpversion. "+" means to encode for the specified version of PHP and for all the newer versions which are supported by the current version of SourceGuardian. "-" means to encode for all the supported versions of PHP except the specified one and all the lower versions, which is useful if you always need to encode by default for new versions but do not need support for old versions starting from some one.
  • Example:
  • --phpversion 5.6+ encodes for PHP 5.6 and all the newer versions (up to 7.2 for this version of SourceGuardian) --phpversion 7.0+ encodes for PHP 7.0, 7.1, 7.2 (up to 7.2 for this version of SourceGuardian) --phpversion 5.4- encodes for PHP 5.5 and newer, i.e. excludes PHP 5.4 and older --phpversion 4- excludes PHP 4 completely, encodes for all PHP 5+, PHP 7+
  • As usual when encoding for multiple versions of PHP please make sure your code is compatible with ALL the selected versions of PHP, otherwise the encoder displays an error and that source PHP file may remain unencoded in the target folder.

New in SourceGuardian 10.1.1 (Jan 3, 2015)

  • NEW FEATURES:
  • Improved code protection methods
  • Full support of PHP 5.6 encoding including the latest language options: constant scalar expressions, variadic functions operator, updated use operator and more - Encoding for PHP 5.6 is fully supporting in version 10 of SourceGuardian. PHP 5.6 introduced new language features and updated bytecode format to support them. Files encoded with SourceGuardian 8, 9.x or older will need to be re-encoded with SourceGuardian 10 in order to run protected files under PHP 5.6
  • New loaders for PHP 5.6, updated loaders for older versions of PHP
  • A closing PHP tag is not added anymore to the end of encoded files. It's not needed, Zend recommends to not use it. Omitting the closing tag 'automatically' protects against 'headers already sent' errors if any of the encoded files were accidentally opened/saved in the editor and some characters were added at the end. Omitting the closing tag does not affect execution of protected files.
  • SG_LIC_PATH environment variable may be used to specify where the loader should search for a license file.See details for GUI, for command line
  • PHP short tags are enabled by default. If you do not need them enabled for any reason, you may turn them off in advanced settings in GUI or by using the new --no-short-tags option in the command line. The old --short-tags option has been removed.
  • License generation fixed in GUI when a URL is specified as a license file name.
  • Fixed how encoding only of changed files works in GUI.
  • A new 'Refresh' button added to the GUI for updating the project tree. It is useful if any of the files were changed or added to the folders behind the encoder GUI. Also automatic refresh happens when you encode only files updated since the last encoding (see Advanced settings).
  • A new --keep-file-date command line option added to keep the modification date for encoded files the same as the modification date of source files. The same option is available in GUI in Advanced settings.

New in SourceGuardian 9.5 (Jan 3, 2015)

  • NEW FEATURES:
  • Full support of PHP 5.5 encoding including the latest language options: generators, coroutines, 'finally' operator and more - Encoding for PHP 5.5 is fully supporting in version 9.5 of SourceGuardian. PHP 5.5 introduced new language features and updated bytecode format to support them. Files encoded with SourceGuardian 8, 9.0 or older will need to be re-encoded with SourceGuardian 9.5 in order to run protected files under PHP 5.5
  • New loaders for PHP 5.5, updated loaders for older versions of PHP - We updated loaders and created new ones for PHP 5.5.
  • Standard input and output support for the command line encoder.
  • New option to disable additional CRC check to enable eval()'ing protected code. See details for GUI, for command line
  • Added "Script will expire in (days)" option to the Locking page.
  • Changed how 'modification date' works in GUI
  • The 'Copy unencoded' mode is now assigned to empty files when adding them to the project. This is to eliminate 'empty file - skipped' error messages from the encoder. It replicates what GUI does with other files that are not detected by their file extensions. If you don't need to copy empty files to the target folder, you may change the encoding mode to 'Skip' for them.
  • Reverting the project was affecting modification dates - fixed
  • Updated built-in support and automatic update in GUI.

New in SourceGuardian 9.0.1 (Oct 26, 2012)

  • Full support of encoding for PHP 5.4:
  • Encoding for PHP 5.4 is fully supporting in version 9 of SourceGuardian. PHP 5.4 introduced new language features and updated bytecode format to support them. Files encoded with version 8 or older of SourceGuardian will need to be re-encoded with SourceGuardian 9 in order to run protected files in PHP 5.4
  • New loaders for PHP 5.4, updated loaders for older versions of PHP:
  • We updated loaders and created new ones for PHP 5.4.

New in SourceGuardian 8.2.0.727 (Jan 28, 2011)

  • Added a new predefined loader constant 'loader_version':
  • sg_get_const('loader_version') returns a loader version number when called from the protected code.
  • Added a new license generator option to add custom text into the license file.
  • We have added an option to include custom text into license files generated by SourceGuardian license generator. The included text is protected with a checksum against modification.The option may be used to include user information, license description etc into license files.
  • API function sg_get_const() issue fixed:
  • In previous versions it was possible to get an encoded constant value from the unencoded code included from the protected one. It has been fixed.
  • The last catch block issue fixed:
  • The last catch block did not terminate the execution of the code in previous versions. If you are experiencing this problem you need to re-encode your code with version 8.2 of the encoder and install the updated loader.

New in SourceGuardian 8.0.0.710 (Sep 6, 2010)

  • Universal loaders. We do not separate demo and full version loaders since v8.0 of the encoder.
  • Different PHP versions use different bytecodes. Now the protected script may include multiple
  • versions of the bytecode each for one of the following versions of PHP: 4.3, 4.4, 5.0/5.1, 5.2, 5.3.
  • The new --phpversion/-V option is available for command line encoder to specify the target version(s) of PHP. The encoder encodes for all supported versions of PHP by default.
  • All PHP 5.2.x features are supported by the encoder now. It includes class and array type hints.
  • PHP 5.3 is fully supported. The new version 8 loaders are required to run scripts encoded for PHP 5.3.
  • PHP 5.3 Phar support. Protected scripts may be packed into phar archive. The license file (if used) may be packed too. The loader is still need to be installed to run protected scripts of course.
  • Loaders cannot be packed as require server-wide installation in php.ini for most applications.
  • We have removed the additional bytecode obfuscation option. It was confusing for many users and it was not easy to use as required changes in the source code. The obfuscation is integrated with the encoder now at the level where it can be done fully automatically. So the --prot option is not
  • supported anymore.
  • Script license generator now accepts the new --time-server option to store the time servers list within the license file.
  • There are versions of thread-safe and non thread-safe loaders for Windows. Thread safe loaders now have the "ts" suffix in the file name for Windows. It differs from the version 7 of SourceGuardian. Loaders without the "ts" suffix are not thread-safe now. So it matches loaders naming convention with all other supported OS. Non thread safe loaders for windows are available for PHP 5.x.

New in SourceGuardian 7.1 (Dec 12, 2008)

  • How to Install Loader Helper
  • How to Install script updated
  • Localizations fixes

New in SourceGuardian 7.0 (Jan 12, 2007)

  • Added support for encoding HTML templates and other non-PHP files
  • Added an option to archive encoded project in .zip or .tar.gz archive format
  • Now it is possible to quickly open recent projects
  • Added popup notification that encoding is finished