// Joshua Eichorn // Gregory Beaver // // phpDocumentor, a program for creating javadoc style documentation from php code // Copyright (C) 2000-2002 Joshua Eichorn // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // // Copyleft 2001 Juan Pablo Morales if (!function_exists('version_compare')) { print "phpDocumentor requires PHP version 4.1.0 or greater to function"; exit; } // set up include path so we can find all files, no matter what $GLOBALS['_phpDocumentor_install_dir'] = dirname(realpath(__FILE__)); // add my directory to the include path, and make it first, should fix any errors if (substr(PHP_OS, 0, 3) == 'WIN') ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].';'.ini_get('include_path')); else ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].':'.ini_get('include_path')); /** * common file information */ include_once("phpDocumentor/common.inc.php"); // find the .ini directory by parsing phpDocumentor.ini and extracting _phpDocumentor_options[userdir] $ini = phpDocumentor_parse_ini_file($_phpDocumentor_install_dir . PATH_DELIMITER . 'phpDocumentor.ini', true); if (isset($ini['_phpDocumentor_options']['userdir'])) $configdir = $ini['_phpDocumentor_options']['userdir']; else $configdir = $_phpDocumentor_install_dir . '/user'; // allow the user to change this at runtime if (!empty($_REQUEST['altuserdir'])) $configdir = $_REQUEST['altuserdir']; ?> Form to submit to phpDocumentor v<?php print PHPDOCUMENTOR_VER; ?> path = $path; $options = array(); if ($text) $options['text'] = $text; if ($link) $options['link'] = $link; if ($icon) $options['icon'] = $icon; HTML_TreeNode::HTML_TreeNode($options,$events); } } function getDir($path,&$node) { global $pd; if (!$dir = opendir($path)) return; $node = new HTML_TreeNode(array('text' => basename(realpath($path)), 'link' => "", 'icon' => 'folder.gif')); while (($file = readdir($dir)) !== false) { if ($file != '.' && $file != '..') { if (is_dir("$path$pd$file") && !is_link("$path$pd$file")) { $entry[] = "$path$pd$file"; } } } closedir($dir); for($i = 0; $i < count($entry); $i++) { $node->addItem(new HTML_TreeNode(array('text'=>basename(realpath($entry[$i])), 'link' => "javascript:setHelp('".addslashes(realpath($entry[$i]))."');", 'icon' => 'folder.gif'))); } } function recurseDir($path, &$node) { global $pd; if (!$dir = opendir($path)) { return false; } $anode = new HTML_TreeNode(array('text' => basename($path), 'link' => "javascript:setHelpVal('".$path."');", 'icon' => 'folder.gif')); $result = addslashes(realpath(stripslashes($path).$pd."..")); if (!$node) $anode->addItem(new DirNode('..',"javascript:setHelp('".$result."');",'folder.gif'),'..'); while (($file = readdir($dir)) !== false) { if ($file != '.' && $file != '..') { if (is_dir("$path$pd$file")) { recurseDir("$path$pd$file",$anode); } } } rewinddir($dir);// while (false){//($file = readdir($dir)) !== false) { if ($file != '.' && $file != '..') { if (is_file("$path$pd$file")) { $anode->addItem(new DirNode($file,"javascript:setHelpVal('$path$pd$file');",'branchtop.gif',"$path$pd$file")); } } } if (!$node) $node = $anode; else $node->addItem($anode); closedir($dir); } function switchDirTree($path, &$node) { global $pd; // initialize recursion simulation values // array format: path => &parent in $node itemlist $parent = array(); $parent_indexes = array(); $parenti = 1; $node = new DirNode(basename($path),"javascript:setHelpVal('".$path."');",'folder.gif',$path); $result = addslashes(realpath($path.$pd."..")); $node->addItem(new DirNode('..',"javascript:setHelp('".$result."');",'folder.gif','..')); $rnode = &$node; $parent[realpath($path)] = false; $recur = 0; do { if ($recur++ > 120) return; if (!$dir = @opendir($path)) { // no child files or directories // echo "$path no child files or directories return to "; $rnode = &$parent[realpath($path)]; $path = $rnode->path; if (isset($parent_indexes[realpath($path)])) $parenti = $parent_indexes[realpath($path)]; // echo "$path parenti $parenti
"; } // fancy_debug($path,$parent_indexes); // vdump_par($parent); if (!isset($parent_indexes[realpath($path)])) { $file = readdir($dir); while ($file !== false) { if ($file != '.' && $file != '..') { if (@is_dir(realpath("$path$pd$file"))) { if (!isset($parent_indexes[realpath($path)])) $parent_indexes[realpath($path)] = true; $parent[realpath("$path$pd$file")] = &$rnode; // echo "
adding new ".addslashes(realpath($path.$pd.$file))." to $path
"; $rnode->addItem(new DirNode(addslashes(realpath("$path$pd$file")),"javascript:setHelpVal('".addslashes(realpath($path.$pd.$file))."');",'folder.gif',addslashes(realpath($path.$pd.$file)))); } } $file = readdir($dir); } } // go down the tree if possible if (isset($parent_indexes[realpath($path)])) { if ($parenti + 1 > (count($rnode->items))) { // no more children, go back up to parent // echo "$path no more children, go back up to parent "; $rnode = &$parent[realpath($path)]; $path = $rnode->path; if (isset($parent_indexes[realpath($path)])) $parenti = $parent_indexes[realpath($path)]; // echo $path." parenti $parenti
"; } else { // go to next child // echo "$path go to next child "; $parent_indexes[realpath($path)] = $parenti+1; // debug("set parent ".$rnode->items[$parenti]->path." = ".$rnode->path.'
'); $parent[realpath($rnode->items[$parenti]->path)] = &$rnode; $rnode = &$rnode->items[$parenti]; $path = $rnode->path; // echo "$path
"; $parenti = 0; } } else { // no children, go back up the tree to the next child // echo "$path no children, go back up to parent "; $rnode = &$parent[realpath($path)]; $path = $rnode->path; if (isset($parent_indexes[realpath($path)])) $parenti = $parent_indexes[realpath($path)]; // echo "$path parenti $parenti
"; } @closedir($dir); } while ($path && (($parenti < (count($rnode->items))) || ($parent[realpath($path)] !== false))); } function vdump_par($tree) { foreach($tree as $key => $val) { if ($val === false) debug($key.' -> false
'); else debug($key.' -> ' .$val->path.'
'); } debug('
'); } $menu = new HTML_TreeMenu(); $filename = ''; if (isset($_GET) && isset($_GET['fileName'])) $filename = $_GET['fileName']; $filename = realpath($filename); $pd = (substr(PHP_OS, 0, 3) == 'WIN') ? '\\' : '/'; $test = ($pd == '/') ? '/' : 'C:\\'; if (empty($filename) || ($filename == $test)) { $filename = ($pd == '/') ? '/' : 'C:\\'; $node = false; getDir($filename,$node); } else { flush(); // if ($pd != '/') $pd = $pd.$pd; $anode = false; switchDirTree($filename,$anode); // recurseDir($filename,$anode); $node = new HTML_TreeNode(array('text' => "Click to view $filename",'link' => "",'icon' => 'branchtop.gif')); $node->addItem($anode); }; $menu->addItem($node); $DHTMLmenu = &new HTML_TreeMenu_DHTML($menu, array('images' => 'HTML_TreeMenu-1.1.2/images')); ?> "; echo "

