Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Learn PHP
<Nu-Coder Command Line InterfaceDeploying Encoded PHP files with NuSphere PhpExpress>
Last updated: Thu, 18 Nov 2010

Using Nu-Coder's License Manager

Nu-Coder's License Manager

Nu-Coder's license manager helps you to manage the distribution of PHP applications by generating license keys that can be required by encoded files to run. Using License Manager you can create trial and demo versions of PHP applications without any code changes. License Manager is typically used on the server where the encoded files are place for download by your customers. For this reason NuSphere supplies License Manager for all major platforms, including *BSD/x86 and x86_64, Linux/x86 and x86_64, Windows, Solaris/x86, x86_64 and Sparc.

Using Nu-Coder's license manager you can create various license models for both trial and commercial distributions:
  • Trial/Evaluation License - provides time expiry
  • Usage Restricted to specific hardware - linked to hardware id
  • Usage Restricted to specific virtual host - linked to Virtual Host Name
  • Usage Restricted to specific Network Segment - linked to ip address network card or MAC address of the network card

How to generate License Manager Licenses using Nu-Coder Command Line Interface

The interface to Nu-Coder's License Manager provides you with multiple options to generate License files for encoded PHP scripts. The similar syntax is used for generation of the License files as it is for encoding of php files, however the name of the executable is different. See how to encode the files to use generated licenses in the section "How to use License Manager generated licenses when encoding of PHP files" of this manual


nu-licgen [options]

The following are the options used by Nu-Coder's License Manager

-k <keyword>,
--key <keyword>
generate license with provided keyword. It's recommended to use keywords of 6-16 or more alpha-numeric characters. It's necessary to encode PHP files with the same keyword or license will be ignored.
-d <fname>
--header <fname>
add custom header to the license file
-a <name1>=<value1>,<name2>=<value2>
--attribute <name>=<value>,...
create attribute(s) to be stored in license file. These attributes all are encrypted with the license key. attributes can be read from the license at runtime with pelm_get_attribute() function call.
-x <name>
--expose <name>
make attribute's copy visible in the license
--lid <id> lock the license into server hardware identified by specified host ID(s).(See PhpExpress API on how to get host IDs). If multiple IDs are specified, license will require at least one ID to match server hardware
--lmac <mac> lock license into server hardware identified by specified Ethernet MAC addrress(es). For example --lmac 00-C0-44-11-33-A4,00-C0-44-11-33-A5
--lip <ip> lock the license into server software settings. License will work only for servers accessed with specified IP address(es). Wildcards are acceptable, for example --lip,217.217.216.*
--lvhost <vhost> lock the license into server software settings. License will work only for accessed with specified host name(s). Wildcards are acceptable, for example --lvhost *.mydomain.com,mydomain.com
--ldate <mm/dd/yyyy> set license expiration date. Generated license will stop working after it is expired and PHP script will stop running. Useful for creation of demo versions and trials. The date must be set in the future
--lperiod <days> alternative way of specifying license expiration date. Specified period should be at least one day long

Examples of using Nu-Coder's License Manager

The following are some examples of using Nu-Coder Command Line Interface to generate licenses for encoded PHP files with Nu-Coder's License Manager:

Example #1

Generate license for an evaluator of the PHP application:

nu-licgen -k "super-store 1.1 trial" -a caption="super-store version 1.1" -x caption --lperiod 14 license_name.txt

Generated license file license_name.txt will be good for 14 days from the moment of creation and will have one attribute called "caption". Attribute caption is going to be visible in the license file.
To protect PHP files in c:\myproject\source with license_name.txt (generated with the command shown above) the following syntax should be used for encoding:

nu-coder.exe -k "super-store 1.1 trial" c:\myproject\source

Example #2

Generate the license for commercial PHP application and link it to host id HVCE42C-61936X (host id should be obtained from the client. PhpExpress provides API function phpexpress_hostid() that can be used for this purpose, described later in the this manual)

nu-licgen -k "1.1 super-store commercial" -a caption=" super-store version 1.1",licensee="John Doe" -x caption,licensee --lid HVCE42C-61936X license_name.txt

In this example, the license file generate will allow the execution of PHP files only on the host id HVCE42C-61936X.
To link PHP files from c:\myproject\source to license_name.txt the following syntax should be used for encoding (same as in the Example #1 of this section):

nu-coder.exe -k "super-store 1.1 trial" c:\myproject\source

<Nu-Coder Command Line InterfaceDeploying Encoded PHP files with NuSphere PhpExpress>
Last updated: Thu, 18 Nov 2010