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

From: Date: Wed, 07 Jan 2009 20:54:12 +0000
Subject: cvs: phpdoc /scripts file-entities.php.in
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-2974@lists.php.net to get a copy of this message
bjori Wed Jan 7 20:54:12 2009 UTC Modified files: /phpdoc/scripts file-entities.php.in Log: Remove unused code http://cvs.php.net/viewvc.cgi/phpdoc/scripts/file-entities.php.in?r1=1.58&r2=1.59&diff_format=u Index: phpdoc/scripts/file-entities.php.in diff -u phpdoc/scripts/file-entities.php.in:1.58 phpdoc/scripts/file-entities.php.in:1.59 --- phpdoc/scripts/file-entities.php.in:1.58 Wed Jan 7 20:26:54 2009 +++ phpdoc/scripts/file-entities.php.in Wed Jan 7 20:54:12 2009 @@ -17,7 +17,7 @@ | Gabor Hojtsy <goba@php.net> | +----------------------------------------------------------------------+ - $Id: file-entities.php.in,v 1.58 2009/01/07 20:26:54 bjori Exp $ + $Id: file-entities.php.in,v 1.59 2009/01/07 20:54:12 bjori Exp $ */ /** @@ -61,24 +61,6 @@ $entities = array(); file_entities("$out_dir/en", "$out_dir/@LANGDIR@", "$out_dir/en", $entities); -$refdir = "$out_dir/en/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") - && !is_file("$refdir/$dir/EXCLUDE")) { - $dirent = str_replace("_","-",$dir); - $title = get_title("$refdir/$dir/reference.xml"); - if (!$title) $title = $dirent; // extension name is close enough - $builtin_extensions[$title] = "&reference.$dirent.reference;"; - } -} -ksort($builtin_extensions); - -create_part_file("entities/builtin-extensions.xml", $builtin_extensions, 'funcref', '&FunctionReference;', '<para>See also <xref linkend="extensions"/>.</para>'); -$entities[] = entstr("builtin.extensions", "$out_dir/entities/builtin-extensions.xml"); - - // Open file for appending and write out all entitities $fp = fopen("$out_dir/entities/file-entities.ent", "w"); if (!$fp) { @@ -320,33 +302,6 @@ } } -/* - * Get relative filename - * Which should have been the case from the start - * - * @param string $f Full file name - * @return string relative file name - */ -function get_relative_f($f) -{ - static $cwd; - // Init - if (empty($cwd)) - { - $cwd = str_replace('\\', '/', getcwd()); - } - - if (substr($f, 0, strlen($cwd)) == $cwd) - { - return substr_replace($f, '..', 0, strlen($cwd)); - } - else - { - return $f; - } -} - - /** * Return windows style path for cygwin. * @@ -358,70 +313,3 @@ } -/** - * 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> - * @param string Contents of <partintro> - */ -function create_part_file ($filename, $entities, $id, $title, $partintro = "") -{ - global $out_dir, $encoding; - - $fp = fopen("$out_dir/$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 xml:id='$id' xmlns='http://docbook.org/ns/docbook'>\n"); - fputs($fp, " <title>$title</title>\n"); - if ($partintro) { - fputs($fp, " <partintro>\n $partintro\n </partintro>\n"); - } - - foreach ($entities as $entity) { - fputs($fp, " $entity\n"); - } - fputs($fp,"</part>\n"); - } else { - fputs($fp, "<!-- File intentionally left blank -->\n"); - } - fclose($fp); -} - -/** - * Pull the main title from reference.xml for sorting the table of contents. - * To avoid bogus sorting, trim whitespace and convert the string to upper case. - * - * @param filename Path to reference.xml (relative to phpdoc dir) - */ -function get_title ($filename) -{ - $matches = array(); - - $contents = file_get_contents($filename); - - /* - * Very basic approach for getting the title. We really should: - * - strip all comments (<!-- --> and <![CDATA[ ]]>) before - * searching for <title> - * - strip tags from inside <title> ... </title> - * - resolve character entities - * - * ... but this is probably good enough for 98.5% of extensions - */ - - if (preg_match("#titleabbrev>(.*?)</titleabbrev>#", $contents, $matches)) { - return strtoupper(trim($matches[1])); - } - - if (preg_match("#<title>(.*?)</title>#", $contents, $matches)) { - return strtoupper(trim($matches[1])); - } - - return null; -} - -?>

« previous php.doc.cvs (#2974) next »