CODELOCK V2.0 15 day trial - Last build date: 16 March 2005
~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTE: All scripts encrypted with the trial will last for 15 days

--------------------------------------------------------------------------------------
Installation Instructions
-------------------------

Online server:

1. Extract the files into a folder (eg. codelockv2) and CHMOD 2777 the 'codelockv2' 
   folder (note the 2 in front for GID (drwxrwsrwx). This means "world-writable with the
   setGID bit enabled").  In most cases, CHMOD 777 should work OK if you're unsure
2. Upload/Copy the folder and contents to your server (using FTP software if necessary)
   or your localhost server
3. CHMOD 777 or write enable the folders: 'encrypted' and 'projects'
   AND the file: codelock_dec.php
4. Transfer your files into the folder: 'myfiles'
5. Run the file called: index.php
6. Enter the unlock key: 15codelock-trial

Localhost:

1. Extract the files into a folder (eg. codelockv2)
2. Windows users go to straight to step 3
   CHMOD 777 or write enable the folders: 'encrypted' and 'projects'
   AND the file: codelock_dec.php
3. Put your files into the folder: 'myfiles'
4. Run the file called: index.php
5. Enter the unlock key: 15codelock-trial

FOR HELP:

On each page, if you click on some of the options (underlined) you will get more
detailed instructions of what they do!

ZLIB:

Please Note: You need the ZLIB library installed.  If you do not have this, you will
not be able to use all of the functions of Codelock.  It is strongly recommended that
you try to install the ZLIB module onto your server (to keep up to date) and for the
best encryption options. If you have Windows version of PHP it SHOULD come with zlib.
To check, just do a PHPINFO(); on your server and look for ZLIB.

For more information on zlib, go to : http://www.gzip.org/zlib/

SAFE MODE: 

Codelock V2 does work in SAFE MODE, except if you want to encrypt FROM a .zip file.
In this case, you must turn safe mode off in your PHP.INI file. All your encrypted 
files will run in SAFE mode (dependent on your own code of course), and may will 
require PHP 4.1 or better.

--------------------------------------------------------------------------------------
Troubleshooting when Encrypting:
--------------------------------

* WRITE ERRORS

  When setting up the Codelock Encryptor on some servers you may encounter a write
  error.  Usually Codelock will let you know.  If you get a write error, you will
  need to write enable (i.e. CHMOD 777) the folder that Codelock specifies.  This is
  because Codelock puts all of it's encrypted files into the 'encrypted' folder, and
  it stores it's projects in the 'projects' folder.

  FOR WINDOWS 2000/XP USERS:
  You may need to write enable the directory that Codelock is in AND the 'encrypted'
  and 'projects' folders and you need to have administration rights

--------------------------------------------------------------------------------------
Encrypting and Testing your scripts:
------------------------------------

Encryption options
------------------
- Whatever encryption options you choose for one page, it will also be applied to any
  other page you encrypt. eg. If you choose an expiry date for one file, then this
  will apply to all the other pages.  This also applies to the unlock key.

Multiple folders: 

  Codelock now encrypts multiple folders.  Be careful when using this option, as it
  will encrypt every file type that you specify within all subfolders under the folder
  you specify.  Make sure you dont encrypt a top-level folder (eg. C: drive , for 
  windows users!), your files should be in the myfiles folder preferably, to avoid
  encryption problems.

Encrypting Browser Output
-------------------------

- You can encrypt the browser output of your PHP files, to protect HTML generated code

- On the odd occasion, if you encrypt the browser output of a page you may get an error.
  Codelock will tell you which line of code (from your original page) it has problems
  with, when you run the script. You will find that it is usually due to a javascript
  that uses non-conventional or complex scripting methods.  You should use the encrypt
  browser output feature only if you are prepared to debug the odd one or two pages. 
  Although the HTML encryption should work with 99% of your pages.  To get around these
  problems, use the 'encrypt segment' option and encrypt the code around your javascript. 

- The META TAGS are also encrypted, so if you wish to leave them intact, you should use
  the encrypt 'segment' option and use the HTML encryption function

- When choosing to encrypt the browser output, the right click function can also be
  disabled

- International characters do NOT work with this option

Testing your scripts
--------------------
- If you want to test your files before distributing, it is strongly recommended that
  you make a copy of your encrypted files and test your COPY.  The reason for this is
  because the state of the decryptor file (i.e. codelock.php) is altered when you
  enter your unlock key.  If you send your files with the altered decryptor file
  (after testing it yourself), your end client will NOT be asked to enter the unlock
  key!

- Alternatively, you can prepare your files for distribution immediately after you
  encrypt them, so they are in their un-altered encrypted state.

--------------------------------------------------------------------------------------
Distributing your scripts
-------------------------

- You only need one copy of the codelock.php file (or your renamed decryptor file) in
  the same directory as your files.  If you use sub-directories, Codelock will
  automatically put the decryptor file into each subfolder for you.

- IMPORTANT: To make sure your script runs properly, the decryptor file (codelock.php)
  needs to be write enabled (CHMOD 777).  If you are distributing your files, you
  will need to instruct your recipient client(s) to write enable the decryptor file. 
  Usually this is the only requirement, but sometimes your client may also need to 
  CHMOD the directory that your script is in to 777.  This may be necessary if they
  do not have write permission to their root directory.  Another way around this is
  to get them to upload your script into a subfolder - with write access.

- If you would prefer not to ask your client to CHMOD 777 the decryptor file, then you
  can unlock the script BEFORE you send it, but this means, they will not be able to
  enter an unlock key (sometimes this can be an advantage)

- Preserving Your CONFIG files.  If you want some of your files to still remain editable
  by your client, remember to copy and paste your original config file over the top of
  the encrypted one before distributing

- RE: ZLIB
  If you use the ZLIB compression option your client MUST also have ZLIB installed on
  their system.  It is recommended that you do use this option.  If they have trouble
  installing ZLIB, then you could send them a standard encrypted version. USUALLY, most
  end-users do have ZLIB or do not have much trouble installing it.

- Compatibility
  Of course, when you send someone your own scripts (even WITHOUT encryption), they 
  need to have at least the SAME version of PHP as you or better.  This way, you know
  for sure that your scripts should work on their server.  Remember, Codelock encrypted
  files will work on PHP 4.1 and better

Known problems:  
---------------

- Some javascripts may not work properly when encrypting the browser output

- For files that have been included: If an included file references file-related super
  globals eg. dirname(__FILE__); they may not always work properly.

Note: If you sometimes have the odd PHP page that doesn't want to work properly, try
using the 'encrypt segment' option instead (for your trouble pages).  This encryption
usually works every time (although it's not as secure).

Extra Notes:
------------

- The 'encrypted' folder is where Codelock stores your newly encrypted files
- The 'myfiles' folder is a folder where you can place your files (once uploaded) if
  you are using linux.  This will make it easy for you to specify a relative path to
  your files when encrypting
- The 'projects' folder is where your saved projects are stored
- The codelock_unzip.exe file is used for windows servers only and is not needed for
  Linux.  Your installation of Linux must have the unzip command available.  This
  is only if you want to enable the encryption FROM a zip file (not TO a ZIP file)
  i.e. the unzip.exe is only used when you choose to encrypt files where the source file
  is a single ZIP file containing PHP files (via HTTP)

Changes:
--------

Jan 2004 - Fixed bug to allow include files in subfolders
	 - Fixed IP address detection script
	 - Fixed timeout error for slow machines
	 - Fixed session_start() bug
Feb 2004 - Added function to allow my.filename.php type files
	 - Fixed include function (to allow multiple folders)
Mar 2004 - Removed references to Codelock in source code
	 - Fixed IP lock problem with localhost
         - Refined Zlib detection code
Apr 2004 - Fixed output bug in segment encryptor
	 - Added compression level option to segment encryptor
	 - Added ability to allow for __FILE__ constant within code
	 - Fixed multiple includes in same folder bug
	 - Fixed limit on page sizes
May 2004 - Modified IP/URL detection script to work without globals
         - Added session_set_save_handler() function
	 - Fixed license details bug with include files
	 - Turned off codelock error reporting
         - Small recode on segment encryptor
	 - Fixed cleanup script bug
Jun 2004 - Fixed misc include problem
	 - Updated segment encryptor to allow <? ?> tags
	 - Refined decryption process for faster loading
	 - Added safe mode warning for zip file encryption
Jul 2004 - Added text and color change function for key entry page
	 - Added customizeable WARNING message for all scripts
	 - Codelock settings are hard coded into the decryptor instead of being parsed
         - Small recode on decryption process using tmp directory
Aug 2004 - Modified and enhanced the decrypt subroutine
Sep 2004 - Removed virus alert bug
Oct 2004 - Fixed 'parse error' bug and windows server problem
Dec 2004 - Made mozilla browser compatible
         - Creating .zip files (using 'make zip') is now an option
         - Enabled the ability to specify 'file types'
         - Added subfolder encryption function for PHP files
Feb 2005 - Fixed bugs with encrypted folder and include files with includes

--------------------------------------------------------------------------------------

If you would like to order the full version, visit: www.phpcodelock.com

Enjoy!

(C) Copyright Website Creations Ltd 2003-2005
