techtonik               Thu Sep 22 05:50:31 2005 EDT

  Modified files:              
    /phpdoc/scripts     missing-entities.php.in 
  Log:
  - fix cygwin path issues finally
  * set environment variables within PHP rather from shell
  
http://cvs.php.net/diff.php/phpdoc/scripts/missing-entities.php.in?r1=1.20&r2=1.21&ty=u
Index: phpdoc/scripts/missing-entities.php.in
diff -u phpdoc/scripts/missing-entities.php.in:1.20 
phpdoc/scripts/missing-entities.php.in:1.21
--- phpdoc/scripts/missing-entities.php.in:1.20 Thu Sep 15 04:16:45 2005
+++ phpdoc/scripts/missing-entities.php.in      Thu Sep 22 05:50:30 2005
@@ -17,7 +17,7 @@
   |             Gabor Hojtsy <[EMAIL PROTECTED]>                              |
   +----------------------------------------------------------------------+
   
-  $Id: missing-entities.php.in,v 1.20 2005/09/15 08:16:45 betz Exp $
+  $Id: missing-entities.php.in,v 1.21 2005/09/22 09:50:30 techtonik Exp $
 */
 
 set_time_limit(0);
@@ -38,26 +38,25 @@
 // Support for Windows systems
 $windows = (strpos(PHP_OS, 'WIN') !== false);
 
-// If PHP wasn't compiled on Cygwin, the path needs to be fixed.
-// cygwin's path is hardcoded to C:\cygwin. change it if needed
-if ($windows && (strpos(php_uname(), 'CYGWIN') === false)) {
-    $NSGMLS = preg_replace('@/usr/bin/(.+)@', 'C:\cygwin\bin\\\\\1.exe', 
$NSGMLS);
+// If PHP wasn't compiled on Cygwin, then the path to NSGMLS (if it is
+// *nix path in case NSGMLS is installed via Cygwin setup) should be
+// fixed for exec command to work
+if ($windows 
+    && (strpos(php_uname(), 'CYGWIN') === false)
+    && (strncmp($NSGMLS, "/usr/bin/", 9) === 0)) 
+{
+       $cygbin = exec("cygpath -d /usr/bin/");
+    $NSGMLS = preg_replace("!^/usr/bin/!", $cygbin, $NSGMLS);
 }
 
 
 // Execute a test of the manual
-if("@SP_OPTIONS@" == "" || substr(PHP_OS, 0, 3) == 'WIN') {
-    exec(
-        "$NSGMLS -f $NSGMLS_OUTPUT -i [EMAIL PROTECTED]@ -D . " .
-        "-s @SRCDIR@/dtds/dbxml-4.1.2/phpdocxml.dcl manual.xml"
-    );
-}
-else {
-    exec(
-        "@SP_OPTIONS@ $NSGMLS -f $NSGMLS_OUTPUT -i [EMAIL PROTECTED]@ -D . " .
-        "-s @SRCDIR@/dtds/dbxml-4.1.2/phpdocxml.dcl manual.xml"
-    );
-}
+$envy = explode(" ", "@SP_OPTIONS@");
+array_map('putenv', $envy);
+exec(
+    "$NSGMLS -f $NSGMLS_OUTPUT -i [EMAIL PROTECTED]@ -D . " .
+    "-s @SRCDIR@/dtds/dbxml-4.1.2/phpdocxml.dcl manual.xml"
+);
 
 // Try to open files for rewriting
 $ment = fopen("entities/missing-entities.ent", "w");

Reply via email to