PhpED: PHP IDE
PhpDock
Nu-Coder
encoding PHP files
Php Encoder GUI
Encode in PHP IDE
License Manager
Php Encoder CLI
new features
licensing
user guide
FAQ
PhpExpress
TechPlatform

Encode PHP Files using Nu-Coder Command Line Interface

Sophisticated Command Line Interface provided by Nu-Coder PHP Encoder makes encoding of PHP files as easy as it gets and as configurable as possible at the same time. In this tutorial you will learn about the features of Nu-Coder Command Line Interface (CLI).
Please learn more about Nu-Coder's License Manager. For full set of instructions and all available options please see PHP Encoder user guide.
Output of 'Nu-Coder.exe -h'


How to encode PHP files using Nu-Coder Command Line Interface

Nu-Coder can be invoked with various options entered on the Command Line. This section presents the syntax and required arguments for using Nu-Coder administration commands. The commands are case-sensitive.

Syntax

nu-coder.exe [options] directory targetdir
nu-coder.exe [options] [-f] file targetfile
nu-coder.exe [options] --appendext ext fileordirectory
nu-coder.exe [options] --overwrite fileordirectory
nu-coder.exe [options]

How to encode single PHP file

You can run Nu-Coder in single file processing mode by specifying the source file and target file at the end of the command line:

nu-coder.exe [options] -f source-file target-file

When started with this command Nu-Coder will encode the source-file and save results into target-file.

Please note that some options are available in both directory and single file processing modes. For example, option --appendext <ext> is used to append <ext> at the end of source file name. This option can be used in both single file and directory processing mode and will cause Nu-Coder to append <ext> to a single file's name or to all files in the source directory respectively.

How to encode PHP files in the entire directory

You can run Nu-Coder in directory processing mode by specifying the source directory and target directory at the end of the command line:

nu-coder.exe [options] source-directory target-directory

When started with this command Nu-Coder will encode the files in source-directory and save results into target-directory.

As we mentioned before some Nu-Coder CLI options are available in both directory and single file processing modes. However there is a set of options available only in directory processing mode.

Below are the options available only for directory processing:

-r, --recursive Handle directories recursively
--ext <extlist> In directory processing mode, only encode files with the extensions listed in <extlist>. Extensions should be separated with a comma, the default <extlist> is php,inc
--copyall In directory processing mode, copy all non-php files into target-directory

All other options are available in both directory and single file processing modes.

How to control the process of encoding of PHP files

Nu-Coder interface provides various options to control what the program does and how it does it.

Below is the table of Administration options of Nu-Coder Command Line Interface:

-c <PHP version> Specify the version of PHP scripts to be encoded. If omitted, the encoding will be done for PHP 5.1
-s, --syntax-check Perform syntax check only, do not produce any encoded content
-t, --noshorttags Turn off support for short php tags <? ?>
-a, --asptags Turn on support for asp style php tags <% %>
-e Keep extended information for debugger/profiler
This option also automatically turns on --lineinfo option, which preserves line numbers information
--lineinfo Preserves line numbers information
--phpdoc Do not strip php-doc comments, useful for reflection
-h, --help Display this help
-q, --quiet Suppress all normal output
-v, --version Version number

How to encode PHP files with different headers

Encoded PHP files contain default header, which will advise the user to install PhpExpress - in case if NuSphere's PHP Loader is not installed. You can however create your own custom header for the encoded PHP files or encode PHP files without any header at all. The following are the options controlling creation of the custom headers:

--noheader Encode PHP files without any header
--header filename Encode PHP files with the header contained in the file 'filename'

How to protect PHP files with License Manager

Encoded PHP files can be also protected with Nu-Coder's License Manager. Learn more about CLI options available for working with License Manager

Examples:

The following are some examples of using Nu-Coder Command Line Interface to encode PHP files:

Example #1

Encode files in the directory c:\myproject\source and all of it's subdirectories recursively and place the resulting encoded files in the directory c:\myproject\source-enc, without changing the names of the files:

nu-coder.exe -r c:\myproject\source c:\myproject\source-enc

Example #2

Encode files with extension .phtml in the directory c:\myproject\source and all of it's subdirectories recursively and place the resulting encoded files in the same directory. c:\myproject\source-enc, without changing the names of the files:

nu-coder.exe -r --ext phtml c:\myproject\source

Example #3

Encode single file c:\myproject\index.php and store the resulting encoded file in c:\myproject\index.php.enc:

nu-coder.exe -f c:\myproject\index.php c:\myproject\index.php.enc

Example #4

Encode single file c:\myproject\index.php and append .enc to the extension of the resulting file (i.e. make it c:\myproject\index.php.enc)

nu-coder.exe --appendext .enc c:\myproject\index.php


Platforms

NuCoder CLI and License Manager are available on many platforms, including Linux, FreeBSD, Solaris, Windows, and many others. Complete list of supported platforms matches the list for Php Express. See this page for details.


In this tutorial you learned about the many features of the Nu-Coder and how to use them to quickly protect your PHP scripts. Additional technical information is available from the NuSphere Forum. Download a free trial of our PHP Encoder today!

 Download NuSphere Nu-Coder

Download a free trial of the PHP Encoder from NuSphere.

 Buy NuSphere Nu-Coder now

PHP Encoder and license manager
can be yours for just $299
Get more then 40% off already low price of Nu-Coder when buying Nu-Coder with PhpED or PhpDOCK.
Our Existing PhpED and PhpDOCK customers will also enjoy more then 40% off discount applied to the purchase of Nu-Coder.
The reduction in the price will be applied to your total in shopping cart.