ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# C.117 ZendGuardEncodeTask The `ZendGuardEncodeTask` is a wrapper for ZendGuard zendenc executable. It pre-compiles the PHP code which improves speed and can prevent unauthorized code modification. Additionally it allows signing or licensing the code so it can only be used with a valid license. For more information about ZendGuard encode parameters see the [ZendGuard documentation](http://static.zend.com/topics/Zend-Guard-User-Guidev5x.pdf). Table C.151:聽Attributes NameTypeDescriptionDefaultRequired`zendEncoderPath``String`Path to zendenc or zendenc5 binary.n/aYes`deleteSource``Boolean`Whether to delete the original file and replace with encoded.`true`No`renameSourceExt``String`If defined the original file will be copied to originalfile.renameSourceExt before encoding. This property overrides the deleteSource property.n/aNo`shortTags``Boolean`Turns on/off support for PHP short tags (<?). True to enable support.`true`No`aspTags``Boolean`Turns on/off support for ASP tags (<%). True to enable support.`false`No`noHeader``Boolean`Disables the PHP-compatible header that is added to the top of every encoded file by default and is displayed if the Zend Optimizer is not properly installed.`false`No`useCrypto``Boolean`Enables cryptography support.`false`No`encodedOnly``Boolean`If enabled the encoded files will only work with other encoded files ( I.e. encoded and not-encoded files cannot be used together).`false`No`forceEncode``Boolean`Allow encoding previously encoded files. Not recommended.`false`No`expires``String`Make an encoded file to expire on the given data. Date is in yyyy-mm-dd format.n/aNo`obfuscationLevel``Integer`Level of obfuscation. Defaults to 0 (no obfuscation). 0No`optMask``Integer`Optimization mask. Integer representing a bit mask.n/aNo`privateKeyPath``String`Path to the company private key. This is required when either signProduct or licenseProduct is enabled.n/aNo`licenseProduct``Boolean`Enabled product licensing. The encoded files won't work without a valid license. If enabled privateKeyPath property also needs to be defined.`false`No`signProduct``Boolean`Enabled product signing. If signing is enabled the files will be encoded with license support. However valid license won't be required for the files to work. If enabled privatKeyPath property also needs to be defined.`false`No`productName``String`Name of the product. This must match the product name in the license and is required when either licenseProduct or signProduct is enabled.n/aNo`prologFile``String`Path to a file containing a text that will be prepended to each encoded file and displayed in case the Zend Optimizer is not installed.n/aNo C.117.1 Example ``` <zendguardencode shortTags="false" productName="Phing" privateKeyPath="/var/data/phing.key" licenseProduct="true" zendEncoderPath="/usr/local/Zend/ZendGuard-5_0_1/bin/zendenc5" > <fileset dir="src"> <include name="**/*.php" /> <exclude name="cache/**" /> <exclude name="plugins/**" /> </fileset> <fileset dir="src"> <include name="plugins/cs*/**/*.php" /> <include name="plugins/cs*/*.php" /> </fileset> </zendguardencode> ``` Encode all php files in the current directory and subdirectories. Exlude everything in `cache/` and `plugins/` but include everything in plugins that starts with cs. C.117.2 Supported Nested Tags - `fileset` - `zipfileset`