cvs: pear /PHPDoc/core Phpdoc.php /PHPDoc/filehandler PhpdocFileHandler.php /PHPDoc/renderer/html PhpdocHTMLIndexRenderer.php

From: Date: Thu, 23 Aug 2001 15:59:50 +0000
Subject: cvs: pear /PHPDoc/core Phpdoc.php /PHPDoc/filehandler PhpdocFileHandler.php /PHPDoc/renderer/html PhpdocHTMLIndexRenderer.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-626@lists.php.net to get a copy of this message
chagenbu Thu Aug 23 11:59:50 2001 EDT Modified files: /pear/PHPDoc/core Phpdoc.php /pear/PHPDoc/filehandler PhpdocFileHandler.php /pear/PHPDoc/renderer/html PhpdocHTMLIndexRenderer.php Log: Make sure that lists come out in sorted order, and turn off template caching when generating the packagelists; it takes more time, but with it on only the first one gets generated. Index: pear/PHPDoc/core/Phpdoc.php diff -u pear/PHPDoc/core/Phpdoc.php:1.1 pear/PHPDoc/core/Phpdoc.php:1.2 --- pear/PHPDoc/core/Phpdoc.php:1.1 Tue May 8 00:48:36 2001 +++ pear/PHPDoc/core/Phpdoc.php Thu Aug 23 11:59:49 2001 @@ -3,7 +3,7 @@ * Coordinates several Phpdoc Object to parse and render source files. * * @access public -* @version $Id: Phpdoc.php,v 1.1 2001/05/08 04:48:36 sbergmann Exp $ +* @version $Id: Phpdoc.php,v 1.2 2001/08/23 15:59:49 chagenbu Exp $ */ class Phpdoc extends PhpdocSetupHandler { @@ -192,6 +192,7 @@ $fileHandler = new PhpdocFileHandler; $files = $fileHandler->getFilesInDirectory($target, "xml"); + sort($files); $len = strlen($target); $tpl = new IntegratedTemplate($this->templateRoot); @@ -237,4 +238,4 @@ } // end func render } // end class Phpdoc -?> \ No newline at end of file +?> Index: pear/PHPDoc/filehandler/PhpdocFileHandler.php diff -u pear/PHPDoc/filehandler/PhpdocFileHandler.php:1.1 pear/PHPDoc/filehandler/PhpdocFileHandler.php:1.2 --- pear/PHPDoc/filehandler/PhpdocFileHandler.php:1.1 Tue May 8 00:48:37 2001 +++ pear/PHPDoc/filehandler/PhpdocFileHandler.php Thu Aug 23 11:59:50 2001 @@ -2,7 +2,7 @@ /** * File handling functions in phpdoc. * -* @version $Id: PhpdocFileHandler.php,v 1.1 2001/05/08 04:48:37 sbergmann Exp $ +* @version $Id: PhpdocFileHandler.php,v 1.2 2001/08/23 15:59:50 chagenbu Exp $ * @author Ulf Wendel <ulf@redsys.de> */ class PhpdocFileHandler extends PhpdocObject { @@ -185,10 +185,10 @@ if ("." == $file || ".." == $file) continue; - if ($flag_subdir && is_dir($directory.$file)) + if ($flag_subdir && @is_dir($directory.$file)) $files = $this->getFilesInDirectory($directory.$file, $suffix, true, $files); - if (!is_file($directory.$file)) + if (!@is_file($directory.$file)) continue; if ($flag_all) { @@ -205,4 +205,4 @@ } // end fun getFilesInDirectory } // end class PhpdocFileHandler -?> \ No newline at end of file +?> Index: pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php diff -u pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.1 pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.2 --- pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php:1.1 Tue May 8 00:48:38 2001 +++ pear/PHPDoc/renderer/html/PhpdocHTMLIndexRenderer.php Thu Aug 23 11:59:50 2001 @@ -2,7 +2,7 @@ /** * Renders Index lists. * -* @version $Id: PhpdocHTMLIndexRenderer.php,v 1.1 2001/05/08 04:48:38 sbergmann Exp $ +* @version $Id: PhpdocHTMLIndexRenderer.php,v 1.2 2001/08/23 15:59:50 chagenbu Exp $ */ class PhpdocHTMLIndexRenderer extends PhpdocHTMLRenderer { @@ -188,6 +188,7 @@ } $chapters = $this->accessor->getChapters(); + ksort($chapters); reset($chapters); while (list($name, $elements) = each($chapters)) { @@ -283,7 +284,8 @@ $this->loadPackagelist($xmlfile); $this->tpl->loadTemplatefile("packagelist.html"); - + + ksort($this->packages); reset($this->packages); while (list($packagename, $package) = each($this->packages)) { @@ -292,8 +294,9 @@ if (!isset($package[$field])) continue; - $this->tpl->setCurrentBlock("package_".$field."_loop"); + $this->tpl->setCurrentBlock("package_".$field."_loop"); + sort($package[$field]); reset($package[$field]); while (list($k, $element) = each($package[$field])) { @@ -336,33 +339,34 @@ $this->loadPackagelist($xmlfile); reset($this->packages); + $caching = $this->tpl->flagCacheTemplatefile; + $this->tpl->flagCacheTemplatefile = false; while (list($packagename, $package) = each($this->packages)) { - - $this->tpl->loadTemplatefile("frame_packageelementlist.html"); + $this->tpl->loadTemplatefile('frame_packageelementlist.html'); reset($this->packageFields); while (list($k, $field) = each($this->packageFields)) { - if (!isset($package[$field])) + if (!isset($package[$field])) { continue; + } $this->tpl->setCurrentBlock("package_" . $field . "_loop"); + sort($package[$field]); reset($package[$field]); while (list($k, $element) = each($package[$field])) { - $this->tpl->setVariable("ELEMENT", sprintf('<a href="%s" target="main">%s</a>', - $this->nameToUrl($element) . $this->file_extension, - $element - ) - ); + $this->nameToUrl($element) . $this->file_extension, + $element + ) + ); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("package_" . $field); $this->tpl->setVariable("EMPTY", ""); $this->tpl->parseCurrentBlock(); - } $this->tpl->setCurrentBlock("package"); @@ -371,9 +375,9 @@ $this->tpl->setVariable("APPNAME", $this->application); $packagename = $this->nameToUrl($packagename); - $this->fileHandler->createFile($this->path . "packageelementlist_" . $packagename . $this->file_extension, $this->tpl->get() ); - + $this->fileHandler->createFile($this->path . "packageelementlist_" . $packagename . $this->file_extension, $this->tpl->get()); } + $this->tpl->flagCacheTemplatefile = $caching; $this->tpl->free(); @@ -456,4 +460,4 @@ } // end func buildClasstreeHTML } // end class PhpdocHTMLIndexRenderer -?> \ No newline at end of file +?>

« previous php.pear.cvs (#626) next »