goba            Thu Dec 26 17:08:51 2002 EDT

  Modified files:              
    /phpdoc/htmlhelp    filter_files.php make_chm.php 
    /phpdoc/htmlhelp/suppfiles/html     _script.js 
  Log:
  A few enhancements to make the build system more automatic:
  
   - Use exec("copy ...") to copy supplemental files and
     hh[pkc] files
   - Make _script.js really dynamic, rewrite it's contents
     in generation time to include language and date
   - Remove the CVS dir from the skins dir, automatically
     copied by xcopy
  
  
  
Index: phpdoc/htmlhelp/filter_files.php
diff -u phpdoc/htmlhelp/filter_files.php:1.1 phpdoc/htmlhelp/filter_files.php:1.2
--- phpdoc/htmlhelp/filter_files.php:1.1        Thu Dec 26 14:11:03 2002
+++ phpdoc/htmlhelp/filter_files.php    Thu Dec 26 17:08:51 2002
@@ -14,7 +14,7 @@
 // Filter XSL generated files through some refine filters
 function filterFiles()
 {
-    global $HTML_SRC, $HTML_TARGET, $INDEX_FILE;
+    global $HTML_SRC, $HTML_TARGET, $INDEX_FILE, $LANGUAGE;
     
     // How many files were processed
     $counter = 0;
@@ -36,22 +36,19 @@
     }
     closedir($handle);
 
-    // Open supplemental files directory, and copy
-    // all files to output directory
-    $handle = opendir("./suppfiles/html/");
-    while (false !== ($filename = readdir($handle))) {
-        if (!in_array($filename, array(".", ".."))) {
-            copy("suppfiles/html/$filename", "$HTML_TARGET/$filename");
-            $counter++;
-            echo "> $counter\r";
-        }
-    }
-    closedir($handle);
-
-    // Copy source Help files from html dir to output dir
-    copy("$HTML_SRC/php_manual_en.hhp", "$HTML_TARGET/php_manual_en.hhp");
-    copy("$HTML_SRC/php_manual_en.hhc", "$HTML_TARGET/php_manual_en.hhc");
-    copy("$HTML_SRC/php_manual_en.hhk", "$HTML_TARGET/php_manual_en.hhk");
+    // Copy all supplemental files to the target directory
+    exec("copy suppfiles\\html $HTML_TARGET /Y");
+    
+    // Copy all HTML Help files to the target directory too
+    exec("copy $HTML_SRC\\php_manual_$LANGUAGE.hh? $HTML_TARGET /Y");
+    
+    // Rewrite script file to include current language and date
+    $script_js = join("", file("$HTML_TARGET/_script.js"));
+    $script_js = str_replace("LANGUAGE_HERE", $LANGUAGE, $script_js);
+    $script_js = str_replace("DATE_HERE", date("Y-m-d"), $script_js);
+    $fp = fopen("$HTML_TARGET/_script.js", "w");
+    fwrite($fp, $script_js);
+    fclose($fp);
     
     return $counter;
 } // filterFiles() function end
Index: phpdoc/htmlhelp/make_chm.php
diff -u phpdoc/htmlhelp/make_chm.php:1.1 phpdoc/htmlhelp/make_chm.php:1.2
--- phpdoc/htmlhelp/make_chm.php:1.1    Thu Dec 26 14:11:03 2002
+++ phpdoc/htmlhelp/make_chm.php        Thu Dec 26 17:08:51 2002
@@ -163,6 +163,7 @@
 exec("copy suppfiles\\quickref $RELEASE_DIR /Y");
 exec("copy suppfiles\\fixes $RELEASE_DIR /Y");
 exec("xcopy /S /I /Q suppfiles\\skins $RELEASE_DIR\\skins");
+exec("rmdir /S /Q $RELEASE_DIR\\skins\\CVS");
 
 // Delete unused files
 if ($END_CLEANUP) {
Index: phpdoc/htmlhelp/suppfiles/html/_script.js
diff -u phpdoc/htmlhelp/suppfiles/html/_script.js:1.1 
phpdoc/htmlhelp/suppfiles/html/_script.js:1.2
--- phpdoc/htmlhelp/suppfiles/html/_script.js:1.1       Thu Dec 26 14:14:47 2002
+++ phpdoc/htmlhelp/suppfiles/html/_script.js   Thu Dec 26 17:08:51 2002
@@ -476,8 +476,8 @@
 // Main JS program flow
 
 // Default vars for all the pages [generated]
-this_lang = 'en';
-this_date = '2002-11-09';
+this_lang = 'LANGUAGE_HERE';
+this_date = 'DATE_HERE';
 
 // Vars for online menu of this particular page
 this_page     = location.pathname.substring(location.pathname.lastIndexOf("/")+1);



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

Reply via email to