本文整理汇总了PHP中HTMLWriter::HTMLWriter方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLWriter::HTMLWriter方法的具体用法?PHP HTMLWriter::HTMLWriter怎么用?PHP HTMLWriter::HTMLWriter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLWriter
的用法示例。
在下文中一共展示了HTMLWriter::HTMLWriter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: frameOutputWriter
/** Build the HTML frameset.
*
* @param Doclet doclet
*/
function frameOutputWriter(&$doclet)
{
parent::HTMLWriter($doclet);
ob_start();
echo <<<END
\t\t
<frameset cols="20%,80%">
<frameset rows="30%,70%">
<frame src="overview-frame.html" name="packagelist">
<frame src="allitems-frame.html" name="index">
</frameset>
<frame src="overview-summary.html" name="main">
<noframes>
<body>
<h2>Frame Alert</h2>
<p>This document is designed to be viewed using frames. If you see this message, you are using a non-frame-capable browser.<br>
Link to <a href="overview-summary.html">Non-frame version</a>.</p>
</body>
</noframes>
</frameset>
END;
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write('index.html', FALSE, FALSE);
}
示例2: frameOutputWriter
/** Build the HTML frameset.
*
* @param Doclet doclet
*/
public function frameOutputWriter(&$doclet)
{
parent::HTMLWriter($doclet);
ob_start();
echo <<<END
<frameset cols="20%,80%" frameborder="1" border="1" bordercolor="#bbb" framespacing="1">
<frame src="frame.html" name="index">
<frame src="namespaces.html" name="main">
<noframes>
<body>
<h2>Frame Alert</h2>
<p>This document is designed to be viewed using frames. If you see this message, you are using a non-frame-capable browser.<br>
Link to <a href="namespaces.html">Non-frame version</a>.</p>
</body>
</noframes>
</frameset>
END;
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write('index.html', false, false, false);
}
示例3: functionWriter
/** Build the function definitons.
*
* @param Doclet doclet
*/
function functionWriter(&$doclet)
{
parent::HTMLWriter($doclet);
$this->_id = 'definition';
$rootDoc =& $this->_doclet->rootDoc();
$packages =& $rootDoc->packages();
ksort($packages);
foreach ($packages as $packageName => $package) {
$this->_sections[0] = array('title' => 'Overview', 'url' => 'overview-summary.html');
$this->_sections[1] = array('title' => 'Package', 'url' => $package->asPath() . '/package-summary.html');
$this->_sections[2] = array('title' => 'Function', 'selected' => TRUE);
//$this->_sections[3] = array('title' => 'Use');
$this->_sections[4] = array('title' => 'Tree', 'url' => 'overview-tree.html');
$this->_sections[5] = array('title' => 'Deprecated', 'url' => 'deprecated-list.html');
$this->_sections[6] = array('title' => 'Index', 'url' => 'index-all.html');
$this->_depth = $package->depth() + 1;
ob_start();
echo "<hr>\n\n";
echo "<h1>Functions</h1>\n\n";
echo "<hr>\n\n";
$functions =& $package->functions();
if ($functions) {
ksort($functions);
echo '<table id="summary_function" class="title">', "\n";
echo '<tr><th colspan="2" class="title">Function Summary</th></tr>', "\n";
foreach ($functions as $function) {
$textTag =& $function->tags('@text');
echo "<tr>\n";
echo '<td class="type">', $function->modifiers(FALSE), ' ', $function->returnTypeAsString(), "</td>\n";
echo '<td class="description">';
echo '<p class="name"><a href="#', $function->name(), '()">', $function->name(), '</a>', $function->flatSignature(), '</p>';
if ($textTag) {
echo '<p class="description">', strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>'), '</p>';
}
echo "</td>\n";
echo "</tr>\n";
}
echo "</table>\n\n";
echo '<h2 id="detail_function">Function Detail</h2>', "\n";
foreach ($functions as $function) {
$textTag =& $function->tags('@text');
echo '<div class="location">', $function->location(), "</div>\n";
echo '<h3 id="', $function->name(), '()">', $function->name(), "</h3>\n";
echo '<code class="signature">', $function->modifiers(), ' ', $function->returnTypeAsString(), ' <strong>';
echo $function->name(), '</strong>', $function->flatSignature();
echo "</code>\n";
echo '<div class="details">', "\n";
if ($textTag) {
echo $this->_processInlineTags($textTag), "\n";
}
$this->_processTags($function->tags());
echo "</div>\n\n";
echo "<hr>\n\n";
}
}
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write($package->asPath() . '/package-functions.html', 'Functions', TRUE);
}
}
示例4: functionWriter
/** Build the function definitons.
*
* @param Doclet doclet
*/
public function functionWriter(&$doclet)
{
parent::HTMLWriter($doclet);
$this->_id = 'definition';
$rootDoc =& $this->_doclet->rootDoc();
$packages =& $rootDoc->packages();
ksort($packages);
foreach ($packages as $packageName => $package) {
$this->_depth = $package->depth() + 1;
ob_start();
echo '<header>';
echo '<h1>' . $this->_doclet->_docTitle . '</h1>';
echo "<span>Global</span>\n\n";
echo "<h2>Functions</h2>\n\n";
echo '</header>';
$functions =& $package->functions();
if ($functions) {
ksort($functions);
echo '<table>', "\n";
foreach ($functions as $function) {
$textTag =& $function->tags('@text');
echo "<tr>\n";
echo '<td class="type">', $function->modifiers(FALSE), ' ', $function->returnTypeAsString(), "</td>\n";
echo '<td class="description">';
echo '<p class="name"><a href="#', $function->name(), '()">', $function->name(), '</a>', $function->flatSignature(), '</p>';
if ($textTag) {
echo '<p class="description">', strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>'), '</p>';
}
echo "</td>\n";
echo "</tr>\n";
}
echo "</table>\n\n";
echo '<h2>Details</h2>', "\n";
foreach ($functions as $function) {
$textTag =& $function->tags('@text');
$this->_sourceLocation($function);
echo '<h3 id="', $function->name(), '()">', $function->name(), "</h3>\n";
echo '<code class="signature">', $function->modifiers(), ' ', $function->returnTypeAsString(), ' <strong>';
echo $function->name(), '</strong>', $function->flatSignature();
echo "</code>\n";
echo '<div class="details">', "\n";
if ($textTag) {
echo $this->_processInlineTags($textTag), "\n";
}
$this->_processTags($function->tags());
echo "</div>\n\n";
}
}
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write($package->asPath() . '/package-functions.html', 'Functions', TRUE);
}
}
示例5: packageFrameWriter
/** Build the package frame index.
*
* @param Doclet doclet
*/
function packageFrameWriter(&$doclet)
{
parent::HTMLWriter($doclet);
$rootDoc =& $this->_doclet->rootDoc();
$this->_output =& $this->_allItems($rootDoc);
$this->_write('allitems-frame.html', 'All Items', FALSE);
$packages =& $rootDoc->packages();
ksort($packages);
foreach ($packages as $packageName => $package) {
$this->_depth = $package->depth() + 1;
$this->_output =& $this->_buildFrame($package);
$this->_write($package->asPath() . '/package-frame.html', $package->name(), FALSE);
}
}
示例6: functionWriter
function functionWriter(&$doclet)
{
parent::HTMLWriter($doclet);
$rootDoc =& $this->_doclet->rootDoc();
$packages =& $rootDoc->packages();
ksort($packages);
foreach ($packages as $packageName => $package) {
$doc = new DomDocument();
$doc->preserveWhiteSpace = FALSE;
$doc->formatOutput = TRUE;
$dom_functions = $doc->createElement('functions');
$dom_functions->setAttribute('package', $package->name());
$functions =& $package->functions();
if ($functions) {
ksort($functions);
foreach ($functions as $function) {
$dom_function = $doc->createElement('function');
$dom_modifiers = $doc->createElement('modifiers');
foreach (explode(' ', trim($function->modifiers())) as $modifier) {
$dom_modifiers->appendChild($doc->createElement('modifier', $modifier));
}
$dom_function->appendChild($dom_modifiers);
$type = $function->returnTypeAsString();
$type = $this->__removeTextFromMarkup($type);
$dom_function->setAttribute('name', $function->name());
$dom_function->setAttribute('return', $type);
$dom_signature = $doc->createElement('parameters');
$this->getSignature($function, $doc, $dom_signature);
$dom_function->appendChild($dom_signature);
$dom_location = $doc->createElement('location', $function->sourceFilename());
$dom_location->setAttribute('line', $function->sourceLine());
$dom_function->appendChild($dom_location);
$textTag =& $function->tags('@text');
if ($textTag) {
$dom_description = $doc->createElement('description', $this->_processInlineTags($textTag));
$dom_function->appendChild($dom_description);
}
$dom_functions->appendChild($dom_function);
}
}
$doc->appendChild($dom_functions);
$this->_output = $doc->saveXML();
$this->_write($package->asPath() . '/package-functions.xml', 'Functions', TRUE);
}
}
示例7: frameOutputWriter
/** Build the HTML frameset.
*
* @param Doclet doclet
*/
function frameOutputWriter(&$doclet)
{
parent::HTMLWriter($doclet);
ob_start();
echo <<<END
\t\t
\t\t<table border="0" width="100%" height="100%">
\t\t\t<tr>
\t\t\t\t<td width="200" class="sidebar">
\t\t\t\t\t<iframe frameBorder="0" scrolling="no" src="overview-frame.html" class="overview-frame" name="packagelist" width="100%"></iframe>
\t\t\t\t\t<p> </p>
\t\t\t\t\t<iframe frameBorder="0" scrolling="no" src="allitems-frame.html" class="allitems-frame" name="index" width="100%"></iframe>
\t\t\t\t</td>
\t\t\t\t<td><iframe frameBorder="0" scrolling="no" src="overview-summary.html" class="overview-summary-frame" name="main" width="100%"></iframe></td>
\t\t\t</tr>
\t\t</table>
END;
//<frameset cols="20%,80%" frameborder="1" framespacing="1" border="1">
//
//<frameset rows="30%,70%" frameborder="2" framespacing="2" border="2">
//
//<frame src="overview-frame.html" name="packagelist">
//<frame src="allitems-frame.html" name="index">
//
//</frameset>
//
//<frame src="overview-summary.html" name="main">
//
//<noframes>
// <body>
// <h2>Frame Alert</h2>
// <p>This document is designed to be viewed using frames. If you see this message, you are using a non-frame-capable browser.<br>
// Link to <a href="overview-summary.html">Non-frame version</a>.</p>
// </body>
//</noframes>
//
//</frameset>
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write('index.html', FALSE, FALSE);
}
示例8: packageIndexFrameWriter
/** Build the package frame index.
*
* @param Doclet doclet
*/
function packageIndexFrameWriter(&$doclet)
{
parent::HTMLWriter($doclet);
ob_start();
echo '<body id="frame">', "\n\n";
echo '<h1>' . $this->_doclet->getHeader() . "</h1>\n\n";
echo "<ul>\n";
echo '<li><a href="allitems-frame.html" target="index">All Items</a></li>' . "\n";
echo "</ul>\n\n";
echo "<h1>Namespaces</h1>\n\n";
$rootDoc =& $this->_doclet->rootDoc();
echo "<ul>\n";
$packages =& $rootDoc->packages();
ksort($packages);
foreach ($packages as $name => $package) {
echo '<li><a href="' . $package->asPath() . '/package-frame.html" target="index">' . $package->name() . '</a></li>' . "\n";
}
echo "</ul>\n\n";
echo '</body>', "\n\n";
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write('overview-frame.html', 'Overview', FALSE);
}
示例9: sourceWriter
/** Parse the source files.
*
* @param Doclet doclet
*/
function sourceWriter(&$doclet)
{
parent::HTMLWriter($doclet);
$rootDoc =& $this->_doclet->rootDoc();
$phpdoctor =& $this->_doclet->phpdoctor();
$this->_sections[0] = array('title' => 'Overview', 'url' => 'overview-summary.html');
$this->_sections[1] = array('title' => 'Package');
$this->_sections[2] = array('title' => 'Class');
//$this->_sections[3] = array('title' => 'Use');
if ($phpdoctor->getOption('tree')) {
$this->_sections[4] = array('title' => 'Tree', 'url' => 'overview-tree.html');
}
$this->_sections[5] = array('title' => 'Files', 'url' => 'overview-files.html', 'selected' => TRUE);
$this->_sections[6] = array('title' => 'Deprecated', 'url' => 'deprecated-list.html');
$this->_sections[7] = array('title' => 'Index', 'url' => 'index-all.html');
$sources =& $rootDoc->sources();
$this->_id = 'files';
ob_start();
echo "<hr>\n\n";
echo '<h1>Source Files</h1>';
echo "<ul>\n";
foreach ($sources as $filename => $data) {
$url = strtolower(str_replace(DIRECTORY_SEPARATOR, '/', $filename));
echo '<li><a href="source/', $url, '.html">', $filename, '</a></li>';
}
echo "</ul>\n";
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write('overview-files.html', 'Overview', TRUE);
$this->_id = 'file';
foreach ($sources as $filename => $data) {
$this->_sections[0] = array('title' => 'Overview', 'url' => 'overview-summary.html');
$this->_sections[1] = array('title' => 'Package');
$this->_sections[2] = array('title' => 'Class');
//$this->_sections[3] = array('title' => 'Use');
if ($phpdoctor->getOption('tree')) {
$this->_sections[4] = array('title' => 'Tree');
}
$this->_sections[5] = array('title' => 'Files', 'url' => 'overview-files.html');
$this->_sections[6] = array('title' => 'Deprecated', 'url' => 'deprecated-list.html');
$this->_sections[7] = array('title' => 'Todo', 'url' => 'todo-list.html');
$this->_sections[8] = array('title' => 'Index', 'url' => 'index-all.html');
$this->_depth = substr_count($filename, '/') + 1;
if (class_exists('GeSHi')) {
$geshi = new GeSHi($data[0], 'php');
$source = $geshi->parse_code();
} else {
$source = '<pre>' . $data[0] . '</pre>';
}
ob_start();
echo "<hr>\n\n";
echo '<h1>' . $filename . "</h1>\n";
if (isset($data[1]['tags']['@text'])) {
echo '<div class="comment" id="overview_description">', $this->_processInlineTags($data[1]['tags']['@text']), "</div>\n\n";
}
echo "<hr>\n\n";
foreach (explode("\n", $source) as $index => $line) {
echo '<a name="line' . ($index + 1) . '"></a>' . $line . "\n";
}
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write('source/' . strtolower($filename) . '.html', $filename, TRUE);
}
}
示例10: globalWriter
/** Build the function definitons.
*
* @param Doclet doclet
*/
public function globalWriter(&$doclet)
{
parent::HTMLWriter($doclet);
$this->_id = 'definition';
$rootDoc =& $this->_doclet->rootDoc();
$packages =& $rootDoc->packages();
ksort($packages);
foreach ($packages as $packageName => $package) {
$this->_sections[0] = array('title' => 'Overview', 'url' => 'overview-summary.html');
$this->_sections[1] = array('title' => 'Namespace', 'url' => $package->asPath() . '/package-summary.html');
$this->_sections[2] = array('title' => 'Global', 'selected' => TRUE);
//$this->_sections[3] = array('title' => 'Use');
$this->_sections[4] = array('title' => 'Tree', 'url' => 'overview-tree.html');
if ($doclet->includeSource()) {
$this->_sections[5] = array('title' => 'Files', 'url' => 'overview-files.html');
}
$this->_sections[6] = array('title' => 'Deprecated', 'url' => 'deprecated-list.html');
$this->_sections[7] = array('title' => 'Todo', 'url' => 'todo-list.html');
$this->_sections[8] = array('title' => 'Index', 'url' => 'index-all.html');
$this->_depth = $package->depth() + 1;
ob_start();
echo "<hr>\n\n";
echo "<h1>Globals</h1>\n\n";
echo "<hr>\n\n";
$globals =& $package->globals();
if ($globals) {
ksort($globals);
echo '<table id="summary_global" class="title">', "\n";
echo '<tr><th colspan="2" class="title">Global Summary</th></tr>', "\n";
foreach ($globals as $global) {
$textTag =& $global->tags('@text');
$type =& $global->type();
echo "<tr>\n";
echo '<td class="type">', $global->modifiers(FALSE), ' ', $global->typeAsString(), "</td>\n";
echo '<td class="description">';
echo '<p class="name"><a href="#', $global->name(), '">', $global->name(), '</a></p>';
if ($textTag) {
echo '<p class="description">', strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>'), '</p>';
}
echo "</td>\n";
echo "</tr>\n";
}
echo "</table>\n\n";
echo '<h2 id="detail_global">Global Detail</h2>', "\n";
foreach ($globals as $global) {
$textTag =& $global->tags('@text');
$type =& $global->type();
$this->_sourceLocation($global);
echo '<h3 id="', $global->name(), '">', $global->name(), "</h3>\n";
echo '<code class="signature">', $global->modifiers(), ' ', $global->typeAsString(), ' <strong>';
echo $global->name(), '</strong>';
if ($global->value()) {
echo ' = ', htmlspecialchars($global->value());
}
echo "</code>\n";
echo '<div class="details">', "\n";
if ($textTag) {
echo $this->_processInlineTags($textTag), "\n";
}
echo "</div>\n\n";
$this->_processTags($global->tags());
echo "<hr>\n\n";
}
}
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write($package->asPath() . '/package-globals.html', 'Globals', TRUE);
}
}
示例11: deprecatedWriter
function deprecatedWriter(&$doclet)
{
parent::HTMLWriter($doclet);
$rootDoc =& $this->_doclet->rootDoc();
$doc = new DomDocument();
$doc->preserveWhiteSpace = FALSE;
$doc->formatOutput = TRUE;
$dom_deprecated = $doc->createElement('deprecated');
$deprecatedClasses = array();
$deprecatedFields = array();
$deprecatedMethods = array();
$deprecatedConstants = array();
$deprecatedGlobals = array();
$deprecatedFunctions = array();
$classes =& $rootDoc->classes();
if ($classes) {
foreach ($classes as $class) {
if ($class->tags('@deprecated')) {
$deprecatedClasses[] = $class;
}
$fields =& $class->fields();
if ($fields) {
foreach ($fields as $field) {
if ($field->tags('@deprecated')) {
$deprecatedFields[] = $field;
}
}
}
$classes =& $class->methods();
if ($classes) {
foreach ($classes as $method) {
if ($method->tags('@deprecated')) {
$deprecatedMethods[] = $method;
}
}
}
$constants =& $class->constants();
if ($constants) {
foreach ($constants as $constant) {
if ($constant->tags('@deprecated')) {
$deprecatedConstants[] = $constant;
}
}
}
}
}
$globals =& $rootDoc->globals();
if ($globals) {
foreach ($globals as $global) {
if ($global->tags('@deprecated')) {
$deprecatedGlobals[] = $global;
}
}
}
$functions =& $rootDoc->functions();
if ($functions) {
foreach ($functions as $function) {
if ($function->tags('@deprecated')) {
$deprecatedFunctions[] = $function;
}
}
}
if ($deprecatedClasses) {
$dom_list = $doc->createElement('classes');
foreach ($deprecatedClasses as $item) {
$textTag =& $item->tags('@text');
$description = '';
if ($textTag) {
$description = $this->_processInlineTags($textTag);
}
$dom_item = $doc->createElement('class', $description);
$dom_item->setAttribute('name', $item->name());
$dom_item->setAttribute('package', $item->packageName());
$dom_list->appendChild($dom_item);
}
$dom_deprecated->appendChild($dom_list);
}
if ($deprecatedFields) {
$dom_list = $doc->createElement('fields');
foreach ($deprecatedFields as $item) {
$textTag =& $item->tags('@text');
$description = '';
if ($textTag) {
$description = $this->_processInlineTags($textTag);
}
$dom_item = $doc->createElement('field', $description);
$dom_item->setAttribute('name', $item->name());
$dom_item->setAttribute('class', $item->containingClass()->name());
$dom_item->setAttribute('package', $item->packageName());
$dom_list->appendChild($dom_item);
}
$dom_deprecated->appendChild($dom_list);
}
if ($deprecatedConstants) {
$dom_list = $doc->createElement('constants');
foreach ($deprecatedConstants as $item) {
$textTag =& $item->tags('@text');
$description = '';
if ($textTag) {
$description = $this->_processInlineTags($textTag);
//.........这里部分代码省略.........
示例12: __construct
/** Build the class definitons.
*
* @param Doclet doclet
*/
public function __construct(&$doclet)
{
parent::HTMLWriter($doclet);
$this->_id = 'definition';
$rootDoc =& $this->_doclet->rootDoc();
$phpdoctor =& $this->_doclet->phpdoctor();
$packages =& $rootDoc->packages();
ksort($packages);
foreach ($packages as $packageName => $package) {
$this->_depth = $package->depth() + 1;
$classes =& $package->allClasses();
if ($classes) {
ksort($classes);
foreach ($classes as $name => $class) {
ob_start();
echo '<header>';
echo '<h1>' . $this->_doclet->_docTitle . '</h1>';
if ($class->isInterface()) {
echo "<span>Interface</span>\n\n";
} elseif ($class->isTrait()) {
echo "<span>Trait</span>\n\n";
} else {
echo "<span>Class</span>\n\n";
}
echo '<h2>', $class->qualifiedName(), "</h2>\n\n";
echo '</header>';
$implements =& $class->interfaces();
if (count($implements) > 0) {
echo "<dl>\n";
echo "<dt>All Implemented Interfaces:</dt>\n";
echo '<dd>';
foreach ($implements as $interface) {
echo '<a href="', str_repeat('../', $this->_depth), $interface->asPath(), '">';
if ($interface->packageName() != $class->packageName()) {
echo $interface->packageName(), '\\';
}
echo $interface->name(), '</a> ';
}
echo "</dd>\n";
echo "</dl>\n\n";
}
$traits =& $class->traits();
if (count($traits) > 0) {
echo "<dl>\n";
echo "<dt>All Used Traits:</dt>\n";
echo '<dd>';
foreach ($traits as $trait) {
echo '<a href="', str_repeat('../', $this->_depth), $trait->asPath(), '">';
if ($trait->packageName() != $class->packageName()) {
echo $trait->packageName(), '\\';
}
echo $trait->name(), '</a> ';
}
echo "</dd>\n";
echo "</dl>\n\n";
}
$subclasses = $class->subclasses();
if ($subclasses) {
echo "<dl>\n";
echo "<dt>All Known Subclasses:</dt>\n";
echo '<dd>';
foreach ($subclasses as $subclass) {
echo '<a href="', str_repeat('../', $this->_depth), $subclass->asPath(), '">';
if ($subclass->packageName() != $class->packageName()) {
echo $subclass->packageName(), '\\';
}
echo $subclass->name(), '</a> ';
}
echo "</dd>\n";
echo "</dl>\n\n";
}
if ($class->isInterface()) {
echo '<p class="signature">', $class->modifiers(), ' interface <strong>', $class->name(), '</strong>';
} elseif ($class->isTrait()) {
echo '<p class="signature">', $class->modifiers(), ' trait <strong>', $class->name(), '</strong>';
} else {
echo '<p class="signature">', $class->modifiers(), ' class <strong>', $class->name(), '</strong>';
}
if ($class->superclass()) {
$superclass =& $rootDoc->classNamed($class->superclass());
if ($superclass) {
echo ' extends <a href="', str_repeat('../', $this->_depth), $superclass->asPath(), '">', $superclass->name(), "</a>\n\n";
} else {
echo ' extends ', $class->superclass(), "\n\n";
}
}
echo "</p>\n\n";
$textTag =& $class->tags('@text');
if ($textTag) {
echo '<div class="comment">', $this->_processInlineTags($textTag), "</div>\n\n";
}
$this->_processTags($class->tags());
$constants =& $class->constants();
ksort($constants);
$fields =& $class->fields();
ksort($fields);
//.........这里部分代码省略.........
示例13: todoWriter
/** Build the todo index.
*
* @param Doclet doclet
*/
function todoWriter(&$doclet)
{
parent::HTMLWriter($doclet);
$rootDoc =& $this->_doclet->rootDoc();
$this->_sections[0] = array('title' => 'Overview', 'url' => 'overview-summary.html');
$this->_sections[1] = array('title' => 'Package');
$this->_sections[2] = array('title' => 'Class');
//$this->_sections[3] = array('title' => 'Use');
$this->_sections[4] = array('title' => 'Tree', 'url' => 'overview-tree.html');
if ($doclet->includeSource()) {
$this->_sections[5] = array('title' => 'Files', 'url' => 'overview-files.html');
}
$this->_sections[6] = array('title' => 'Deprecated', 'url' => 'deprecated-list.html');
$this->_sections[7] = array('title' => 'Todo', 'selected' => TRUE);
$this->_sections[8] = array('title' => 'Index', 'url' => 'index-all.html');
$todoClasses = array();
$classes =& $rootDoc->classes();
$todoFields = array();
$todoMethods = array();
if ($classes) {
foreach ($classes as $class) {
if ($class->tags('@todo')) {
$todoClasses[] = $class;
}
$fields =& $class->fields();
if ($fields) {
foreach ($fields as $field) {
if ($field->tags('@todo')) {
$todoFields[] = $field;
}
}
}
$classes =& $class->methods();
if ($classes) {
foreach ($classes as $method) {
if ($method->tags('@todo')) {
$todoMethods[] = $method;
}
}
}
}
}
$todoGlobals = array();
$globals =& $rootDoc->globals();
if ($globals) {
foreach ($globals as $global) {
if ($global->tags('@todo')) {
$todoGlobals[] = $global;
}
}
}
$todoFunctions = array();
$functions =& $rootDoc->functions();
if ($functions) {
foreach ($functions as $function) {
if ($function->tags('@todo')) {
$todoFunctions[] = $function;
}
}
}
ob_start();
echo "<hr>\n\n";
echo '<h1>Todo</h1>';
echo "<hr>\n\n";
if ($todoClasses || $todoFields || $todoMethods || $todoGlobals || $todoFunctions) {
echo "<h2>Contents</h2>\n";
echo "<ul>\n";
if ($todoClasses) {
echo '<li><a href="#todo_class">Todo Classes</a></li>';
}
if ($todoFields) {
echo '<li><a href="#todo_field">Todo Fields</a></li>';
}
if ($todoMethods) {
echo '<li><a href="#todo_method">Todo Methods</a></li>';
}
if ($todoGlobals) {
echo '<li><a href="#todo_global">Todo Globals</a></li>';
}
if ($todoFunctions) {
echo '<li><a href="#todo_function">Todo Functions</a></li>';
}
echo "</ul>\n";
}
if ($todoClasses) {
echo '<table id="todo_class" class="detail">', "\n";
echo '<tr><th colspan="2" class="title">Todo Classes</th></tr>', "\n";
foreach ($todoClasses as $class) {
$textTag =& $class->tags('@text');
echo '<tr><td class="name"><a href="', $class->asPath(), '">', $class->qualifiedName(), '</a></td>';
echo '<td class="description">';
if ($textTag) {
echo strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>');
}
echo "</td></tr>\n";
}
//.........这里部分代码省略.........
示例14: classWriter
function classWriter(&$doclet)
{
parent::HTMLWriter($doclet);
$rootDoc =& $this->_doclet->rootDoc();
$phpdoctor =& $this->_doclet->phpdoctor();
$packages =& $rootDoc->packages();
ksort($packages);
foreach ($packages as $packageName => $package) {
$this->_depth = $package->depth() + 1;
$classes =& $package->allClasses();
if ($classes) {
ksort($classes);
foreach ($classes as $name => $class) {
$doc = new DomDocument();
$doc->preserveWhiteSpace = FALSE;
$doc->formatOutput = TRUE;
$dom_class = $doc->createElement('class');
if ($class->isInterface()) {
$dom_class->setAttribute('type', 'interface');
} else {
$dom_class->setAttribute('type', 'class');
}
$dom_class->setAttribute('name', $class->name());
$dom_class->setAttribute('handle', strtolower($class->name()));
$dom_package = $doc->createElement('package');
$dom_package->setAttribute('name', $class->packageName());
$dom_package->setAttribute('handle', $class->packageName());
$dom_class->appendChild($dom_package);
$dom_location = $doc->createElement('location', $class->sourceFilename());
$dom_location->setAttribute('line', $class->sourceLine());
$dom_class->appendChild($dom_location);
$implements =& $class->interfaces();
if (count($implements) > 0) {
$dom_interfaces = $doc->createElement('interfaces');
foreach ($implements as $interface) {
$dom_interface = $doc->createElement('interface', $interface->name());
$dom_interface->setAttribute('package', $interface->packageName());
$dom_interfaces->appendChild($dom_interface);
}
$dom_class->appendChild($dom_interfaces);
}
$dom_modifiers = $doc->createElement('modifiers');
foreach (explode(' ', trim($class->modifiers())) as $modifier) {
$dom_modifiers->appendChild($doc->createElement('modifier', $modifier));
}
$dom_class->appendChild($dom_modifiers);
if ($class->superclass()) {
$superclass =& $rootDoc->classNamed($class->superclass());
if ($superclass) {
$dom_superclass = $doc->createElement('superclass', $superclass->name());
} else {
$dom_superclass = $doc->createElement('superclass', $class->superclass());
}
$dom_class->appendChild($dom_superclass);
}
$textTag =& $class->tags('@text');
if ($textTag) {
$dom_description = $doc->createElement('description', $this->_processInlineTags($textTag));
$dom_class->appendChild($dom_description);
}
$this->_processTags($class->tags(), $doc, $dom_class);
$constants =& $class->constants();
ksort($constants);
$fields =& $class->fields();
ksort($fields);
$methods =& $class->methods();
ksort($methods);
if ($constants) {
$dom_constants = $doc->createElement('constants');
foreach ($constants as $field) {
$textTag =& $field->tags('@text');
$dom_constant = $doc->createElement('constant');
$dom_modifiers = $doc->createElement('modifiers');
foreach (explode(' ', trim($field->modifiers())) as $modifier) {
$dom_modifiers->appendChild($doc->createElement('modifier', $modifier));
}
$dom_constant->appendChild($dom_modifiers);
$type = $field->typeAsString();
$type = $this->__removeTextFromMarkup($type);
$dom_constant->setAttribute('name', (!$field->constantValue() ? "\$" : "") . $field->name());
$dom_constant->setAttribute('type', $type);
if ($field->value()) {
$dom_constant->setAttribute('value', htmlspecialchars($field->value()));
}
$dom_constant_location = $doc->createElement('location', $field->sourceFilename());
$dom_constant_location->setAttribute('line', $field->sourceLine());
$dom_constant->appendChild($dom_constant_location);
if ($textTag) {
$dom_constant_description = $doc->createElement('description', $this->_processInlineTags($textTag));
$dom_constant->appendChild($dom_constant_description);
}
$this->_processTags($field->tags(), $doc, $dom_constant);
$dom_constants->appendChild($dom_constant);
}
$dom_class->appendChild($dom_constants);
}
if ($fields) {
$dom_fields = $doc->createElement('fields');
foreach ($fields as $field) {
$textTag =& $field->tags('@text');
//.........这里部分代码省略.........
示例15: packageWriter
/** Build the package summaries.
*
* @param Doclet doclet
*/
function packageWriter(&$doclet)
{
parent::HTMLWriter($doclet);
$rootDoc =& $this->_doclet->rootDoc();
$phpdoctor =& $this->_doclet->phpdoctor();
$displayTree = $phpdoctor->getOption('tree');
if ($displayTree) {
$this->_sections[0] = array('title' => 'Overview', 'url' => 'overview-summary.html');
$this->_sections[1] = array('title' => 'Namespace');
$this->_sections[2] = array('title' => 'Class');
//$this->_sections[3] = array('title' => 'Use');
$this->_sections[4] = array('title' => 'Tree', 'selected' => TRUE);
if ($doclet->includeSource()) {
$this->_sections[5] = array('title' => 'Files', 'url' => 'overview-files.html');
}
$this->_sections[6] = array('title' => 'Deprecated', 'url' => 'deprecated-list.html');
$this->_sections[7] = array('title' => 'Todo', 'url' => 'todo-list.html');
$this->_sections[8] = array('title' => 'Index', 'url' => 'index-all.html');
$this->_id = 'tree';
$tree = array();
$classes =& $rootDoc->classes();
if ($classes) {
foreach ($classes as $class) {
$this->_buildTree($tree, $class);
}
}
ob_start();
echo "<hr>\n\n";
echo '<h1>Class Hierarchy</h1>';
$this->_displayTree($tree);
$this->_output = ob_get_contents();
ob_end_clean();
$this->_write('overview-tree.html', 'Overview', TRUE);
}
$this->_id = 'package';
$packages =& $rootDoc->packages();
ksort($packages);
foreach ($packages as $packageName => $package) {
$this->_depth = $package->depth() + 1;
$this->_sections[0] = array('title' => 'Overview', 'url' => 'overview-summary.html');
$this->_sections[1] = array('title' => 'Namespace', 'selected' => TRUE);
$this->_sections[2] = array('title' => 'Class');
//$this->_sections[3] = array('title' => 'Use');
if ($displayTree) {
$this->_sections[4] = array('title' => 'Tree', 'url' => $package->asPath() . '/package-tree.html');
}
if ($doclet->includeSource()) {
$this->_sections[5] = array('title' => 'Files', 'url' => 'overview-files.html');
}
$this->_sections[6] = array('title' => 'Deprecated', 'url' => 'deprecated-list.html');
$this->_sections[7] = array('title' => 'Todo', 'url' => 'todo-list.html');
$this->_sections[8] = array('title' => 'Index', 'url' => 'index-all.html');
ob_start();
echo "<hr>\n\n";
echo '<h1>Namespace ', $package->name(), "</h1>\n\n";
$textTag =& $package->tags('@text');
if ($textTag) {
echo '<div class="comment">', $this->_processInlineTags($textTag, TRUE), "</div>\n\n";
echo '<dl><dt>See:</dt><dd><b><a href="#overview_description">Description</a></b></dd></dl>', "\n\n";
}
$classes =& $package->ordinaryClasses();
if ($classes) {
ksort($classes);
echo '<table class="title">', "\n";
echo '<tr><th colspan="2" class="title">Class Summary</th></tr>', "\n";
foreach ($classes as $name => $class) {
$textTag =& $classes[$name]->tags('@text');
echo '<tr><td class="name"><a href="', str_repeat('../', $this->_depth), $classes[$name]->asPath(), '">', $classes[$name]->name(), '</a></td>';
echo '<td class="description">';
if ($textTag) {
echo strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>');
}
echo "</td></tr>\n";
}
echo "</table>\n\n";
}
$interfaces =& $package->interfaces();
if ($interfaces) {
ksort($interfaces);
echo '<table class="title">' . "\n";
echo '<tr><th colspan="2" class="title">Interface Summary</th></tr>' . "\n";
foreach ($interfaces as $name => $interface) {
$textTag =& $interfaces[$name]->tags('@text');
echo '<tr><td class="name"><a href="', str_repeat('../', $this->_depth), $interfaces[$name]->asPath(), '">', $interfaces[$name]->name(), '</a></td>';
echo '<td class="description">';
if ($textTag) {
echo strip_tags($this->_processInlineTags($textTag, TRUE), '<a><b><strong><u><em>');
}
echo "</td></tr>\n";
}
echo "</table>\n\n";
}
$exceptions =& $package->exceptions();
if ($exceptions) {
ksort($exceptions);
echo '<table class="title">' . "\n";
//.........这里部分代码省略.........