Parsing Files ...

"; flush(); echo "
\n";
    /** phpdoc.inc */
    include("phpDocumentor/phpdoc.inc");
    echo "
\n"; echo "

Operation Completed!!

"; } else { ?>

phpDocumentor v Web Interface

phpDocumentor written by Joshua Eichorn
Web Interface written by Juan Pablo Morales and enhanced by Greg Beaver
Help use this to find directories and files which can be used below
printMenu(); ?>
Use a pre-created config file for form values. Normally, phpDocumentor uses the form values from this form to set up parsing. In version 1.2, phpDocumentor allows you to "save" form values in configuration files so that you can replicate common complicated documentation tasks with only one time. Just choose a config file below or create a new one and refresh this page to choose it.
change config directory:changed to "'.$_REQUEST['altuserdir'].'"'; ?> Choose a config:
Target Target is the directory where the output produced by phpDocumentor will reside

Add the directory in the help box
Files to parse This is a group of comma-separated names of php files or tutorials that will be processed by phpDocumentor.

Add the file in the help box
Directory to parse This is a group of comma-separated directories where php files or tutorials are found that will be processed by phpDocumentor. phpDocumentor automatically parses subdirectories

Add the directory in the help box
Files to ignore A list of files (full path or filename), and patterns to ignore. Patterns may use wildcards * and ?. To ignore all subdirectories named "test" for example, using "test/" To ignore all files and directories with test in their name use "*test*"
Add the directory in the help box
Generated Documentation Title Choose a title for the generated documentation

Default Package Name Choose a name for the default package

Custom Tags Custom Tags is a comma-separated list of tags you want phpDocumentor to include as valid tags in this parse. An example would be "value, size" to allow @value and @size tags.
Packages to parse The parameter packages is a group of comma separated names of abstract packages that will be processed by phpDocumentor. All package names must be separated by commas.

Output Information
Outputformat may be HTML, XML, PDF, or CHM (case-sensitive) in version 1.2. There is only one Converter for both CHM and PDF, default. There are 2 HTML Converters, frames and Smarty. frames templates may be any of:

default, l0l33t, phpdoc.de, phphtmllib, phpedit, DOM/default, DOM/l0l33t, or DOM/phpdoc.de. Smarty templates may be any of:

default or PHP.

There is only 1 template for all other Converters, default
Output type:Converter name:template name

Add the converter in the help box
Use ONLY the converter in the help box
Parse @access private The parameter Parse @access private tells phpDocumentor whether to parse elements with an "@access private" tag in their docblock
Parse private
JavaDoc-compliant Description parsing. Normally, phpDocumentor uses several rules to determine the short description. This switch asks phpDocumentor to simply search for the first period (.) and use it to delineate the short description. In addition, the short description will not be separated from the long description
JavaDoc-compliant Description



Joshua Eichorn jeichorn@phpdoc.org
Juan Pablo Morales ju-moral@uniandes.edu.co
Gregory Beaver cellog@users.sourceforge.net

If you have any problems with phpDocumentor, please visit the website: phpdocu.sourceforge.net and submit a bug

Last modified: $Date: 2005/10/17 18:15:16 $
Revision: $Revision: 1.1 $