public function build() { $handler = PEAR_PackageProjector::singleton()->getMessageHandler(); // Create API Document $handler->buildMessage(5, "Update API Document files... ", true); ob_start(); require_once "phpDocumentor/phpDocumentor/Setup.inc.php"; global $argv; $apidoc = $this->_dir . '/' . $this->_release_version; $old_argv = $argv; $argv = array('-p', '-t', $apidoc, '-d', $this->_src_dir); $phpdoc = new phpDocumentor_setup(); $phpdoc->readCommandLineSettings(); $phpdoc->setupConverters(); $phpdoc->createDocs(); $buff = ob_get_contents(); ob_end_clean(); $handler->buildMessage(5, $buff, true); // Create Hatena Document $handler->buildMessage(5, "Update main document file... ", true); $list = glob($this->_dir . "/*"); $links = array(); foreach ($list as $num => $filepath) { if (is_dir($filepath)) { $basename = basename($filepath); $links[] = '<li><a href="' . $basename . '/index.html">' . $basename . '</a></li>' . PHP_EOL; } } rsort($links); $this->pm('apilinks', implode(PHP_EOL, $links)); file_put_contents($this->_dir . 'index.html', $this->tpl()); $argv = $old_argv; }
/** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * @access protected * @since 1.4.0a1 */ protected function setUp() { $GLOBALS['_phpDocumentor_install_dir'] = PHPDOCUMENTOR_BASE; $GLOBALS['_phpDocumentor_setting']['quiet'] = "true"; $this->ps = new phpDocumentor_setup(); $this->ps->setTitle("Unit Testing"); // this step is necessary to ensure ps->render is instantiated $this->pp = new parserPage(); }
/** * Enables quiet mode. * * This method exists as a hack because the API exposed for this method in PhpDocumentor * doesn't work correctly. * * Note that because we are setting a "private" GLOBAL(!!) config var with this value, this * is subject to break if PhpDocumentor internals changes. * */ public function setQuietMode() { global $_phpDocumentor_setting; $_phpDocumentor_setting['quiet'] = true; parent::setQuietMode(); }
/** * Extreme example of messy input... * the resulting converter names are generally invalid. * This test uses two arg with value of "//default//" * @since 1.3.2 */ public function testExtremeExampleAndInvalidTertiaryB() { $this->assertEquals("//default//", $this->ps->cleanConverterNamePiece("//default//", $this->CHARACTERS_ALLOWED_IN_TERTIARY)); }