phpDocumentor phpDocumentor
[ class tree: phpDocumentor ] [ index: phpDocumentor ] [ all elements ]

Source for file phpdoc.php

Documentation is available at phpdoc.php

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <?php
  3. /**
  4.  * Web Interface to phpDocumentor
  5.  * @see new_phpdoc.php
  6.  * @filesource
  7.  * @deprecated in favor of docbuilder (see {@link docbuilder/config.php})
  8.  * @package  phpDocumentor
  9.  */
  10. // 
  11. // 
  12. // An HTML interface for Joshua Eichorn's phpDocumentor
  13. // Author: Juan Pablo Morales  <[email protected]>
  14. //    Joshua Eichorn <[email protected]>
  15. //    Gregory Beaver <[email protected]>
  16. //
  17. // phpDocumentor, a program for creating javadoc style documentation from php code
  18. // Copyright (C) 2000-2002 Joshua Eichorn
  19. // 
  20. // This program is free software; you can redistribute it and/or modify
  21. // it under the terms of the GNU General Public License as published by
  22. // the Free Software Foundation; either version 2 of the License, or
  23. // (at your option) any later version.
  24. //
  25. // This program is distributed in the hope that it will be useful,
  26. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  28. // GNU General Public License for more details.
  29. //
  30. // You should have received a copy of the GNU General Public License
  31. // along with this program; if not, write to the Free Software
  32. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  33. //
  34. //
  35. // Copyleft 2001 Juan Pablo Morales
  36.  
  37. // set up include path so we can find all files, no matter what
  38. $GLOBALS['_phpDocumentor_install_dir'dirname(realpath(__FILE__));
  39. // add my directory to the include path, and make it first, should fix any errors
  40. if (substr(PHP_OS03== 'WIN')
  41. ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].';'.ini_get('include_path'));
  42. else
  43. ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].':'.ini_get('include_path'));
  44.  
  45. /**
  46. * common file information
  47. */
  48. include_once("phpDocumentor/common.inc.php");
  49. if (!function_exists('version_compare'))
  50. {
  51.     print "phpDocumentor requires PHP version 4.1.0 or greater to function";
  52.     exit;
  53. }
  54.  
  55. // find the .ini directory by parsing phpDocumentor.ini and extracting _phpDocumentor_options[userdir]
  56. $ini phpDocumentor_parse_ini_file($_phpDocumentor_install_dir PATH_DELIMITER 'phpDocumentor.ini'true);
  57. if (isset($ini['_phpDocumentor_options']['userdir']))
  58.     $configdir $ini['_phpDocumentor_options']['userdir'];
  59. else
  60.     $configdir $_phpDocumentor_install_dir '/user';
  61.  
  62. // allow the user to change this at runtime
  63. if (!empty($_REQUEST['altuserdir'])) $configdir $_REQUEST['altuserdir'];
  64. ?>
  65. <html>
  66.    <head>
  67.       <title>
  68.          Form to submit to phpDocumentor v<?php print PHPDOCUMENTOR_VER?>
  69.       </title>
  70.       <?php   if(!isset($_GET['submit']|| !empty($_REQUEST['altuserdir'])) {
  71. ?>
  72. <script type="text/javascript" language="Javascript">
  73. /**
  74.    Creates some global variables
  75. */
  76. function initializate() {
  77.  //
  78.  //The "platform independent" newLine
  79.  //
  80.  //Taken from http://developer.netscape.com/docs/manuals/communicator/jsref/brow1.htm#1010426
  81. if (navigator.appVersion.lastIndexOf('Win') != -1)
  82.   $newLine="\r\n";
  83.  else 
  84.   $newLine="\n";
  85. /* for($a=0;$a<document.dataForm.elements.length;$a++) {
  86.  alert("The name is '"+document.dataForm.elements[$a].name+"' "+$a);
  87.  }
  88. */
  89. }
  90. /**Adds the contents of the help box as a directory
  91. */
  92. function addDirectory($object) {
  93.  $object.value = prepareString($object.value)+document.helpForm.fileName.value;
  94. }
  95. /**Adds the contents of the converter box to the converters list
  96. */
  97. function addConverter($object) {
  98.  $object.value = prepareString($object.value)+document.dataForm.ConverterSetting.value;
  99. }
  100. /**Adds the contents of the help box as a file to the given control
  101. */
  102. function addFile($object) {
  103.  $object.value = prepareString($object.value)+document.helpForm.fileName.value;
  104. }
  105. /**Takes a given string and leaves it ready to add a new string
  106.    That is, puts the comma and the new line if needed
  107. */
  108. function prepareString($myString) {
  109.  //First verify that a comma is not at the end
  110.  if($myString.lastIndexOf(",") >= $myString.length-2) {
  111.   //We have a comma at the end
  112.   return $myString;
  113.  }
  114.  if($myString.length > 0) {
  115.   $myString+=","+$newLine;
  116.  }
  117.  return $myString;
  118. }
  119. /**Do the validation needed before sending the from and return a truth value indicating if the form can be sent
  120. */
  121.  function validate() {
  122.   //Take out all newLines and change them by nothing
  123.   //This could be done by using javascript function's replacebut that was implemented only until Navigator 4.0 and so it is better to use more backward compatible functions like substr 
  124.   document.dataForm.elements[0].value= stripNewLines(document.dataForm.elements[0].value);
  125.   document.dataForm.elements[1].value= stripNewLines(document.dataForm.elements[1].value);
  126.   document.dataForm.elements[2].value= stripNewLines(document.dataForm.elements[2].value);
  127.   document.dataForm.elements[3].value= stripNewLines(document.dataForm.elements[3].value);
  128.   document.dataForm.elements[4].value= stripNewLines(document.dataForm.elements[4].value);
  129.   document.dataForm.elements[5].value= stripNewLines(document.dataForm.elements[5].value);
  130.   document.dataForm.elements[6].value= stripNewLines(document.dataForm.elements[6].value);
  131.   document.dataForm.elements[7].value= stripNewLines(document.dataForm.elements[7].value);
  132.   //By returning true we are allowing the form to be submitted
  133.   return true;
  134.  }
  135. /**Takes a string and removes all the ocurrences of new lines
  136. Could have been implemented a lot easier with replace but it's not very backwards compatible
  137. */
  138.  function stripNewLines($myString) {
  139.   return myReplace($myString,$newLine,'');
  140.  }
  141.  function myReplace($string,$text,$by) {
  142.  // Replaces text with by in string
  143.      var $strLength = $string.length, $txtLength = $text.length;
  144.      if (($strLength == 0) || ($txtLength == 0)) return $string;
  145.  
  146.      var $i = $string.indexOf($text);
  147.      if ((!$i) && ($text != $string.substring(0,$txtLength))) return $string;
  148.      if ($i == -1) return $string;
  149.  
  150.      var $newstr = $string.substring(0,$i) + $by;
  151.  
  152.      if ($i+$txtLength < $strLength)
  153.          $newstr += myReplace($string.substring($i+$txtLength,$strLength),$text,$by);
  154.  
  155.      return $newstr;
  156.  }
  157. </script><?php ?>
  158.    </head>
  159.    <?php
  160.    //Find out if we are submitting and if we are, send it
  161.    // This code originally by Joshua Eichorn on phpdoc.php
  162.    //
  163.       if(isset($_GET['submit']&& empty($_REQUEST['altuserdir'])) {
  164.     echo "<body bgcolor=\"#ffffff\">";
  165.     echo "<h1>Parsing Files ...</h1>";
  166.     flush();
  167.     echo "<pre>\n";
  168.     /** phpdoc.inc */
  169.     include("phpDocumentor/phpdoc.inc");
  170.     echo "</pre>\n";
  171.     echo "<h1>Operation Completed!!</h1>";
  172.    else {
  173.     ?>
  174.    <body bgcolor="#ffffff" onload="javascript:initializate()">
  175.       <h1>
  176.          Form to submit to phpDocumentor v<?php print PHPDOCUMENTOR_VER?>
  177.       </h1>
  178.       <form name="dataForm" action="phpdoc.php" method="GET" onsubmit=
  179.       "return validate()">
  180.          <div align="center">
  181.             <table cellpadding="0" cellspacing="0" border="0" width="80%"
  182.             bgcolor="#000000">
  183.                <tr>
  184.                   <td>
  185.                      <table cellpadding="0" cellspacing="1" border="0" width=
  186.                      "100%">
  187.                         <tr>
  188.                            <td bgcolor="#ff6633">
  189.                               <b>Use a pre-created config file for form values.</b> 
  190.                            </td>
  191.                         </tr>
  192.                         <tr>
  193.                            <td bgcolor="#CCCCCC">
  194.                               Normally, phpDocumentor uses the form values from this form to set up parsing.  In version 1.2,
  195.                               phpDocumentor allows you to "save" form values in configuration files so that you can replicate
  196.                               common complicated documentation tasks with only one time.  Just choose a config file below or create a
  197.                               new one and refresh this page to choose it.<hr /><b>change config directory:</b><input size="20" type="text" name="altuserdir" value=""><?php if (!empty($_REQUEST['altuserdir'])) print '<br><i>changed to <b>"'.$_REQUEST['altuserdir'].'"</b></i>'?>
  198.               <b>Choose a config:</b> <select name="setting[useconfig]">
  199.                           <option value="" <?php if (empty($_REQUEST['altuserdir'])) print 'selected'?>>don't use config file</option>
  200.                           <?php
  201.                           $dirs array();
  202.                           $dirs phpDocumentor_ConfigFileList($configdir);
  203.                           $path '';
  204.                           $sel ' selected';
  205.                           if (!empty($_REQUEST['altuserdir'])) $path $configdir PATH_DELIMITER;
  206.                           else $sel '';
  207.                           foreach($dirs as $configfile)
  208.                           {
  209.                               print '<option value="'.$path.$configfile.'"'.$sel.'>'.$configfile.".ini</option>\n";
  210.                               $sel '';
  211.                           }
  212.                           ?>
  213.                               </select><input type="SUBMIT" value=
  214.             "Go" name="submitButton"><br>
  215.                            </td>
  216.                         </tr>
  217.                         <tr>
  218.                            <td bgcolor="#ffdddd">
  219.                               <b>Generated Documentation Title</b> 
  220.                            </td>
  221.                         </tr>
  222.                         <tr>
  223.                            <td bgcolor="#eeeeee">
  224.                               Choose a title for the generated documentation<br>
  225.                               <input type="TEXT" name="setting[title]" size=
  226.                               "80" value="Generated Documentation"><br>
  227.                            </td>
  228.                         </tr>
  229.                         <tr>
  230.                            <td bgcolor="#ff6633">
  231.                               <b>Default Package Name</b> 
  232.                            </td>
  233.                         </tr>
  234.                         <tr>
  235.                            <td bgcolor="#cccccc">
  236.                               Choose a name for the default package<br>
  237.                               <input type="TEXT" name="setting[defaultpackagename]" size=
  238.                               "80" value="default"><br>
  239.                            </td>
  240.                         </tr>
  241.                         <tr>
  242.                            <td bgcolor="#ffdddd">
  243.                               <b>Target</b> 
  244.                            </td>
  245.                         </tr>
  246.                         <tr>
  247.                            <td bgcolor="#eeeeee">
  248.                               Target is the directory where
  249.                               the output produced by phpDocumentor will reside<br>
  250.                               <input type="TEXT" name="setting[target]" size=
  251.                               "80"><br>
  252.                               <a href=
  253.                               "javascript:addDirectory(document.dataForm.elements[5])">
  254.                               Add the directory in the help box</a> 
  255.                            </td>
  256.                         </tr>
  257.                         <tr>
  258.                            <td bgcolor="#ffdddd">
  259.                               <b>Custom Tags</b> 
  260.                            </td>
  261.                         </tr>
  262.                         <tr>
  263.                            <td bgcolor="#eeeeee">
  264.                               Custom Tags is a comma-separated list of tags
  265.                               you want phpDocumentor to include as valid tags
  266.                               in this parse.  An example would be "value, size"
  267.                               to allow @value and @size tags.
  268.                               <input type="TEXT" name="setting[customtags]" size=
  269.                               "80"><br>
  270.                            </td>
  271.                         </tr>
  272.                         <tr>
  273.                            <td bgcolor="#ff6633">
  274.                               <b>Packages to parse</b> 
  275.                            </td>
  276.                         </tr>
  277.                         <tr>
  278.                            <td bgcolor="#CCCCCC">
  279.                               The parameter packages is a group of comma
  280.                               separated names of abstract packages that will
  281.                               be processed by phpDocumentor. All package names must be
  282.                               separated by commas.<br>
  283. <textarea rows="3" cols="80" name=
  284. "setting[packageoutput]"></textarea> <br>
  285.                            </td>
  286.                         </tr>
  287.                         <tr>
  288.                            <td bgcolor="#ffdddd">
  289.                               <b>Files to parse</b> 
  290.                            </td>
  291.                         </tr>
  292.                         <tr>
  293.                            <td bgcolor="#eeeeee">
  294.                               This is a group of comma-separated names of php files
  295.                               or tutorials that will be processed by phpDocumentor.<br>
  296. <textarea rows="6" cols="80" name=
  297. "setting[filename]"></textarea> <br>
  298.                               <a href=
  299.                               "javascript:addFile(document.dataForm.elements[8])">
  300.                               Add the file in the help box</a> 
  301.                            </td>
  302.                         </tr>
  303.                         <tr>
  304.                            <td bgcolor="#ff6633">
  305.                               <b>Directory to parse</b> 
  306.                            </td>
  307.                         </tr>
  308.                         <tr>
  309.                            <td bgcolor="#CCCCCC">
  310.                               This is a group of comma-separated directories where php files
  311.                               or tutorials are found that will be processed by phpDocumentor.
  312.                               phpDocumentor automatically parses subdirectories<br>
  313. <textarea rows="6" cols="80" name="setting[directory]"></textarea> <br>
  314.                               <a href=
  315.                               "javascript:addDirectory(document.dataForm.elements[9])">
  316.                               Add the directory in the help box</a> 
  317.                            </td>
  318.                         </tr>
  319.                         <tr>
  320.                            <td bgcolor="#ffdddd">
  321.                               <b>Output Information</b> 
  322.                            </td>
  323.                         </tr>
  324.                         <tr>
  325.                            <td bgcolor="#eeeeee">
  326.                               <br>
  327.                               Output Information is a comma-separated list of <b>Outputformat:Converter:Templates</b>
  328.                               to apply to the output.  The Converters must be classes descended from Converter
  329.                               defined in the phpDocumentor files, or parsing will not work.  Outputformat
  330.                               may be HTML, XML, PDF, or CHM (case-sensitive) in version 1.2.  There is only one Converter
  331.                               for both CHM and PDF, <b>default</b>.  There are 2 HTML Converters,
  332.                               <b>frames</b> and <b>Smarty</b>. <b>frames templates</b> may be any of:<br><br>
  333.                               <b>default, l0l33t, phpdoc.de, phphtmllib, phpedit, DOM/default, DOM/l0l33t, or DOM/phpdoc.de</b>.
  334.                               <b>Smarty templates</b> may be any of:<br><br>
  335.                               <b>default or PHP</b>.
  336.                               <br>
  337.                               There is only 1 template for all other Converters, <b>default</b>
  338.                               <br>Output type:Converter name:template name <input type=
  339.                               "TEXT" name="setting[output]" value=
  340.                               "HTML:Smarty:default" size="80"><br>
  341.                               <select name="ConverterSetting">
  342.     <option value="HTML:frames:default">HTML:frames:default</option>
  343.     <option value="HTML:frames:l0l33t">HTML:frames:l0l33t</option>
  344.     <option value="HTML:frames:phpdoc.de">HTML:frames:phpdoc.de</option>
  345.     <option value="HTML:frames:phphtmllib">HTML:frames:phphtmllib</option>
  346.     <option value="HTML:frames:phpedit">HTML:frames:phpedit</option>
  347.     <option value="HTML:frames:DOM/default">HTML:frames:DOM/default</option>
  348.     <option value="HTML:frames:DOM/l0l33t">HTML:frames:DOM/l0l33t</option>
  349.     <option value="HTML:frames:DOM/phpdoc.de">HTML:frames:DOM/phpdoc.de</option>
  350.     <option value="HTML:Smarty:default" SELECTED>HTML:Smarty:default</option>
  351.     <option value="HTML:Smarty:PHP">HTML:Smarty:PHP</option>
  352.     <option value="PDF:default:default">PDF:default:default</option>
  353.     <option value="CHM:default:default">CHM:default:default</option>
  354.     <option value="XML:DocBook/peardoc2:default">XML:DocBook/peardoc2:default</option>
  355. </select><br>
  356.                             <a href=
  357.                               "javascript:addConverter(document.dataForm.elements[10])">
  358.                               Add the converter in the help box</a> 
  359.                            </td>
  360.                         </tr>
  361.                         <tr>
  362.                            <td bgcolor="#ff6633">
  363.                               <b>Files to ignore</b> 
  364.                            </td>
  365.                         </tr>
  366.                         <tr>
  367.                            <td bgcolor="#CCCCCC">
  368.                               A list of files (full path or filename), and patterns
  369.                               to ignore.  Patterns may use wildcards * and ?. To
  370.                               ignore all subdirectories named "test" for example,
  371.                               using "test/"  To ignore all files and directories
  372.                               with test in their name use "*test*"
  373. <textarea rows="6" cols="80" name="setting[ignore]"></textarea> <br>
  374.                               <a href=
  375.                               "javascript:addDirectory(document.dataForm.elements[12])">
  376.                               Add the directory in the help box</a> 
  377.                            </td>
  378.                         </tr>
  379.                         <tr>
  380.                            <td bgcolor="#ff6633">
  381.                               <b>Parse @access private</b> 
  382.                            </td>
  383.                         </tr>
  384.                         <tr>
  385.                            <td bgcolor="#CCCCCC">
  386.                               The parameter Parse @access private tells phpDocumentor
  387.                               whether to parse elements with an "@access private" tag in their docblock<br>
  388.                               <input type="checkbox" name="setting[parseprivate]" value="on">Parse private <br>
  389.                            </td>
  390.                         </tr>
  391.                         <tr>
  392.                            <td bgcolor="#ff6633">
  393.                               <b>JavaDoc-compliant Description parsing.</b> 
  394.                            </td>
  395.                         </tr>
  396.                         <tr>
  397.                            <td bgcolor="#CCCCCC">
  398.                               Normally, phpDocumentor uses several rules to determine the short description.  This switch
  399.                               asks phpDocumentor to simply search for the first period (.) and use it to delineate the short
  400.                               description.  In addition, the short description will not be separated from the long description<br>
  401.                               <input type="checkbox" name="setting[javadocdesc]" value="on">JavaDoc-compliant Description <br>
  402.                            </td>
  403.                         </tr>
  404.                      </table>
  405.                   </td>
  406.                </tr>
  407.             </table>
  408.             <input type="HIDDEN" name="interface" value="web"> <input type=
  409.             "HIDDEN" name="submit" value="true"> <input type="SUBMIT" value=
  410.             "Send Form" name="submitButton">
  411.          </div>
  412.       </form>
  413.       <br>
  414.       <br>
  415.       <div align="center">
  416.          <table cellpadding="0" cellspacing="0" border="0" width="80%" bgcolor=
  417.          "#000000">
  418.             <tr>
  419.                <td>
  420.                   <table cellpadding="0" cellspacing="1" border="0" width=
  421.                   "100%">
  422.                      <tr>
  423.                         <td bgcolor="#ffdddd">
  424.                            <b>A little help</b> 
  425.                         </td>
  426.                      </tr>
  427.                      <tr>
  428.                         <td bgcolor="#eeeeee">
  429.                            Since remember long path is not that easy here is a
  430.                            little file control to view names of files that can
  431.                            the be aggregated to the different properties 
  432.                            <form name="helpForm" action="" method="get"
  433.                            enctype="multipart/form-data">
  434.                               <input size="80" type="file" name="fileName">
  435.                            </form>
  436.                         </td>
  437.                      </tr>
  438.                   </table>
  439.                </td>
  440.             </tr>
  441.          </table>
  442.       </div>
  443.       <br>
  444.       <b>Web-Interface Author:</b>
  445.       <p>
  446.          Juan Pablo Morales<br>
  447.          <a href=
  448.          "mailto:[email protected]">[email protected]</a><br>
  449.          Gregory Beaver<br>
  450.          <a href=
  451.          "mailto:[email protected]">[email protected]</a>, all post-0.3.0 modifications
  452.       </p>
  453.       <p>
  454.          If you have any problems with phpDocumentor, please visit the website: <a
  455.          href='http://phpdocu.sourceforge.net'>phpdocu.sourceforge.net</a> and
  456.          submit a bug
  457.       </p>
  458.       <!-- Created: Tue Jun 26 18:52:40 MEST 2001 -->
  459.       <!-- hhmts start -->
  460. <pre>
  461. Last modified: $Date: 2005/10/17 18:15:16 $
  462. Revision: $Revision: 1.1 $
  463. </pre>
  464.       <!-- hhmts end -->
  465.       <?php //End the else that prints all code
  466.             ?>
  467.    </body>
  468. </html>

Documentation generated on Tue, 24 Oct 2006 09:25:28 -0500 by phpDocumentor 1.3.1