zendenc - Command Line Examples

The following are examples, which use the command-line zendenc and its options. Each begins with the command line and is followed by an explanation of its results.

 

 

Usage example

Example 1

/usr/local/Zend/zendenc ––quiet /WorkFolder/mysource.php /EncodedFolder/myencoded.php

Result: The file /WorkFolder/mysource.php is used as the source of the encoded PHP file myencoded.php. During encoding, only errors are reported. The output is an encoded file written to /Encoded Folder/myencoded.php. The source file remains unchanged.

 

Example 2

/usr/local/Zend/zendenc --rename-source old /WorkFolder/ReplaceMe.php

Result: The /WorkFolder/ReplaceMe.php file is renamed by adding “.old” as a file extension. The new name of the source file is ReplaceMe.php.old.

Output is an encoded file written to the same name as the original source file.

The result is file /WorkFolder/ReplaceMe.php is an encoded file and the file /WorkFolder/ReplaceMe.php.old is the un-encoded source.

 

Example 3

/usr/local/Zend/zendenc --delete-source /WorkFolder/mysource.php

Result: The file /WorkFolder/mysource.php is used as the source then deleted and is replaced by an encoded file of the same name.

The result is that the file /WorkFolder/mysource.php is an encoded file and the original un-encoded content has been deleted.

 

Example 4

/usr/local/Zend/zendenc --asp-tags on mysource.php myencoded.php

Result: The file /WorkFolder/mysource.php is used as the PHP and ASP source file to be encoded. ASP tags are encoded along with the PHP thanks to the fact that ASP tags are treated ad PHP code. The resulting output is an encoded file written to /Encoded Folder/myencoded.php The source file remains unchanged.

 

Example 5

/usr/local/Zend/zendenc --short-tags on --expires 2005-01-01 --recursive --ignore-errors --license-product SuperWebGame --include-ext htm --exclude-ext phtml –-ignore ”a*” /WorkFolder1/ /WorkFolder2/

Result: Encodes files in /WorkFolder1/ and below with the file extensions: inc php htm php3 php4 but not phtml or files beginning with the letter “a”. Encoding will be processed for short tags and each encoded file will both expire on Jan. 01 2005 and will require a valid license for the product name SuperWebGame to work. The output files and any sub structures will be written to /WorkFolder2/. Lastly, the encoding will continue to process all files and will not stop the encoding process because of encoding errors.