momo            Wed Mar 19 05:48:45 2003 EDT

  Modified files:              
    /phpdoc/scripts     file-entities.php.in 
  Log:
  more cygwin bin fix, add little load but clear.
  
Index: phpdoc/scripts/file-entities.php.in
diff -u phpdoc/scripts/file-entities.php.in:1.10 
phpdoc/scripts/file-entities.php.in:1.11
--- phpdoc/scripts/file-entities.php.in:1.10    Wed Mar 19 04:36:48 2003
+++ phpdoc/scripts/file-entities.php.in Wed Mar 19 05:48:45 2003
@@ -17,7 +17,7 @@
 # |             Gabor Hojtsy <[EMAIL PROTECTED]>                              |
 # +----------------------------------------------------------------------+
 # 
-# $Id: file-entities.php.in,v 1.10 2003/03/19 09:36:48 momo Exp $
+# $Id: file-entities.php.in,v 1.11 2003/03/19 10:48:45 momo Exp $
 */
 
 /**
@@ -50,20 +50,15 @@
 // XSL sheets are used or not (either "yes" or "no")
 $xsl_sheet_used = ("@DOCBOOKXSL_USED@" == "yes" ? TRUE : FALSE);
 
-
 // when php complied on cygwin, the working path have to be /cygdrive..
 // the below preg_replace have to be done only using binary php complied on MSVC.
 // let's find if php was complied by cygwin:
-ob_start();
-phpinfo(1);
-$tmp = ob_get_contents();
-ob_end_clean();
-$cygwin_complied = eregi("CYGWIN",$tmp) ? true : false;
+$cygwin_complied = eregi("CYGWIN",php_uname()) ? true : false;
        
 // The output directory, which we need to parse for windows specific
 // things, and correct all problems is needed.
 // Also use absolute path to have meaningful error messages
-$out_dir = abs_path(preg_replace("!^/cygdrive/(\\w)/!", "\\1:/", "@WORKDIR@"));
+$out_dir = abs_path(strip_cygdrive("@WORKDIR@"));
 
 // this path if used for saving the ent file:
 $script_out_dir = $cygwin_complied ? "@WORKDIR@" : $out_dir;
@@ -370,7 +365,16 @@
         // notation before the file name
         // !! BUT it's not honored by xsltproc so uncomment it for now !!
         // if ($xsl_sheet_used) { $filename = "file:///" . $filename; }
-        return sprintf("<!ENTITY %-40s SYSTEM '%s'>\n", $entname, $filename);
+        return sprintf("<!ENTITY %-40s SYSTEM '%s'>\n", $entname, 
strip_cygdrive($filename));
     }
+}
+
+/**
+ * Return windows style path for cygwin.
+ * 
+ * @param string $path Orginal path
+ */
+function strip_cygdrive($path){
+       return preg_replace("!^/cygdrive/(\\w)/!", "\\1:/", $path);
 }
 ?>



-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to