Update of /cvsroot/phpcoder/phpcoder
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12108
Modified Files:
Tag: 1.4
CHANGELOG coder-class.php index.php README.txt
Log Message:
Version 1.4. Update for PHP 4.3.8 plus enhancements.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/phpcoder/phpcoder/CHANGELOG,v
retrieving revision 1.1.1.1
retrieving revision 1.4
diff -u -d -r1.1.1.1 -r1.4
--- CHANGELOG 25 Jan 2004 01:38:08 -0000 1.1.1.1
+++ CHANGELOG 22 Aug 2004 03:00:49 -0000 1.4
@@ -1,24 +1,37 @@
-1.03
-
- * Encoding results are now displayed at the top of the screen
- * Added skip extensions, files with certain extensions will not be encoded
- * Removed remaining realpath() calls from index.php for portability
+1.4
+
+ * Gary Harris <ra...@pa...> 21/8/04.
+ * Updated for PHP 4.3.8 and MMCache 2.4.7.
+ * Tested in Mozilla 1.6b, Firefox 0.8 and IE 6.0 on WinXP.
+ * Updated all links.
+ * Corrected errors that generated XDebug output including array and variable initialisation
+ and flushing a non-existent buffer. (Partly dealt with in latest CVS version).
+ * Added tooltips to all controls via the "title" entity.
+ * Added help and date and time format links.
+ * Corrected some spelling errors and improved text output formatting.
+ * Created plain text version of help in readme.txt.
+ * Output is now W3C and WDG HTML 4.01 and CSS compliant.
+ * Removed space that seemed unnecessary and made the form longer than it needed to be.
+ * Changed "Copied non-source files" message to file-specific message.
+ * Widened file path text areas.
+
1.03
+
+ * Encoding results are now displayed at the top of the screen
+ * Added skip extensions, files with certain extensions will not be encoded
+ * Removed remaining realpath() calls from index.php for portability
* index.php: $possibe_extensions is now always unset even in the event that explode does not return an array.
-
-
+
1.02 First public release after 1.00
-
- * You can now provide absolute expiration date by typing in the date (using php's strtotime format) or using the elapsed time drop down.
- * Scripts can now be locked to multiple visitor ips, server ips, and server names by entering a comma seperated list of ip addresses
- * Applied patch from Dmitry Stogov, removed realpath and better checks for output buffering support, fixes to _MkDir
+ * You can now provide absolute expiration date by typing in the date (using php's strtotime format) or using the elapsed time drop down.
+ * Scripts can now be locked to multiple visitor ips, server ips, and server names by entering a comma seperated list of ip addresses
+ * Applied patch from Dmitry Stogov, removed realpath and better checks for output buffering support, fixes to _MkDir
* PHPCoder table is now centered
-
-1.01
- * Loader code now loads TurckLoader.so instead of mmcache.so
- * Now use CSS for most of the HTML formatting
- * Introduced some color into the HTML formatting :)
- * Improved error handling of PHPCoder, PHP error messages not displayed when encoding fails
- * PHPCoder now verifies subdirectories and the source directory are writable instead of just the source directory
+1.01
+ * Loader code now loads TurckLoader.so instead of mmcache.so
+ * Now use CSS for most of the HTML formatting
+ * Introduced some color into the HTML formatting :)
+ * Improved error handling of PHPCoder, PHP error messages not displayed when encoding fails
+ * PHPCoder now verifies subdirectories and the source directory are writable instead of just the source directory
* Changed instructions to use chmod 777, 666 causes PHPCoder to fail to encode files on some platforms
+1.00 Initial Release
-1.00 Initial Release
Index: coder-class.php
===================================================================
RCS file: /cvsroot/phpcoder/phpcoder/coder-class.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- coder-class.php 6 Feb 2004 16:06:16 -0000 1.3
+++ coder-class.php 22 Aug 2004 03:00:49 -0000 1.4
@@ -19,7 +19,7 @@
*/
class coder {
- var $version = '1.3'; // coder version class
+ var $version = '1.4'; // coder version class
/* These directives can be changed but it is recommended you keep the defaults and change them from the calling PHP Script */
@@ -29,8 +29,7 @@
/* Directory Creation Settings */
var $directory_mode = 0777; // octal mode created directorie will have
- var $file_mode = NULL; // octal mode for files; if NULL, the file mode of
- // the source file will be used
+ var $file_mode = 0777; // octal mode for files
var $recursive = true; // recursively process sub-directories
/* These variables control which files are valid for encoding */
@@ -43,7 +42,7 @@
var $restrictions = array(); // array to hold list of restrictions selected
var $restrictions_code = ''; // php code to implement restrictions
- /* Source and desintation directory settings */
+ /* Source and destination directory settings */
var $src_dir = './encoded'; // source code origination directory
var $dest_dir = './files'; // encoded file destination
@@ -54,7 +53,7 @@
/* No Changes Below Here */
/* this code is included in the top of every encoded file in plain text, this is used to detect mmcache and give instructions for installing if it is empty. */
- var $loader_code = '/*This encoded file generated using PHPCoder (http://phpcoder.shadonet.com) and Turck MMcache (http://www.turcksoft.com/en/e_mmc.htm)*/ if (!is_callable("mmcache_load") && !@dl("TurckLoader.so")) { die("This PHP script has been encoded using the excellent Turck MMcache Optimizer, to run it you must install <a href=\"http://www.turcksoft.com/en/e_mmc.htm\">Turck MMCache or the Turck Loader</a>"); }';
+ var $loader_code = '/*This encoded file was generated using PHPCoder (http://sourceforge.net/projects/phpcoder) and Turck MMcache (http://turck-mmcache.sourceforge.net/)*/ if (!is_callable("mmcache_load") && !@dl("TurckLoader.so")) { die("This PHP script has been encoded using the excellent Turck MMcache Optimizer, to run it you must install <a href=\"http://turck-mmcache.sourceforge.net/\">Turck MMCache or the Turck Loader</a>"); }';
/*
@@ -67,14 +66,14 @@
{
// make sure mmcache is available
if (!is_callable('mmcache_encode') && !@dl('mmcache.so')) {
- die('You must have Turck MMCache installed to use this encoder, it is freely available at: <a target="_blank" href="http://www.turcksoft.com/en/e_mmc.htm">http://www.turcksoft.com/en/e_mmc.htm</a>');
+ die('You must have Turck MMCache installed to use this encoder, it is freely available at: <a target="_blank" href="http://turck-mmcache.sourceforge.net/">http://turck-mmcache.sourceforge.net/</a>');
}
// set the max execution time if current max execution time is less than $this->max_execution_time
if (!empty($this->max_execution_time)) {
if (ini_get('max_execution_time') < $this->max_execution_time) {
if (!ini_set('max_execution_time', $this->max_execution_time)) {
- print '<p><font color="red">Failed to set max execution time</font></p>';
+ print '<p><font color="red">Failed to set maximum execution time.</font></p>';
}
}
}
@@ -90,29 +89,35 @@
function DisplayForm()
{
?>
- <table cellspacing="2" cellpadding="0" align="center">
<form method="post" action="<?php print $_SERVER['PHP_SELF']; ?>">
+ <center>
+ <table cellspacing="2" cellpadding="0">
<tr>
<td><b>Source Dir:</b></td>
- <td><input type="text" name="source_dir" size="30" value="<?php print $this->src_dir; ?>"> <span class="smallfont">(Directory source code resides in)</span></td>
+ <td><input type="text" name="source_dir" size="60" value="<?php print $this->src_dir; ?>"
+ title="The path to the directory that the source code you want to encode resides in.">
+ </td>
</tr>
<tr>
<td><b>Destination Dir:</b></td>
- <td><input type="text" name="destination_dir" size="30" value="<?php print $this->dest_dir; ?>"> <span class="smallfont">(Directory encoded files will be placed in)</span></td>
+ <td><input type="text" name="destination_dir" size="60" value="<?php print $this->dest_dir; ?>"
+ title="The path to the directory that the encoded files will be written to.">
</tr>
<tr><td colspan="2"> </td></tr>
<tr>
<td><b>Encode Files:</b></td>
- <td><input type="text" name="extentions" size="12" value="<?php print implode(',', $this->extensions); ?>"> <span class="smallfont">(Comma seperated list of extensions without . to be encoded)</span></td>
+ <td><input type="text" name="extentions" size="12" value="<?php print implode(',', $this->extensions); ?>"
+ title="A comma-separated list of filename extensions, without the '.', to be encoded.">
</tr>
<tr>
<td><b>Skip Files:</b></td>
- <td><input type="text" name="ignore_extentions" size="12" value="<?php print implode(',', $this->ignore_extensions); ?>"> <span class="smallfont">(Comma seperated list of extensions that will not be encoded)</span></td>
+ <td><input type="text" name="ignore_extentions" size="12" value="<?php print implode(',', $this->ignore_extensions); ?>"
+ title="A comma-separated list of filename extensions, without the '.', that won't be encoded.">
</tr>
@@ -121,34 +126,42 @@
<tr>
<td><b>Recursive Encoding:</b></td>
- <td><input type="radio" name="recursive" value="0" <? if ($this->recursive == false) { print 'checked'; } ?>> No <input type="radio" name="recursive" value="1" <? if ($this->recursive == true) { print 'checked'; } ?>> Yes <span class="smallfont">(Descend into sub-directories, leave on)</span></td>
+ <td>
+ <input type="radio" name="recursive" value="0" <? if ($this->recursive == false) { print 'checked'; } ?>
+ title="Don't recurse into sub-directories when encoding."> No
+ <input type="radio" name="recursive" value="1" <? if ($this->recursive == true) { print 'checked'; } ?>
+ title="Recurse into sub-directories when encoding."> Yes </td>
</tr>
<tr>
<td><b>Copy Skipped Files:</b></td>
- <td><input type="radio" name="copy_skipped_files" value="0" <? if ($this->copy_skipped_files == false) { print 'checked'; } ?>> No <input type="radio" name="copy_skipped_files" value="1" <? if ($this->copy_skipped_files == true) { print 'checked'; } ?>> Yes <span class="smallfont">(Copy non source code files into encoded directory, leave on)</span></td>
+ <td>
+ <input type="radio" name="copy_skipped_files" value="0" <? if ($this->copy_skipped_files == false) { print 'checked'; } ?>
+ title="Don't copy files which aren't encoded into the destination directory."> No
+ <input type="radio" name="copy_skipped_files" value="1" <? if ($this->copy_skipped_files == true) { print 'checked'; } ?>
+ title="Copy files which aren't encoded into the destination directory."> Yes </td>
</tr>
<tr><td colspan="2"> </td></tr>
<tr>
- <td colspan="2"><b>Pre Content Code:</b> <span class="smallfont">(Text, HTML or PHP Code)</span></td>
+ <td colspan="2"><b>Pre-Content Code:</b> <span class="smallfont">(Text, HTML or PHP Code)</span></td>
</tr>
<tr>
<td></td>
- <td><textarea name="php_pre_content" cols="30" rows="5"><?php print $this->php_pre_content; ?></textarea></td>
+ <td><textarea name="php_pre_content" cols="30" rows="5"title="Content entered here will be prepended to each PHP source file before it is encoded."><?php print $this->php_pre_content; ?></textarea></td>
</tr>
<tr><td colspan="2"> </td></tr>
<tr>
- <td colspan="2"><b>Post Content Code:</b> <span class="smallfont">(Text, HTML or PHP Code)</span></td>
+ <td colspan="2"><b>Post-Content Code:</b> <span class="smallfont">(Text, HTML or PHP Code)</span></td>
</tr>
<tr>
<td> </td>
- <td><textarea name="php_post_content" cols="30" rows="5"><?php print $this->php_post_content; ?></textarea></td>
+ <td><textarea name="php_post_content" cols="30" rows="5"title="Content entered here will be appended to each PHP source file before it is encoded."><?php print $this->php_post_content; ?></textarea></td>
</tr>
<tr><td colspan="2"> </td></tr>
@@ -162,55 +175,46 @@
<td>
<table>
- <tr><td valign="top"><b>Restrict Visitors IPs to:</b></td></tr>
- <tr><td colspan="2"><span class="smallfont">(Single IP or comma seperated list of IP addresses allowed to visit the scripts)</span></td></tr>
-
- <tr><td colspan="2"> </td></tr>
-
+ <tr><td valign="top"><b>Restrict Visitors’ IPs to:</b></td></tr>
+ <tr><td colspan="2">
+ <span class="smallfont">(Single IP or comma-separated list of IP addresses.)</span></td></tr>
<tr>
<td colspan="2" valign="top">
<blockquote>
- <textarea cols="30" rows="4" name="restrictions[visitor_ip]"><?php print htmlspecialchars($this->StripSlashes($this->restrictions['visitor_ip'])); ?></textarea>
+ <textarea cols="30" rows="4" name="restrictions[visitor_ip]"title="The IP addresses that are allowed to access these scripts."><?php print htmlspecialchars($this->StripSlashes($this->restrictions['visitor_ip'])); ?></textarea>
</blockquote>
</td></tr>
-
- <tr><td colspan="2"> </td></tr>
-
<tr><td valign="top"><b>Restrict Server IPs to:</b></td></tr>
- <tr><td colspan="2"><span class="smallfont">(Single IP or comma seperated list of IPs script may be served from)</span></td></tr>
+ <tr><td colspan="2"><span class="smallfont">(Single IP or comma-separated list of IP addresses.)</span></td></tr>
- <tr><td colspan="2"> </td></tr>
<tr>
<td colspan="2" valign="top"><blockquote>
- <textarea cols="30" rows="4" name="restrictions[server_ip]"><?php print htmlspecialchars($this->StripSlashes($this->restrictions['server_ip'])); ?></textarea>
+ <textarea cols="30" rows="4" name="restrictions[server_ip]"title="The IP addresses of servers that are allowed to host these scripts."><?php print htmlspecialchars($this->StripSlashes($this->restrictions['server_ip'])); ?></textarea>
</blockquote>
</td></tr>
-
- <tr><td colspan="2"> </td></tr>
-
<tr><td valign="top"><b>Restrict Server Name to:</b></td></tr>
- <tr><td colspan="2"><span class="smallfont">(Single domain or comma seperated list of domains script may be served from)</span></td></tr>
-
- <tr><td colspan="2"> </td></tr>
+ <tr><td colspan="2"><span class="smallfont">(Single domain or comma-separated list of domains.)</span></td></tr>
<tr><td><blockquote>
- <textarea cols="30" rows="4" name="restrictions[server_name]"><?php print htmlspecialchars($this->StripSlashes($this->restrictions['server_name'])); ?></textarea>
+ <textarea cols="30" rows="4" name="restrictions[server_name]"title="The domain names of servers that are allowed to host these scripts."><?php print htmlspecialchars($this->StripSlashes($this->restrictions['server_name'])); ?></textarea>
</blockquote></td></tr>
- <tr><td colspan="2"> </td></tr>
-
<tr>
<td colspan="2"><b>Script Expiration:</b></td>
</tr>
- <tr><td colspan="2"><span class="smallfont">(Script expires in this amount of time and will no longer run)</span></td></tr>
-
- <tr><td colspan="2"> </td></tr>
-
+ <tr><td colspan="2"><span class="smallfont">(Script expires in this amount of time and will no longer run.)</span></td></tr>
<tr>
<td colspan="2">
<blockquote>
- <p>Script expires in <input type="text" size="5" name="restrictions[expire_value]" value="<?php print htmlspecialchars($this->StripSlashes($this->restrictions['expire_value'])); ?>"> <select name="restrictions[expire_unit]"><option value="">Select</option><option value="seconds" <?php if (strtolower($this->restrictions['expire_unit']) == 'seconds') { echo 'selected'; } ?>>Seconds</option><option value="minutes" <?php if (strtolower($this->restrictions['expire_unit']) == 'minutes') { echo 'selected'; } ?>>Minutes</option><option value="hours" <?php if (strtolower($this->restrictions['expire_unit']) == 'hours') { echo 'selected'; } ?>>Hours</option><option value="days" <?php if (strtolower($this->restrictions['expire_unit']) == 'days') { echo 'selected'; } ?>>Days</option><option value="weeks" <?php if (strtolower($this->restrictions['expire_unit']) == 'weeks') { echo 'selected'; } ?>>Weeks</option><option vlaue="months" <?php if (strtolower($this->restrictions['expire_unit']) == 'months') { echo 'selected'; } ?>>Months</option><option value="years" <?php if (strtolower($this->restrictions['expire_unit']) == 'years') { echo 'selected'; } ?>>Years</option></select></p>
- <p><b>OR</b></p>
- <p>Script expires at: <input type="text" size="20" name="restrictions[expire_english]" value="<?php print htmlspecialchars($this->StripSlashes($this->restrictions['expire_english'])); ?>"></p>
+ <p>Script expires in <input type="text" size="5" name="restrictions[expire_value]" value="<?php print htmlspecialchars($this->StripSlashes($this->restrictions['expire_value'])); ?>"
+ title="The number of time units in which to expire the script.">
+ <select name="restrictions[expire_unit]" title="The units of time to use.">
+ <option value="">Select</option><option value="seconds" <?php if (strtolower($this->restrictions['expire_unit']) == 'seconds') { echo 'selected'; } ?>>Seconds</option><option value="minutes" <?php if (strtolower($this->restrictions['expire_unit']) == 'minutes') { echo 'selected'; } ?>>Minutes</option><option value="hours" <?php if (strtolower($this->restrictions['expire_unit']) == 'hours') { echo 'selected'; } ?>>Hours</option><option value="days" <?php if (strtolower($this->restrictions['expire_unit']) == 'days') { echo 'selected'; } ?>>Days</option><option value="weeks" <?php if (strtolower($this->restrictions['expire_unit']) == 'weeks') { echo 'selected'; } ?>>Weeks</option><option value="months" <?php if (strtolower($this->restrictions['expire_unit']) == 'months') { echo 'selected'; } ?>>Months</option><option value="years" <?php if (strtolower($this->restrictions['expire_unit']) == 'years') { echo 'selected'; } ?>>Years</option></select></p>
+ <p><b>OR</b>
+ <p>Script expires at: <input type="text" size="20" name="restrictions[expire_english]" value="<?php print htmlspecialchars($this->StripSlashes($this->restrictions['expire_english'])); ?>"
+ title="The expiration time in GNU date and time format."></p>
+ <a href='http://www.gnu.org/software/tar/manual/html_chapter/tar_7.html'>
+ <span class="smallfont">(GNU date and time format.)</span>
+ </a>
</blockquote>
</td>
</tr>
@@ -221,12 +225,11 @@
</td>
</tr>
- <tr><td colspan="2"> </td></tr>
-
<tr><td colspan="2" align="center"><input type="submit" name="submit_button" value="Encode Files"></td></tr>
- </form>
</table>
+ </center>
+ </form>
<?php
}
@@ -239,10 +242,10 @@
function Encode()
{
if (!is_dir($this->src_dir) || !is_readable($this->src_dir)) {
- print '<b>Unable to begin, source directory is not readable or does not exist</b>';
+ print '<b>Unable to begin, source directory is not readable or does not exist.</b>';
return false;
} elseif (!is_writable($this->src_dir)) {
- print '<b>Unable to begin, source directory is not writable, you must chmod -R 777 ' . $this->src_dir . ' before continuing';
+ print '<b>Unable to begin, source directory is not writable, on Unix you must run the command chmod -R 777 ' . $this->src_dir . ' before continuing.';
return false;
}
@@ -254,20 +257,20 @@
if (!is_dir($this->dest_dir)) {
if (!$this->_MkDir($this->dest_dir, true)) {
- print '<b>Unable to create output directory ' . $this->dest_dir . ', please manually create this directory and chmod it 777</b>';
+ print '<b>Unable to create output directory ' . $this->dest_dir . ', please manually create this directory and, on Unix, run the command chmod 777 on it.</b>';
return false;
}
}
if (!is_writable($this->dest_dir)) {
- print '<b>' . $this->dest_dir . ' is not writable, please fix the permissions on this directory (chmod 777 ' . $this->dest_dir . ')</b>';
+ print '<b>' . $this->dest_dir . ' is not writable, please fix the permissions on this directory (Unix: chmod 777 ' . $this->dest_dir . ').</b>';
return false;
}
$this->restrictions_code = $this->_BuildRestrictions($_REQUEST['restrictions']);
if (!is_array($files)) {
- print '<b>No files elibible for encoding exist in the source directory</b>';
+ print '<b>No files eligible for encoding exist in the source directory.</b>';
return false;
}
@@ -277,7 +280,7 @@
continue;
// make sure directory is writable for temporary encoding purposes
} else if (!is_writable(dirname($file))) {
- print '<span class="failfont">' . dirname($file) . ' is not writable, please chmod -R 777 ' . dirname($file) . '</span><br>';
+ print '<span class="failfont">' . dirname($file) . ' is not writable, please run the command chmod -R 777 ' . dirname($file) . '.</span><br>';
continue;
}
@@ -285,33 +288,37 @@
print '<span class="successfont">Successfully encoded ' . $file . '</span><br>';
$encode_success++;
} else {
- print '<span class="failfont">Failed to encode ' . $file . '</span><br>';
+ print '<span class="failfont">Failed to encode ' . $file . '.</span><br>';
$encode_failed++;
}
// flush output so if the script executes a long time we aren't waiting for output
if (function_exists("ob_get_level")) {
+ // GJH-Check that buffer exists before flushing to avoid failure errors.
+ if(ob_get_contents())
ob_flush();
}
}
// display summary of files
print '<p>';
- print '<span class="smallfont"><b>Successfully Encoded ' . $encode_success . ' files</span><br>';
- print '<span class="smallfont"><b>Failed to Encode ' . $encode_failed . ' files</span><br>';
+ print '<span class="smallfont"><b>Successfully Encoded ' . $encode_success . ' files.</span><br>';
+ print '<span class="smallfont"><b>Failed to Encode ' . $encode_failed . ' files.</span><br>';
print '</p>';
// copy skipped files if we need to
if ($this->copy_skipped_files == true) {
print '<p>';
if ($this->_CopySkippedFiles($this->src_dir, $this->dest_dir)) {
- print '<span class="successfont">Copied non source files</span><br>';
+ // GJH-Removed output of "Copied non-source files" from here to prevent
+ // output even when files weren't copied. Added output for each copied file
+ // to _CopySkippedFiles().
if ($encode_failed > 0) {
print '<p><b>Files that failed to encode were copied in plain text to avoid breaking the application.</b></p>';
}
} else {
- print '<span class="failfont">Failed to copy skipped files</span><br>';
+ print '<span class="failfont">Failed to copy skipped files.</span><br>';
}
print '</p>';
}
@@ -375,6 +382,13 @@
?>
</td></tr>
</table>
+ </center>
+ <p>
+ <a href="http://validator.w3.org/check?uri=referer">
+ <img border="0" src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" height="31" width="88"></a>
+ <a href="http://jigsaw.w3.org/css-validator/">
+ <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" border=0></a>
+ </p>
</body>
</html>
<?php
@@ -389,24 +403,26 @@
function HtmlHeader($title = '')
{
?>
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
- <head><title>PHPCoder <?php print $this->version ?> (MMCache PHP Encoder Frontend)</title>
+ <head><title>PHPCoder <?php print $this->version ?> (MMCache PHP Encoder Front End)</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<STYLE type="text/css">
TD { background-color: #cccccc }
BODY {
font-family: sans-serif;
- font-size: normal;
+ font-size: medium;
}
TD {
font-family: sans-serif;
- font-size: normal;
+ font-size: medium;
}
TD.withborder {
font-family: sans-serif;
- font-size: normal;
+ font-size: medium;
border-style: solid;
border-width: 1px; /* sets border width on all sides */
border-color: black;
@@ -414,7 +430,7 @@
TD.withborder-medium {
font-family: sans-serif;
- font-size: normal;
+ font-size: medium;
border-style: solid;
border-width: 3px; /* sets border width on all sides */
border-color: black;
@@ -423,7 +439,7 @@
.header {
font-family: sans-serif;
- font-color: #FFFFFF;
+ color: rgb(199,21,133);
font-weight: bold;
font-size: larger;
}
@@ -455,8 +471,13 @@
</head>
<body>
- <table align="center"><tr><td class="withborder-medium">
- <p><span class="header">PHPCoder v. <?php print $this->version; ?></b> (<a href="http://phpcoder.shadonet.com">phpcoder.shadonet.com</a>)</span></p>
+ <center><table><tr><td class="withborder-medium">
+ <p><span class="header">PHPCoder v. <?php print $this->version; ?>
+ (<a href="http://sourceforge.net/projects/phpcoder">http://sourceforge.net/projects/phpcoder</a>)
+ </span></p>
+ <p>
+ <span class="smallfont">Hover over the controls and text areas or see the <a href="./help.html">help</a> for more information.</span>
+ </p>
<?php
}
@@ -485,6 +506,8 @@
function _BuildRestrictions()
{
+ // GJH-Declare $expire_stamp to avoid undeclared variable errors.
+ $expire_stamp = "";
$rest = &$this->restrictions; // alias $rest to $this->restrictions for shorter code
$return_code = '';
@@ -511,7 +534,6 @@
}
// build script expiration timestamp
- $expire_stamp = 0;
if (!empty($rest['expire_value']) && is_numeric($rest['expire_value']) && !empty($rest['expire_unit'])) {
$expire_stamp = strtotime('+' . $rest['expire_value'] . ' ' . $rest['expire_unit']);
} elseif (!empty($rest['expire_english'])) {
@@ -557,7 +579,7 @@
// get a list of each file in the directory, skip files we shouldn't see
while (FALSE !== ($file = readdir($dh))) {
- // skip $ignore_files, because thix is where . and .. live
+ // skip $ignore_files, because this is where . and .. live
if (is_array($this->ignore_files) && in_array($file, $this->ignore_files)) {
continue;
}
@@ -581,9 +603,13 @@
// otherwise copy the file
if (!@is_file($dest_path)) {
if (!@copy($file_path, $dest_path)) {
- print '<font color="red">Failed to copy ' . $file_path . ' to ' . $dest_path . '</font><br>';
+ print '<font color="red">Failed to copy ' . $file_path . ' to ' . $dest_path . '.</font><br>';
return false;
}
+ // GJH-Print file-specific output when copying files.
+ else{
+ print '<span class="successfont">Copied ' . $file_path . '.</span><br>';
+ }
}
}
}
@@ -635,8 +661,8 @@
function _ListValidFiles($file_dir)
{
- $return = array();
-
+ // GJH-Declare variable to avoid errors.
+ $return = "";
if (!is_dir($file_dir)) {
die($file_dir . ' is not a directory');
}
Index: README.txt
===================================================================
RCS file: /cvsroot/phpcoder/phpcoder/README.txt,v
retrieving revision 1.1.1.1
retrieving revision 1.4
diff -u -d -r1.1.1.1 -r1.4
--- README.txt 25 Jan 2004 01:38:08 -0000 1.1.1.1
+++ README.txt 22 Aug 2004 03:00:49 -0000 1.4
@@ -1,2 +1,202 @@
-See HELP.html for installation directions, a plain text version will be made available soon.
+What is PHPCoder?
+
+PHPCoder is a web based front-end to the Turck MMCache
+<http://www.turcksoft.com/en/e_mmc.htm> encoding functions, which are
+similar to the Zend Encoder product.
+
+*Turck MMCache* is a free open source PHP accelerator, optimizer,
+encoder and dynamic content cache for PHP. It increases performance of
+PHP scripts by caching them in compiled state, so that the overhead of
+compiling is almost completely eliminated. Also it uses some
+optimizations to speed up execution of PHP scripts. *Turck MMCache*
+typically reduces server load and increases the speed of your PHP code
+by 1-10 times.
+
+PHPCoder enables you to encode your PHP scripts and applications into
+non reversible byte-code, thus preventing users of your programs from
+viewing or alterting the source code while having full functionality.
+Another excellent use for PHPCoder is to encode your applications PHP
+configuration files, that way someone viewing your source code does not
+see your databae login and password information.
+
+In addition to encoding PHP scripts PHPCoder allows you to set
+restrictions on the encoded scripts, you can lock a script to a
+particular server IP address, server host name, visitor IP, or even
+place a time limit on the script so it will expire after x amount of
+time. PHP Coder also allows you to specify Text, HTML or PHP code that
+should be prepended and appended to each file before it is encoded,
+allowing you to easily and securely implement your own licensing scheme.
+
+To use your encoded scripts your clients simply install the free Turck
+MMCache <http://www.turcksoft.com/en/e_mmc.htm> (available on Windows
+and Unix/Linux) or the Turck Loader
+<http://www.turcksoft.com/en/e_mmc.htm>.
+
+Downloading PHPCoder
+
+The latest version of PHP coder can be downloaded at
+http://phpcoder.shadonet.com/downloads
+
+
+Installing PHPCoder
+
+Requirements:
+
+Turck MMCache <http://www.turcksoft.com/en/e_mmc.htm> be installed
+(available on Windows and Unix/Linux)
+PHP >= 4.1 (4.3.x highly recommended, 4.1 required)
+Apache 1.3/2 or other PHP compatable web-server
+
+Installation Steps:
+
+These installation steps should be executed on the command line, you can
+accomplish them through FTP clients but this document does not cover the
+steps to do that.
+Commands you should type are in italics.
+
+1. Download the latest version of PHPCoder from
+http://phpcoder.shadonet.com/downloads
+2. Extract the phpcoder-x.tgz file by issuing the command: tar zxf
+phpcoder-x.tgz (replace phpcoder-x.tgz with the file you downloaded)
+3. Enter the phpcoder directory by issuing the: cd phpcoder command
+4. Create the files directory and make it writable: mkdir files; chmod
+777 files
+5. Create the encoded directory and make it writable: mkdir encoded;
+chmod 777 encoded
+
+PHP Coder should now be installed, to encode programs/scripts simply
+place them in the files directory and then go to http://yoururl/phpcoder
+and run the encoder, your encoded scripts will be in the encoded
+directory. For more inforamtion see Using PHPCoder.
+
+
+Using PHPCoder
+
+Once you have installed PHPCoder following the installation steps above
+it is easy to begin encoding scripts.
+
+First place the script that you want to be encoded in the files
+directory (you can do this via FTP but all directories must be chmod 777).
+Next telnet into your hosting providor and execute the command chmod -R
+777 /path/to/phpcoder/files
+Then visit http://yourdomain/phpcoder, set your options and press the
+submit button.
+
+Note that you must chmod -R 777 your files directory because PHPCoder
+will cd into each directory and write a temporary file while the
+directory is being encoded, this is so relative paths in your
+application are not broken by the encoding process.
+
+Options:
+
+The PHPCoder web page has several options you can set before you encode
+your files, here is a brief run down on some of them:
+
+Recursive Encoding: When this is set to Yes PHPCoder will encode files
+in all the subdirectories of the files directory, this is enabled by
+default and should be set to Yes unless you have a good reason to set it
+to no.
+Copy Skipped Files: When this is set to Yes PHPCoder will copy non PHP
+source files to the encoded directory, this avoids breaking apps and
+makes it so it is not necessary to merge encoded/unencoded files manually.
+
+Pre Content Code: This is Text, HTML, or PHP code (must be enclosed in
+<?php ?> ) content that will be prepended to each PHP source file before
+it is encoded, this is an excellent place to put licensing code, etc.
+Post Content Code: This is Text, HTML, or PHP code (must be encloded in
+<?php ?>) content that will be appended to each PHP source file before
+it is encoded, this is a good place for copyright, etc.
+
+
+Restrictions:
+
+PHPCoder allows you to set several options that restrict the execution
+of the encoded PHP scripts. These options range from locking to an IP
+or to a particular amount of time or all of the above.
+
+Restrict Visitor's IP: This can be a single IP or a comma seperated list
+of IP addresse; if it is set only these ip addresses can view the
+script, this is a nice feature for a demo that is not feature restricted
+but is limited to one visitor IP. In a pinch it could be used for a
+security measure though this is not recommended.
+
+Restrict Server IP: This can be a single IP or a comma seperated list of
+IP addresesses; if it is set scripts can only be served from these IPs,
+this enables you to lock the script to a particular server(s) by
+restricting the IP. This is similar to lock server name but this will
+prevent the user from moving the script where Restrict Server Name will
+allow them to move the script should their server or hosting change, for
+this reason Restrict Server Name is encouraged.
+
+Restrict Server Name: This can be a single server name or a comma
+seperated list of server names; If this is set the script can only be
+served from one of these server names, example shadonet.com,yahoo.com.
+This enables you to lock a script to a particular domain name(s) but
+allow the user to move the script to a new web host or server as long as
+it is being served from the same domain.
+
+Expiring Scripts: When a selection is made for Script Expires In: the
+script will expire after the specified amount of time has passed, for
+example 5 seconds, 1 week, 2 months, etc. This can be used in
+conjunction with any of the other restrictions. Alternatively you can
+type in the time when the script should expire, for example 01/01/2004
+will make the script expire January 1st, 2004. This field uses PHP's
+strtotime format for the time, see http://www.php.net/strtotime for more
+information.
+
+
+PHPCoder License
+
+PHPCoder is distributed under the BSD License, a copy of the BSD License
+is included with the PHPCoder download and also at the top of all source
+files. In cases where this document is not updated the license in
+LICENSE and then source files shall apply.
+
+PHP Coder is distributed under the BSD License below, for more
+information about the BSD License see
+http://www.opensource.org/licenses/bsd-license.php.
+
+Copyright (c) 2003, Jason Sheets <js...@sh...>, Idaho Image
+Works LLC
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+ * Neither the name of the Idaho Image Works LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Contacting the Author (Bug Reports, Feature Requests, etc.)
+
+I can be contacted via e-mail via js...@sh..., please put
+PHPCoder in the subject for efficient mail identification. Feel free to
+send bug reports, feature requests, patches, etc to me. This software
+was developed on Windows and FreeBSD and tested on Windows, Linux and
+FreeBSD. I will make reasonable efforts to support and develop PHPCoder
+but it is developed in my free time for free (it already accomplishes
+what I want it to do).
+
+
+
Index: index.php
===================================================================
RCS file: /cvsroot/phpcoder/phpcoder/index.php,v
retrieving revision 1.2
retrieving revision 1.4
diff -u -d -r1.2 -r1.4
--- index.php 27 Jan 2004 10:51:08 -0000 1.2
+++ index.php 22 Aug 2004 03:00:49 -0000 1.4
@@ -86,7 +86,7 @@
if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
// if we have a user-entered timestamp make sure we are able to parse it using strtotime
if (!empty($_REQUEST['restrictions']['expire_english']) && strtotime($_REQUEST['restrictions']['expire_english']) == '-1') {
- print '<span class="failfont"><blockquote><b>Unable to convert user entered expiration time into a timestamp, please check the format</b></blockquote></span>';
+ print '<span class="failfont"><blockquote><b>Unable to convert the user-entered expiration time into a timestamp, please check the format.</b></blockquote></span>';
} else {
// start encoding process
print '<p><font size="+1"><b>Results:</b></font></p>';
@@ -97,6 +97,8 @@
}
$coder->DisplayForm();
- print '<p><center><a href="http://www.turcksoft.com/en/e_mmc.htm"><img border="0" src="http://www.turcksoft.com/images/mmcache/mmcache02.gif"></a></center></p>';
+ print '<center><p><a href="http://turck-mmcache.sourceforge.net/">
+ <img border="0" src="http://turck-mmcache.sourceforge.net/mmcache02.gif" alt="mmcache button graphic">
+ </a></p></center>';
$coder->HtmlFooter();
?>
|