removed mods directory from the ATutor codebase
[atutor.git] / mods / phpdoc / PHPDoc / core / Phpdoc.php
diff --git a/mods/phpdoc/PHPDoc/core/Phpdoc.php b/mods/phpdoc/PHPDoc/core/Phpdoc.php
deleted file mode 100644 (file)
index 145cc79..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-<?php\r
-/**\r
-* Coordinates several Phpdoc Object to parse and render source files.\r
-* \r
-* @access              public\r
-* @version     $Id: Phpdoc.php,v 1.4 2000/12/03 20:30:42 uw Exp $\r
-*/\r
-class Phpdoc extends PhpdocSetupHandler {\r
-\r
-       /**\r
-       * Result from the indexer\r
-       *\r
-       * @var  array\r
-       * @see  render()\r
-       */\r
-       var $indexer_result = array();\r
-\r
-       /**\r
-       * Print status messages\r
-       */\r
-       var $flag_output = true;\r
-\r
-       /**\r
-       * Calls the command line handler if necessary.\r
-       *\r
-       * @global array $argc, string $PHP_SELF\r
-       */\r
-       function Phpdoc() {\r
-               global $argc, $PHP_SELF;\r
-\r
-               $this->target = $PHP_SELF."apidoc/";\r
-\r
-               if ($argc>1) \r
-                       $this->handleArgv();\r
-\r
-       } // end constructor\r
-\r
-       /**\r
-       * Starts the parser. \r
-       *\r
-       * @return       bool            $ok\r
-       * @throws       PhpdocError\r
-       * @access       public\r
-       */\r
-       function parse() {\r
-\r
-               $this->warn = new PhpdocWarning;\r
-\r
-               $errors = $this->checkStatus();\r
-               if (0 != count($errors)) {\r
-\r
-                       reset($errors);\r
-                       while (list($k, $error)=each($errors))\r
-                               $this->err[] = new PhpdocError($error["msg"]."Errno = ".$error["errno"], 9, __FILE__, __LINE__);\r
-\r
-                       return false;\r
-               }\r
-\r
-               $this->outl("Parser starts...");\r
-\r
-               // create some objects\r
-               $fileHandler            = new PhpdocFileHandler;\r
-               $parser                                 = new PhpdocParser(true);\r
-               $classAnalyser  = new PhpdocClassAnalyser;\r
-               $moduleAnalyser = new PhpdocModuleAnalyser;\r
-\r
-               $indexer        = new PhpdocIndexer;                            \r
-\r
-               $classExporter  = new PhpdocXMLClassExporter();\r
-               $classExporter->setPath($this->target);\r
-\r
-               $moduleExporter = new PhpdocXMLModuleExporter();\r
-               $moduleExporter->setPath($this->target);\r
-\r
-               $indexExporter = new PhpdocXMLIndexExporter();\r
-               $indexExporter->setPath($this->target);\r
-\r
-               $warningExporter = new PhpdocXMLWarningExporter();\r
-               $warningExporter->setPath($this->target);\r
-\r
-               // This will change one fine day! \r
-               $parser->warn                           = $this->warn;\r
-               $classAnalyser->warn    = $this->warn;\r
-               $moduleAnalyser->warn = $this->warn;\r
-               $classExporter->warn    = $this->warn;\r
-               $moduleExporter->warn = $this->warn;\r
-               $indexer->warn                          = $this->warn; \r
-\r
-               $sourcefiles = $fileHandler->getFilesInDirectory($this->sourceDirectory, $this->sourceFileSuffix);\r
-               $parser->setPhpSourcecodeFiles($fileHandler->get($sourcefiles));\r
-\r
-               $this->outl("... preparse to find modulegroups and classtrees.");\r
-               $parser->preparse();\r
-\r
-               $this->outl("... parsing classes.");\r
-               while ($classtree = $parser->getClassTree()) {\r
-\r
-                       $classAnalyser->setClasses( $classtree, $parser->current_baseclass );\r
-                       $classAnalyser->analyse();\r
-\r
-                       while ($class = $classAnalyser->getClass()) {\r
-                               $indexer->addClass($class);\r
-                               $classExporter->export($class);\r
-                       }\r
-\r
-                       if (floor(phpversion()) > 3) {\r
-\r
-                               $indexExporter->exportClasstree($indexer->getClasstree(), $parser->current_baseclass);\r
-\r
-                       } else {\r
-\r
-                               $classtree = $indexer->getClasstree();\r
-                               $base = $parser->current_baseclass;\r
-                               $indexExporter->exportClasstree($classtree, $base);\r
-\r
-                       }\r
-\r
-               }\r
-\r
-               $this->outl("... parsing modules.");\r
-               while ($modulegroup = $parser->getModulegroup()) {      \r
-\r
-                       $moduleAnalyser->setModulegroup( $modulegroup );\r
-                       $moduleAnalyser->analyse();\r
-\r
-                       while ($module = $moduleAnalyser->getModule()) {\r
-                               $indexer->addModule($module);\r
-                               $moduleExporter->export($module);\r
-                       }\r
-\r
-                       if (floor(phpversion()) > 3) {\r
-\r
-                               $indexExporter->exportModulegroup($indexer->getModulegroup());\r
-\r
-                       } else {\r
-\r
-                               $modulegroup = $indexer->getModulegroup();\r
-                               $indexExporter->exportModulegroup($modulegroup);\r
-\r
-                       }\r
-\r
-               }\r
-\r
-               $this->outl("... writing packagelist.");\r
-               if (floor(phpversion()) > 3) {\r
-\r
-                       $indexExporter->exportPackagelist($indexer->getPackages());\r
-                       $indexExporter->exportElementlist($indexer->getElementlist());\r
-\r
-               } else {\r
-\r
-                       $packages = $indexer->getPackages();\r
-                       $indexExporter->exportPackagelist($packages);\r
-                       $elements = $indexer->getElementlist();\r
-                       $indexExporter->exportElementlist($elements);\r
-\r
-               }\r
-\r
-               $warningExporter->export($parser->warn->getWarnings(), "parser");\r
-               $warningExporter->export($moduleAnalyser->warn->getWarnings(), "moduleanalyser");\r
-               $warningExporter->export($classAnalyser->warn->getWarnings(), "classanalyser");\r
-\r
-               $this->outl("Parser finished.");\r
-               return true;\r
-       } // end func parse\r
-\r
-       /**\r
-       * Renders the PHPDoc XML files as HTML files \r
-       *\r
-       * @param        string  Targetformat, currently only "html" is available.\r
-       * @param        string  Target directory for the html files\r
-       * @param        string  Directory with the html templates\r
-       * @return       bool            $ok\r
-       * @throws       PhpdocError\r
-       * @access       public\r
-       */\r
-       function render($type = "html", $target = "", $template = "") {\r
-\r
-               $this->outl("Starting to render...");\r
-               $target = ("" == $target) ? $this->target : $this->getCheckedDirname($target);\r
-               $template =     ("" == $template) ? $this->templateRoot : $this->getCheckedDirname($template);                          \r
-\r
-               switch(strtolower($type)) {\r
-\r
-                       case "html":\r
-                       default:\r
-                               $renderer = new PhpdocHTMLRendererManager($target, $template, $this->application, $this->targetFileSuffix);\r
-                               break;\r
-               }\r
-\r
-               $fileHandler            = new PhpdocFileHandler;\r
-               $files = $fileHandler->getFilesInDirectory($target, "xml");\r
-               $len = strlen($target);\r
-\r
-               $tpl = new IntegratedTemplate($this->templateRoot);\r
-               $tpl->loadTemplateFile("xmlfiles.html");\r
-               $tpl->setCurrentBlock("file_loop");\r
-\r
-               // Do not change the file prefixes!\r
-               reset($files);\r
-               while (list($k, $file) = each($files)) {\r
-\r
-                       $tpl->setVariable("FILE", substr($file, $len));\r
-                       $tpl->parseCurrentBlock();\r
-\r
-                       if ("class_" == substr($file, $len, 6)) {\r
-\r
-                               $renderer->render(substr($file, $len), "class");\r
-\r
-                       } else if ("module_" == substr($file, $len, 7)) {\r
-\r
-                               $renderer->render(substr($file, $len), "module");\r
-\r
-                       } else if ("classtree_" == substr($file, $len, 10)) {\r
-\r
-                               $renderer->render(substr($file, $len), "classtree");\r
-\r
-                       }       else if ("modulegroup_" ==  substr($file, $len, 12)) {\r
-\r
-                               $renderer->render(substr($file, $len), "modulegroup");\r
-\r
-                       } else if ("warnings_" == substr($file, $len, 9)) {\r
-\r
-                               $renderer->render(substr($file, $len), "warning");\r
-\r
-                       }\r
-\r
-               }\r
-\r
-               $renderer->finish();    \r
-               $fileHandler->createFile($target."phpdoc_xmlfiles".$this->targetFileSuffix, $tpl->get());\r
-\r
-               $this->outl($this->finishInstructions);\r
-               return true;\r
-       } // end func   render\r
-\r
-} // end class Phpdoc\r
-?>
\ No newline at end of file