tasks/ext/zendguard/ZendGuardLicenseTask.php

Show: inherited
Table of Contents

Produce license files using Zeng Guard.

The task can produce a license file from the given license properties or it can use a template.

Author
Petr Rybak  
Package
phing.tasks.ext.zendguard  
Since
2.4.3  
Version
$Id: ZendGuardLicenseTask.php 1026 2011-01-06 15:13:50Z mrook $  

\ZendGuardLicenseTask

Package: phing\tasks\ext\zendguard

Produce license files using Zeng Guard.

The task can produce a license file from the given license properties or it can use a template.

Parent(s)
\Task < \ProjectComponent
Author
Petr Rybak  
Since
2.4.3  
Version
$Id: ZendGuardLicenseTask.php 1026 2011-01-06 15:13:50Z mrook $  

Properties

Propertyprotectedstring  $expires= ''

Expiration date of the license. Used if the license is issued with a date restriction.

Possible values: - 'Never', '0' or false: the license won't expire - A Date in format DD-MM-YYYY to set expiration for that date - Relative date supported by the PHP strtotime function (e.g. +1 month)

REQUIRED

Details
Type
string
Propertyprotectedbool  $hardwareLocked= ''

Option that indicates if the license will be locked to a specific machine using the Zend Host ID code(s). If set to YES, the Host-ID is required.

OPTIONAL

Details
Type
bool
Propertyprotectedstring  $hostID= ''

Coded string (Zend Host ID) used to lock the license to a specific hardware. The Zend Host ID obtained from the machine where the encoded files and license are to be installed. The Zend Host ID code can be obtained by using the zendid utility.

For more details, see Getting the Zend Host ID.

REQUIRED if Hardware-Locked is set equal to YES. Meaningless if Hardware-Locked is set equal to NO.

User semicolon to enter more than one Host-ID

Example: Host-ID = H:MFM43-Q9CXC-B9EDX-GWYSU;H:MFM43-Q9CXC-B9EDX-GWYTY

Details
Type
string
Propertyprotectedstring  $ipRange= ''

Limits the use of the license to IP addresses that fall within specification. Supports wildcards for any of the IP place holders, as well as the two types of net masks (filters).

Netmask pair An IP a.b.c.d, and a netmask w.x.y.z. (That is., 10.1.0.0/255.255.0.0), where the binary of mask is applied to filter IP addresses. ip/nnn (similar to a CIDR specification) This mask consists of nnn high-order 1 bits. (That is, 10.1.0.0/16 is the same as 10.1.0.0/255.255.0.0). Instead of spelling out the bits of the subnet mask, this mask notation is simply listed as the number of 1s bits that start the mask. Rather than writing the address and subnet mask as 192.60.128.0/255.255.252.0 the network address would be written simply as: 192.60.128.0/22 which indicates starting address of the network and number of 1s bits (22) in the network portion of the address. The mask in binary is (11111111.11111111.11111100.00000000).

OPTIONAL

Example (Wildcard): IP-Range = 10.1.. Example (Net Mask): IP-Range = 10.1.0.0/255.255.0.0 Example (Net Mask): IP-Range = 10.1.0.0/16

Details
Type
string
Propertyprotectedstring  $licenseTemplate= ''

Path to license template. If specified all license properties will be ignored and the template will be used to generate the file.

Details
Type
string
Propertyprotectedstring  $outputFile= ''

Where to store the signed license file

Details
Type
string
Propertyprotectedstring  $privateKeyPath= ''

Path to private key that will be used to sign the license

Details
Type
string
Propertyprotectedstring  $productName= ''

The name assigned to Product. This must be the same name used when encoding the PHP files.

REQUIRED

Details
Type
string
Propertyprotectedstring  $registeredTo= ''

The Name of the Registered owner of the license.

REQUIRED

Details
Type
string
Propertyprivate  $tmpLicensePath= ''
Details
Type
n/a
Propertyprotectedstring  $userDefinedValues= ''

Semi-colon separated user defined values that will be part of the license. These values CANNOT be modified after the license is produced. Modification would invalidate the license.

OPTIONAL Example: Tea=Mint Flavor;Coffee=Arabica

Details
Type
string
Propertyprotectedstring  $xUserDefinedValues= ''

Semi-colon separated user defined x-values that will be part of the license. These values CAN be modified after the license is produced. Modification won't invalidate the license.

