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; }