hholzgra Sat Jan 14 21:33:31 2006 UTC
Modified files: /phpdoc/scripts zendapi_macros.php Log: WS http://cvs.php.net/viewcvs.cgi/phpdoc/scripts/zendapi_macros.php?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/scripts/zendapi_macros.php diff -u phpdoc/scripts/zendapi_macros.php:1.2 phpdoc/scripts/zendapi_macros.php:1.3 --- phpdoc/scripts/zendapi_macros.php:1.2 Sat Jan 14 15:25:26 2006 +++ phpdoc/scripts/zendapi_macros.php Sat Jan 14 21:33:31 2006 @@ -10,8 +10,8 @@ "zend_list.h", "zend_variables.h", "zend_unicode.h", - "zend_operators.h", - "zend_execute.h"); + "zend_operators.h", + "zend_execute.h"); $macro_prefixes = array("ZEND_", "Z_", "RETURN_"); @@ -23,42 +23,42 @@ $in = fopen("$zend_include_dir/$infile", "r"); if (!$in) { - die("can't open $zend_include_dir/$infile"); + die("can't open $zend_include_dir/$infile"); } // loop over all lines in the file while (!feof($in)) { - $line = trim(fgets($in)); + $line = trim(fgets($in)); - // now check for all known macro prefixes - foreach ($macro_prefixes as $prefix) { - // does this line match a macro definition? - if (preg_match("|#define\\s*($prefix\\w+)\\s*\\((.*)\\)|U", $line, $matches)) { - // get macro name and parameter list from the matches - $macro = $matches[1]; - $params = preg_split('|,\s+|', $matches[2]); - - // path to output file - $outfile = $output_dir."/".$macro.".xml"; - - // do not overwrite existing files unless specified - if ($overwrite || !file_exists($outfile)) { - // now write the template file to phpdoc/en/internals/zendapi/macros - ob_start(); - - echo '<?xml version="1.0" encoding="iso-8859-1"?>'."\n"; - - // take revision from existing file if any, else it is 1.1 - if (!$overwrite || !file_exists($outfile)) { - echo "<!-- $"."Revision: 1.1 $ -->\n"; - } else { - foreach (file($outfile) as $line) { - if (strstr($line, 'Revision: ')) { - echo $line; - break; - } - } - } + // now check for all known macro prefixes + foreach ($macro_prefixes as $prefix) { + // does this line match a macro definition? + if (preg_match("|#define\\s*($prefix\\w+)\\s*\\((.*)\\)|U", $line, $matches)) { + // get macro name and parameter list from the matches + $macro = $matches[1]; + $params = preg_split('|,\s+|', $matches[2]); + + // path to output file + $outfile = $output_dir."/".$macro.".xml"; + + // do not overwrite existing files unless specified + if ($overwrite || !file_exists($outfile)) { + // now write the template file to phpdoc/en/internals/zendapi/macros + ob_start(); + + echo '<?xml version="1.0" encoding="iso-8859-1"?>'."\n"; + + // take revision from existing file if any, else it is 1.1 + if (!$overwrite || !file_exists($outfile)) { + echo "<!-- $"."Revision: 1.1 $ -->\n"; + } else { + foreach (file($outfile) as $line) { + if (strstr($line, 'Revision: ')) { + echo $line; + break; + } + } + } ?> <refentry id="zend-macro.<?php echo str_replace("_", "-", $macro); ?>"> <refnamediv> @@ -67,7 +67,7 @@ </refnamediv> <refsect1 role="description"> - &reftitle.description; + &reftitle.description; <methodsynopsis> <type>???</type><methodname><?php echo $macro; ?></methodname> <?php @@ -135,9 +135,9 @@ <?php file_put_contents($outfile, ob_get_clean()); - } - } - } + } + } + } } }