Re: cvs: phpdoc /scripts file-entities.php.in

From: Date: Wed, 09 Feb 2005 10:57:27 +0000
Subject: Re: cvs: phpdoc /scripts file-entities.php.in
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969366428@lists.php.net to get a copy of this message
Don't forget to skip the "iisfunc" reference ;) didou Hartmut Holzgraefe wrote:
hholzgra Wed Feb 9 05:33:07 2005 EDT
  Modified files:                  /phpdoc/scripts	file-entities.php.in   Log:
Use a function to generate function reference files from entity list, automaticly create list for phpdoc reference sections too http://cvs.php.net/diff.php/phpdoc/scripts/file-entities.php.in?r1=1.26&r2=1.27&ty=u Index: phpdoc/scripts/file-entities.php.in diff -u phpdoc/scripts/file-entities.php.in:1.26 phpdoc/scripts/file-entities.php.in:1.27 --- phpdoc/scripts/file-entities.php.in:1.26 Tue Feb 8 20:07:59 2005 +++ phpdoc/scripts/file-entities.php.in Wed Feb 9 05:33:07 2005 @@ -17,7 +17,7 @@
   |             Gabor Hojtsy <goba@php.net>                              |
+----------------------------------------------------------------------+ - $Id: file-entities.php.in,v 1.26 2005/02/09 01:07:59 hholzgra Exp $ + $Id: file-entities.php.in,v 1.27 2005/02/09 10:33:07 hholzgra Exp $ */ /** @@ -91,6 +91,19 @@ $entities = array(); file_entities($orig_dir, $trans_dir, $orig_dir, $entities); +$refdir = "$orig_dir/reference"; +$dh = opendir($refdir); +while ($dir = readdir($dh)) { + if ($dir{0} === ".") continue; // ignore system dir entries and hidden files + if (is_file("$refdir/$dir/reference.xml")) { + $dirent = str_replace("_","-",$dir); + $builtin_extensions[] = "&reference.$dirent.reference;"; + } +} + +create_part_file("entities/builtin-extensions.xml", $builtin_extensions, 'funcref', '&FunctionReference'); +$entities[] = entstr("builtin.extensions", "entities/builtin-extensions.xml"); + // additional documentation embedded in PECL extensions $pecl_extensions = array(); @@ -103,8 +116,6 @@
         $pecl_dirs[] = $dir;
     }
     -    sort($pecl_dirs);
-
     foreach ($pecl_dirs as $dir) {
         $docdir = "$pecl_source/$dir/manual";
 @@ -126,19 +137,7 @@
     closedir($dh);
} -$fp = fopen("$srcdir/entities/pecl-extensions.xml","w"); -if(count($pecl_extensions)) {
-    fputs($fp, "<?xml version='1.0' encoding='$encoding' ?>  -  <part id='pecl-funcref'>
- <title>&PECLReference;</title> -");
-    foreach ($pecl_extensions as $ext) {
-        fputs($fp, "   $ext\n");
-    }
-    fputs($fp,"  </part>\n");
-} -fclose($fp); - +create_part_file("entities/pecl-extensions.xml", $pecl_extensions, 'pecl-funcref', "&PECLReference;"); $entities[] = entstr("pecl.extensions", "entities/pecl-extensions.xml"); // additional documentation embedded in external extension sources @@ -158,20 +157,11 @@
     }
     $addon_extensions[] = "&reference.$dirent.reference;";
} -$fp = fopen("$srcdir/entities/addon-extensions.xml","w"); -if(count($addon_extensions)) {
-    fputs($fp, "<?xml version='1.0' encoding='$encoding' ?>  -  <part id='addon-funcref'>
- <title>&AddOnReference;</title> -");
-    foreach ($addon_extensions as $ext) {
-        fputs($fp, "   $ext\n");
-    }
-    fputs($fp,"  </part>\n");
-} -fclose($fp); + +create_part_file("entities/addon-extensions.xml", $addon_extensions, 'addon-funcref', '&AddOnReference'); $entities[] = entstr("addon.extensions", "entities/addon-extensions.xml"); + // Open file for appending and write out all entitities $fp = fopen("$script_out_dir/entities/file-entities.ent", "w"); if (!$fp) { @@ -436,8 +426,41 @@ * Return windows style path for cygwin. * * @param string $path Orginal path + * @return string windows style path */ function strip_cygdrive($path){
     return preg_replace("!^/cygdrive/(\\w)/!", "\\1:/", $path);
} + + +/** + * Create a reference <part> + * + * @param string Name of file to create (relative to phpdoc dir) + * @param array Entities to list in this file + * @param string XML Id for the files top level <part> tag + * @param string Title for this <part> + */ +function create_part_file ($filename, $entities, $id, $title) +{ + global $srcdir, $encoding; + + sort($entities); + + $fp = fopen("$srcdir/$filename","w"); + fputs($fp, "<?xml version='1.0' encoding='$encoding' ?>\n"); + fputs($fp, "<!-- FILE AUTOGENERATED BY file-entities.php, DO NOT EDIT !!! -->\n"); + if(count($entities)) { + fputs($fp, "<part id='$id'>\n"); + fputs($fp, " <title>$title</title>\n"); + + foreach ($entities as $entity) { + fputs($fp, " $entity\n"); + } + fputs($fp,"</part>\n"); + } else { + fputs($fp, "<!-- File intentionaly left blank -->\n"); + } + fclose($fp); +} ?>


« previous php.doc (#969366428) next »