goba            Mon Jan  7 05:47:49 2002 EDT

  Modified files:              
    /phpdoc/scripts     process.php 
  Log:
  Now, apply scripts are in the apply directory, make script a bit
  more clever, and also accept no modification return values (FALSE)
  
  
Index: phpdoc/scripts/process.php
diff -u phpdoc/scripts/process.php:1.1 phpdoc/scripts/process.php:1.2
--- phpdoc/scripts/process.php:1.1      Sat Jul  7 17:19:48 2001
+++ phpdoc/scripts/process.php  Mon Jan  7 05:47:48 2002
@@ -9,8 +9,10 @@
   <?=$argv[0]?> <apply-script> [<startdir>]
 
   <apply-script> must contain the function apply($input),
-  which recieves a whole xml-file, and should output
-  return the new file.
+  which recieves a whole xml-file, and should return
+  the new file, or false if no modification needed.
+  Apply scripts reside in the apply folder below this
+  script. You only need to give the file name.
 
   With <startdir> you can specify in which dir
   to start looking recursively for xml files.
@@ -23,7 +25,7 @@
 
 echo "Starting with manual-process\n";
 echo "Including $argv[1]...";
-include("$argv[1]");
+include("apply/$argv[1]");
 echo " done\n";
 if (!function_exists('apply'))
 {
@@ -58,6 +60,7 @@
                continue;
        }
        $new = apply($old);
+    if ($new === FALSE) { echo "NO MODIFICATION: $file not modified"; }
        $fp = fopen($file,'w');
        $res = fwrite($fp,$new);
        fclose($fp);


Reply via email to