cvs: phd / build.php /formats xhtml.php /include PhDFormat.class.php PhDTheme.class.php /themes/php bightml.php phpdotnet.php phpweb.php

From: Date: Sun, 25 Nov 2007 20:29:30 +0000
Subject: cvs: phd / build.php /formats xhtml.php /include PhDFormat.class.php PhDTheme.class.php /themes/php bightml.php phpdotnet.php phpweb.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-445@lists.php.net to get a copy of this message
bjori Sun Nov 25 20:29:30 2007 UTC Added files: /phd/include PhDTheme.class.php Modified files: /phd build.php /phd/formats xhtml.php /phd/include PhDFormat.class.php /phd/themes/php bightml.php phpdotnet.php phpweb.php Log: Compress methodnames in classsynopsis (patch by Edward Z. Yang)

http://cvs.php.net/viewvc.cgi/phd/build.php?r1=1.37&r2=1.38&diff_format=u Index: phd/build.php diff -u phd/build.php:1.37 phd/build.php:1.38 --- phd/build.php:1.37 Mon Nov 5 19:49:04 2007 +++ phd/build.php Sun Nov 25 20:29:30 2007 @@ -1,6 +1,6 @@ #!@php_bin@ <?php -/* $Id: build.php,v 1.37 2007/11/05 19:49:04 bjori Exp $ */ +/* $Id: build.php,v 1.38 2007/11/25 20:29:30 bjori Exp $ */ function err($no, $str, $file, $line) { global $notify; @@ -41,6 +41,7 @@ require $ROOT. "/include/PhDPartialReader.class.php"; require $ROOT. "/include/PhDHelper.class.php"; require $ROOT. "/include/PhDFormat.class.php"; +require $ROOT. "/include/PhDTheme.class.php"; if ($OPTIONS["index"]) { if ($OPTIONS["verbose"] & VERBOSE_INDEXING) { @@ -98,6 +99,11 @@ default: $themes[$themename] = new $themename($IDs); } + + // WARNING: this needs to go away when we add support for + // things other than xhtml + $themes[$themename]->registerFormat($format); + // If the theme returns empty callback map there is no need to include it $tmp = $themes[$themename]->getElementMap(); http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.41&r2=1.42&diff_format=u Index: phd/formats/xhtml.php diff -u phd/formats/xhtml.php:1.41 phd/formats/xhtml.php:1.42 --- phd/formats/xhtml.php:1.41 Sat Nov 3 17:14:45 2007 +++ phd/formats/xhtml.php Sun Nov 25 20:29:30 2007 @@ -1,5 +1,5 @@ <?php -/* $Id: xhtml.php,v 1.41 2007/11/03 17:14:45 bjori Exp $ */ +/* $Id: xhtml.php,v 1.42 2007/11/25 20:29:30 bjori Exp $ */ class XHTMLPhDFormat extends PhDFormat { protected $elementmap = array( /* {{{ */ @@ -254,6 +254,20 @@ /* DEFAULT */ false, 'fieldsynopsis' => 'format_fieldsynopsis_modifier_text', ), + 'classname' => array( + /* DEFAULT */ false, + 'ooclass' => array( + /* DEFAULT */ false, + 'classsynopsis' => 'format_classsynopsis_ooclass_classname_text', + ), + ), + 'methodname' => array( + /* DEFAULT */ false, + 'methodsynopsis' => array( + /* DEFAULT */ false, + 'classsynopsis' => 'format_classsynopsis_methodsynopsis_methodname_text', + ), + ), ); @@ -389,6 +403,19 @@ } return "</div>"; } + + public function format_classsynopsis_ooclass_classname_text($value, $tag) { + $this->tmp["classsynopsis"]["classname"] = $value; + return $value; + } + + public function format_classsynopsis_methodsynopsis_methodname_text($value, $tag) { + if (!isset($this->tmp["classsynopsis"]["classname"])) return $value; + list($class, $method) = explode('::', $value); + if ($class !== $this->tmp["classsynopsis"]["classname"]) return $value; + return $method; + } + public function format_fieldsynopsis($open, $name, $attrs) { $this->tmp["fieldsynopsis"] = array(); if ($open) { http://cvs.php.net/viewvc.cgi/phd/include/PhDFormat.class.php?r1=1.7&r2=1.8&diff_format=u Index: phd/include/PhDFormat.class.php diff -u phd/include/PhDFormat.class.php:1.7 phd/include/PhDFormat.class.php:1.8 --- phd/include/PhDFormat.class.php:1.7 Tue Oct 2 14:37:42 2007 +++ phd/include/PhDFormat.class.php Sun Nov 25 20:29:30 2007 @@ -1,5 +1,5 @@ <?php -/* $Id: PhDFormat.class.php,v 1.7 2007/10/02 14:37:42 bjori Exp $ */ +/* $Id: PhDFormat.class.php,v 1.8 2007/11/25 20:29:30 bjori Exp $ */ abstract class PhDFormat extends PhDHelper { private $TABLE = array(); @@ -79,9 +79,6 @@ } -interface PhDTheme { - public function appendData($data, $isChunk); -} /* * vim600: sw=4 ts=4 fdm=syntax syntax=php et * vim<600: sw=4 ts=4 http://cvs.php.net/viewvc.cgi/phd/themes/php/bightml.php?r1=1.6&r2=1.7&diff_format=u Index: phd/themes/php/bightml.php diff -u phd/themes/php/bightml.php:1.6 phd/themes/php/bightml.php:1.7 --- phd/themes/php/bightml.php:1.6 Sun Nov 25 14:08:49 2007 +++ phd/themes/php/bightml.php Sun Nov 25 20:29:30 2007 @@ -1,8 +1,8 @@ <?php -/* $Id: bightml.php,v 1.6 2007/11/25 14:08:49 bjori Exp $ */ +/* $Id: bightml.php,v 1.7 2007/11/25 20:29:30 bjori Exp $ */ require_once $ROOT . '/themes/php/phpdotnet.php'; -class bightml extends phpdotnet implements PhDTheme { +class bightml extends phpdotnet { public function __construct(array $IDs, $filename, $ext = "html") { parent::__construct($IDs, $filename, $ext, false); $this->stream = fopen("bightml.html", "w"); http://cvs.php.net/viewvc.cgi/phd/themes/php/phpdotnet.php?r1=1.28&r2=1.29&diff_format=u Index: phd/themes/php/phpdotnet.php diff -u phd/themes/php/phpdotnet.php:1.28 phd/themes/php/phpdotnet.php:1.29 --- phd/themes/php/phpdotnet.php:1.28 Sat Nov 3 16:44:10 2007 +++ phd/themes/php/phpdotnet.php Sun Nov 25 20:29:30 2007 @@ -1,7 +1,7 @@ <?php -/* $Id: phpdotnet.php,v 1.28 2007/11/03 16:44:10 bjori Exp $ */ +/* $Id: phpdotnet.php,v 1.29 2007/11/25 20:29:30 bjori Exp $ */ -class phpdotnet extends PhDHelper { +abstract class phpdotnet extends PhDTheme { protected $elementmap = array( 'acronym' => 'format_suppressed_tags', 'function' => 'format_suppressed_tags', @@ -80,7 +80,13 @@ protected $textmap = array( 'acronym' => 'format_acronym_text', 'function' => 'format_function_text', - 'methodname' => 'format_function_text', + 'methodname' => array( + /* DEFAULT */ 'format_function_text', + 'methodsynopsis' => array( + /* DEFAULT */ 'format_function_text', + 'classsynopsis' => 'format_classsynopsis_methodsynopsis_methodname_text', + ), + ), 'type' => array( /* DEFAULT */ 'format_type_text', 'classsynopsisinfo' => false, @@ -353,14 +359,21 @@ /* ignore it */ return ""; } - public function format_function_text($value, $tag) { + + public function format_classsynopsis_methodsynopsis_methodname_text($value, $tag) { + $display_value = $this->format->format_classsynopsis_methodsynopsis_methodname_text($value, $tag); + return $this->format_function_text($value, $tag, $display_value); + } + + public function format_function_text($value, $tag, $display_value = null) { + if ($display_value === null) $display_value = $value; $link = strtolower(str_replace(array("__", "_", "::", "->"), array("", "-", "-", "-"), $value)); if ($this->CURRENT_FUNCTION === $link || !($filename = PhDHelper::getFilename("function.$link"))) { - return '<b>' .$value.($tag == "function" ? "()" : ""). '</b>'; + return '<b>' .$display_value.($tag == "function" ? "()" : ""). '</b>'; } - return '<a href="' .($this->chunked ? "" : "#").$filename. '.' .$this->ext. '" class="function">' .$value.($tag == "function" ? "()" : ""). '</a>'; + return '<a href="' .($this->chunked ? "" : "#").$filename. '.' .$this->ext. '" class="function">' .$display_value.($tag == "function" ? "()" : ""). '</a>'; } public function format_type_text($type, $tagname) { $t = strtolower($type); http://cvs.php.net/viewvc.cgi/phd/themes/php/phpweb.php?r1=1.18&r2=1.19&diff_format=u Index: phd/themes/php/phpweb.php diff -u phd/themes/php/phpweb.php:1.18 phd/themes/php/phpweb.php:1.19 --- phd/themes/php/phpweb.php:1.18 Mon Nov 5 19:49:04 2007 +++ phd/themes/php/phpweb.php Sun Nov 25 20:29:30 2007 @@ -1,8 +1,8 @@ <?php -/* $Id: phpweb.php,v 1.18 2007/11/05 19:49:04 bjori Exp $ */ +/* $Id: phpweb.php,v 1.19 2007/11/25 20:29:30 bjori Exp $ */ require_once $ROOT . '/themes/php/phpdotnet.php'; -class phpweb extends phpdotnet implements PhDTheme { +class phpweb extends phpdotnet { protected $streams = array(); protected $writeit = false; http://cvs.php.net/viewvc.cgi/phd/include/PhDTheme.class.php?view=markup&rev=1.1 Index: phd/include/PhDTheme.class.php +++ phd/include/PhDTheme.class.php <?php /* $Id: PhDTheme.class.php,v 1.1 2007/11/25 20:29:30 bjori Exp $ */ abstract class PhDTheme extends PhDHelper implements iPhDTheme { protected $format; public function registerFormat($format) { $this->format = $format; } } interface iPhDTheme { public function appendData($data, $isChunk); } /* * vim600: sw=4 ts=4 fdm=syntax syntax=php et * vim<600: sw=4 ts=4 */
« previous php.doc.cvs (#445) next »