OPTIONAL Example: Tea=Mint Flavor;Coffee=Arabica

Details
Type
string
Propertyprotected  $zendsignCommand= ''
Details
Type
n/a
Propertyprotectedstring  $zendsignPath= ''

Path to Zend Guard zendenc_sign executable

Details
Type
string

Methods

methodprivatecleanupTmpFiles( ) : void

If temporary license file was created during the process this will remove it

methodprotectedgenerateLicense( ) : void

Creates the signed license at the defined output path

methodprotectedgenerateLicenseTemplate( ) : string

It will generate a temporary license template based on the properties defined.

Returns
Type Description
string Path of the temporary license template file
methodprotectedgenerateLicenseTemplateContent( ) : string

Generates license template content based on the defined parameters

Returns
Type Description
string
methodpublicgetDescription( ) : void

methodprotectedgetLicenseTemplatePath( ) : string

Checks if the license template path is defined and returns it.

If it the license template path is not defined it will generate a temporary template file and provide it as a template.

Returns
Type Description
string
methodpublicgetLocation( ) : void

methodpublicgetOwningTarget( ) : void

methodpublicgetProject( ) : void

methodprotectedgetRegisterSlot( ) : void

methodpublicgetRuntimeConfigurableWrapper( ) : void

methodpublicgetTaskName( ) : void

methodpublicgetTaskType( ) : void

methodpublicinit( ) : void

methodpubliclog( ) : void

methodpublicmain( ) : void

Do the work

Throws
Exception Description
\BuildException
methodpublicmaybeConfigure( ) : void

methodprotectedparseAndAddUserDefinedValues( \stirng $valueString, array $valueArray, string $keyPrefix = '',  $pairSeparator = ';' ) : void

Parse the given string in format like key1=value1;key2=value2;... and converts it to array (key1=>value1, key2=value2, ...)

Parameters
Name Type Description
$valueString \stirng

Semi-colon separated value pairs

$valueArray array

Array to which the values will be added

$keyPrefix string

Prefix to use when adding the key

$pairSeparator
methodpublicperform( ) : void

methodprotectedprepareSignCommand( ) : string

Prepares and returns the command that will be used to create the license.

Returns
Type Description
string
methodpublicsetDescription( ) : void

methodpublicsetExpires( mixed $expires ) : string

Process the expires property. If the value is empty (false, '', ...) it will set the value to 'Never' Otherwise it will run the value through strtotime so relative date and time notation can be used (e.g. +1 month)

Parameters
Name Type Description
$expires mixed
Returns
Type Description
string
methodpublicsetHardwareLocked(  $hardwareLocked ) : void

Parameters
Name Type Description
$hardwareLocked
methodpublicsetHostID(  $hostID ) : void

Parameters
Name Type Description
$hostID
methodpublicsetIpRange(  $iprange ) : void

Parameters
Name Type Description
$iprange
methodpublicsetLicenseTemplate(  $value ) : void

Parameters
Name Type Description
$value
methodpublicsetLocation( ) : void

methodpublicsetOutputFile(  $outputFile ) : void

Parameters
Name Type Description
$outputFile
methodpublicsetOwningTarget( ) : void

methodpublicsetPrivateKeyPath(  $privateKeyPath ) : void

Parameters
Name Type Description
$privateKeyPath
methodpublicsetProductName(  $productName ) : void

Parameters
Name Type Description
$productName
methodpublicsetProject( ) : void

methodpublicsetRegisteredTo(  $registeredTo ) : void

Parameters
Name Type Description
$registeredTo
methodpublicsetRuntimeConfigurableWrapper( ) : void

methodpublicsetTaskName( ) : void

methodpublicsetTaskType( ) : void

methodpublicsetUserDefinedValues(  $userDefinedValues ) : void

Parameters
Name Type Description
$userDefinedValues
methodpublicsetXUserDefinedValues(  $xUserDefinedValues ) : void

Parameters
Name Type Description
$xUserDefinedValues
methodpublicsetZendsignPath(  $zendsignPath ) : void

Parameters
Name Type Description
$zendsignPath
methodprotectedverifyConfiguration( ) : void

Verifies that the configuration is correct

Throws
Exception Description
\BuildException
Documentation was generated by DocBlox 0.17.1.