cvs: phd(PHD_0_4) / TODO.RENDERER /formats manpage.php /include/langs cs.xml en.xml fr.xml it.xml ja.xml ro.xml ru.xml /schema phd.xsd
/tests/xhtml 003.phpt /themes/pear pearbightml.php pearweb.php /themes/php chmsource.php phpbigpdf.php phpdotnet.php phpfunctions.php
phpkdevelop.php phppdf.php

From: Date: Wed, 11 Feb 2009 05:07:46 +0000
Subject: cvs: phd(PHD_0_4) / TODO.RENDERER /formats manpage.php /include/langs cs.xml en.xml fr.xml it.xml ja.xml ro.xml ru.xml /schema phd.xsd
/tests/xhtml 003.phpt /themes/pear pearbightml.php pearweb.php /themes/php chmsource.php phpbigpdf.php phpdotnet.php phpfunctions.php
phpkdevelop.php phppdf.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-3188@lists.php.net to get a copy of this message
cweiske Wed Feb 11 05:07:46 2009 UTC Modified files: (Branch: PHD_0_4) /phd TODO.RENDERER /phd/formats manpage.php /phd/include/langs cs.xml en.xml fr.xml it.xml ja.xml ro.xml ru.xml /phd/schema phd.xsd /phd/tests/xhtml 003.phpt /phd/themes/pear pearbightml.php pearweb.php /phd/themes/php chmsource.php phpbigpdf.php phpdotnet.php phpfunctions.php phpkdevelop.php phppdf.php Log: WHITESPACE FRENZY!

http://cvs.php.net/viewvc.cgi/phd/TODO.RENDERER?r1=1.4.10.1&r2=1.4.10.2&diff_format=u Index: phd/TODO.RENDERER diff -u phd/TODO.RENDERER:1.4.10.1 phd/TODO.RENDERER:1.4.10.2 --- phd/TODO.RENDERER:1.4.10.1 Thu Dec 18 20:47:16 2008 +++ phd/TODO.RENDERER Wed Feb 11 05:07:45 2009 @@ -5,6 +5,7 @@ - Sort the methods like the elementmaps - Move all PHP/PHP.net specific stuff into themes/php/ - Implement generic theme + - Implement CHM format which should generate the CHM indexing files - Implement "mktoc.php" caching using SQLite - Write more tests - Implement method to generate markup for the default attributes http://cvs.php.net/viewvc.cgi/phd/formats/manpage.php?r1=1.1.2.3.2.2&r2=1.1.2.3.2.3&diff_format=u Index: phd/formats/manpage.php diff -u phd/formats/manpage.php:1.1.2.3.2.2 phd/formats/manpage.php:1.1.2.3.2.3 --- phd/formats/manpage.php:1.1.2.3.2.2 Wed Dec 24 13:06:42 2008 +++ phd/formats/manpage.php Wed Feb 11 05:07:45 2009 @@ -125,7 +125,7 @@ 'row' => 'format_row', 'entry' => 'format_entry', ); /* }}} */ - + protected $textmap = array( 'classname' => array( /* DEFAULT */ false, @@ -184,14 +184,14 @@ "segtitle" => array(), "segindex" => 0, ); - + /* If a chunk is being processed */ protected $chunkOpen = false; - + public function __construct(array $IDs) { parent::__construct($IDs); } - + public function __call($func, $args) { if ($args[0] && $this->chunkOpen) { trigger_error("No mapper found for '{$func}'", E_USER_WARNING); @@ -206,11 +206,11 @@ } return ($isMacro ? "" : "\\fP"); } - + public function CDATA($str) { return str_replace("\\", "\\\\", trim($str)); // Replace \ with \\ after trimming } - + public function TEXT($str) { $ret = trim(preg_replace( '/[ \n\t]+/', ' ', $str)); // No newline if current line begins with ',', ';', ':', '.' @@ -218,28 +218,28 @@ $ret = "\n" . $ret; return $ret; } - + public function getChunkInfo() { return $this->cchunk; } - + public function format_suppressed_tags($open, $name, $attrs) { /* Ignore it */ return ""; } - + public function format_suppressed_text($value, $tag) { /* Suppress any content */ return ""; } - + public function format_refsect_text($value, $tag) { if ($this->cchunk["appendlater"] && isset($this->cchunk["buffer"])) array_push($this->cchunk["buffer"], strtoupper('"'.$value.'"')); else return strtoupper('"'.$value.'"'); } - + public function format_refsect_title($open, $name, $attrs, $props) { if ($open) { if ($this->cchunk["appendlater"] && isset($this->cchunk["buffer"])) @@ -248,7 +248,7 @@ } return ""; } - + public function format_refpurpose($open, $name, $attrs, $props) { if ($open) { return " \- "; @@ -258,21 +258,21 @@ public function format_function_text($value, $tag) { return "\n\\fB" . $this->toValidName($value) . "\\fP(3)"; } - + public function format_parameter_text($value, $tag) { return "\n\\fI$" . $value . "\\fP"; } - + public function format_parameter_term_text($value, $tag) { return "\n\\fI$" . $value . "\\fP\n\-"; } - + public function format_term($open, $name, $attrs, $props) { if ($open) return ""; return "\n\-"; } - + public function format_simplelist($open, $name, $attrs, $props) { if (isset($this->cchunk["role"]) && $this->cchunk["role"] == "seealso") { if ($open) { @@ -288,7 +288,7 @@ return "\n.RE\n.PP\n"; } } - + public function format_member($open, $name, $attrs, $props) { if ($open) { if (isset($this->cchunk["role"]) && $this->cchunk["role"] == "seealso") { @@ -306,31 +306,31 @@ } return ""; } - + public function format_admonition($open, $name, $attrs, $props) { if ($open) { return "\n.PP\n\\fB" . $this->autogen($name, $props["lang"]) . "\\fR\n.RS"; } return "\n.RE\n.PP"; } - + public function format_example($open, $name, $attrs, $props) { if ($open && isset($this->cchunk["examplenumber"])) { return "\n.PP\n\\fB" . $this->autogen($name, $props["lang"]) . ++$this->cchunk["examplenumber"] . "\\fR\n.RS"; } return "\n.RE"; } - + public function format_itemizedlist($open, $name, $attrs, $props) { if ($open) { return "\n.PP\n.RS"; } return "\n.RE\n.PP"; } - + public function format_methodparam($open, $name, $attrs, $props) { if ($open) { - $opt = isset($attrs[PhDReader::XMLNS_DOCBOOK]["choice"]) && + $opt = isset($attrs[PhDReader::XMLNS_DOCBOOK]["choice"]) && $attrs[PhDReader::XMLNS_DOCBOOK]["choice"] == "opt"; $this->cchunk["methodsynopsis"]["params"][] = array( "optional" => $opt, @@ -340,7 +340,7 @@ } return ""; } - + public function format_void($open, $name, $attrs, $props) { if ($open) { $this->cchunk["methodsynopsis"]["params"][] = array( @@ -351,24 +351,24 @@ } return ""; } - + public function format_type_method_text($value, $tag) { $this->cchunk['methodsynopsis']['params'][count($this->cchunk['methodsynopsis']['params'])-1]['type'] = $value; return ""; } - + public function format_parameter_method_text($value, $tag) { $this->cchunk['methodsynopsis']['params'][count($this->cchunk['methodsynopsis']['params'])-1]['name'] = $value; return ""; } - + public function format_initializer_method_text($value, $tag) { $this->cchunk['methodsynopsis']['params'][count($this->cchunk['methodsynopsis']['params'])-1]['initializer'] = $value; return ""; } - + public function format_refsynopsisdiv($open, $name, $attrs, $props) { - if ($open && isset($this->cchunk["methodsynopsis"]["firstsynopsis"]) + if ($open && isset($this->cchunk["methodsynopsis"]["firstsynopsis"]) && $this->cchunk["methodsynopsis"]["firstsynopsis"]) { return "\n.SH SYNOPSIS\n"; } @@ -376,9 +376,9 @@ $this->cchunk["methodsynopsis"]["firstsynopsis"] = false; return ""; } - + public function format_methodsynopsis($open, $name, $attrs, $props) { - if ($open && isset($this->cchunk["methodsynopsis"]["firstsynopsis"]) + if ($open && isset($this->cchunk["methodsynopsis"]["firstsynopsis"]) && $this->cchunk["methodsynopsis"]["firstsynopsis"] && $this->cchunk["appendlater"]) { $this->cchunk["appendlater"] = false; return "\n.SH SYNOPSIS\n"; @@ -388,11 +388,11 @@ $params = array(); // write the formatted synopsis foreach ($this->cchunk['methodsynopsis']['params'] as $parameter) - array_push( $params, ($parameter['optional'] ? "[" : "") . $parameter['type'] . + array_push( $params, ($parameter['optional'] ? "[" : "") . $parameter['type'] . ($parameter['name'] ? " \\fI$" . $parameter['name'] . "\\fP" : "") . ($parameter['initializer'] ? " = " . $parameter['initializer'] : "") . ($parameter['optional'] ? "]" : "") ); $ret = "\n(" . join($params, ", ") . ")"; $this->cchunk['methodsynopsis']['params'] = array(); - + // finally write what is in the buffer if (isset($this->cchunk["buffer"])) { $ret .= implode("", $this->cchunk["buffer"]); @@ -402,33 +402,33 @@ $this->cchunk["methodsynopsis"]["firstsynopsis"] = false; return $ret; } - + public function newChunk() { $this->cchunk = $this->dchunk; $this->chunkOpen = true; } - + public function closeChunk() { $this->chunkOpen = false; } - + public function format_xref($open, $name, $attrs, $props) { if ($props['empty']) return "\n\"" . PhDHelper::getDescription($attrs[PhDReader::XMLNS_DOCBOOK]["linkend"]) . "\""; return ""; } - + public function format_verbatim($open, $name, $attrs, $props) { if ($open) { return "\n.PP\n.nf"; } return "\n.fi"; } - + public function format_verbatim_text($value, $tag) { return "\n" . trim($value) . "\n"; } - + public function format_refsect($open, $name, $attrs, $props) { if ($open && isset($attrs[PhDReader::XMLNS_DOCBOOK]["role"])) { $this->cchunk["role"] = $attrs[PhDReader::XMLNS_DOCBOOK]["role"]; @@ -438,14 +438,14 @@ } if (!$open) $this->cchunk["role"] = null; - return ""; + return ""; } - - // Returns the unformatted value without whitespaces (nor new lines) + + // Returns the unformatted value without whitespaces (nor new lines) public function format_text($value, $tag) { return trim(preg_replace('/[ \n\t]+/', ' ', $value)); } - + public function format_tgroup($open, $name, $attrs, $props) { if ($open) { $nbCols = $attrs[PhDReader::XMLNS_DOCBOOK]["cols"]; @@ -457,14 +457,14 @@ } return "\n.TE\n.PP"; } - + public function format_thead($open, $name, $attrs, $props) { if ($open) { return ""; } return "\n="; } - + public function format_row($open, $name, $attrs, $props) { if ($open) { $this->cchunk["firstitem"] = true; @@ -472,7 +472,7 @@ } return ""; } - + public function format_entry($open, $name, $attrs, $props) { if ($open) { if ($this->cchunk["firstitem"]) { @@ -483,7 +483,7 @@ } return "\nT}"; } - + public function format_segmentedlist($open, $name, $attrs, $props) { if ($open) { return "\n.P"; @@ -491,13 +491,13 @@ $this->cchunk["segtitle"] = array(); return "\n"; } - + public function format_seglistitem($open, $name, $attrs, $props) { if ($open && isset($this->cchunk["segindex"])) $this->cchunk["segindex"] = 0; return ""; } - + public function format_seg($open, $name, $attrs, $props) { if (! (isset($this->cchunk["segtitle"]) && isset($this->cchunk["segtitle"][$this->cchunk["segindex"]])) ) return ""; @@ -507,35 +507,35 @@ $this->cchunk["segindex"]++; return ""; } - + public function format_segtitle_text($value, $tag) { if (isset($this->cchunk["segtitle"])) $this->cchunk["segtitle"][] = $value; return ""; } - + public function format_manvolnum($open, $name, $attrs, $props) { if ($open) { return "("; } return ")"; } - + public function format_ooclass_name_text($value, $tag) { return "\n.br\n\\fI" . $value . "\\fP"; } - + public function format_indent($open, $name, $attrs, $props) { if ($open) { return "\n.PP\n.RS"; } return "\n.RE\n.PP"; } - + public function format_tag_text($value, $tag) { return "\n<" . $value . ">"; } - + // Convert the function name to a Unix valid filename public function toValidName($functionName) { return str_replace(array("::", "->", "()"), array(".", ".", ""), $functionName); http://cvs.php.net/viewvc.cgi/phd/include/langs/cs.xml?r1=1.4&r2=1.4.8.1&diff_format=u Index: phd/include/langs/cs.xml diff -u phd/include/langs/cs.xml:1.4 phd/include/langs/cs.xml:1.4.8.1 --- phd/include/langs/cs.xml:1.4 Sat Mar 22 15:40:40 2008 +++ phd/include/langs/cs.xml Wed Feb 11 05:07:45 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.4.8.1 $ --> <section xml:id="autogen" xml:lang="cs"> <title>Autogenerated text</title> <variablelist> @@ -53,4 +53,4 @@ </varlistentry> </variablelist> </section> - + http://cvs.php.net/viewvc.cgi/phd/include/langs/en.xml?r1=1.4.4.1&r2=1.4.4.2&diff_format=u Index: phd/include/langs/en.xml diff -u phd/include/langs/en.xml:1.4.4.1 phd/include/langs/en.xml:1.4.4.2 --- phd/include/langs/en.xml:1.4.4.1 Sun Oct 19 14:08:20 2008 +++ phd/include/langs/en.xml Wed Feb 11 05:07:45 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<!-- $Revision: 1.4.4.1 $ --> +<!-- $Revision: 1.4.4.2 $ --> <section xml:id="autogen" xml:lang="en"> <title>Autogenerated text</title> <variablelist> @@ -59,4 +59,4 @@ </varlistentry> </variablelist> </section> - + http://cvs.php.net/viewvc.cgi/phd/include/langs/fr.xml?r1=1.1&r2=1.1.10.1&diff_format=u Index: phd/include/langs/fr.xml diff -u phd/include/langs/fr.xml:1.1 phd/include/langs/fr.xml:1.1.10.1 --- phd/include/langs/fr.xml:1.1 Fri Apr 4 20:53:29 2008 +++ phd/include/langs/fr.xml Wed Feb 11 05:07:45 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.1.10.1 $ --> <!-- EN-Revision: 1.4 Maintainer: yannick Status: ready --> <section xml:id="autogen" xml:lang="en"> @@ -55,4 +55,4 @@ </varlistentry> </variablelist> </section> - + http://cvs.php.net/viewvc.cgi/phd/include/langs/it.xml?r1=1.4&r2=1.4.8.1&diff_format=u Index: phd/include/langs/it.xml diff -u phd/include/langs/it.xml:1.4 phd/include/langs/it.xml:1.4.8.1 --- phd/include/langs/it.xml:1.4 Sat Mar 22 15:40:40 2008 +++ phd/include/langs/it.xml Wed Feb 11 05:07:45 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.4.8.1 $ --> <section xml:id="autogen" xml:lang="it"> <title>Autogenerated text</title> <variablelist> @@ -53,4 +53,4 @@ </varlistentry> </variablelist> </section> - + http://cvs.php.net/viewvc.cgi/phd/include/langs/ja.xml?r1=1.6&r2=1.6.8.1&diff_format=u Index: phd/include/langs/ja.xml diff -u phd/include/langs/ja.xml:1.6 phd/include/langs/ja.xml:1.6.8.1 --- phd/include/langs/ja.xml:1.6 Wed Mar 26 00:37:36 2008 +++ phd/include/langs/ja.xml Wed Feb 11 05:07:45 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.6.8.1 $ --> <section xml:id="autogen" xml:lang="ja"> <title>Autogenerated text</title> <variablelist> @@ -53,4 +53,4 @@ </varlistentry> </variablelist> </section> - + http://cvs.php.net/viewvc.cgi/phd/include/langs/ro.xml?r1=1.4&r2=1.4.8.1&diff_format=u Index: phd/include/langs/ro.xml diff -u phd/include/langs/ro.xml:1.4 phd/include/langs/ro.xml:1.4.8.1 --- phd/include/langs/ro.xml:1.4 Sat Mar 22 15:40:40 2008 +++ phd/include/langs/ro.xml Wed Feb 11 05:07:45 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.4.8.1 $ --> <section xml:id="autogen" xml:lang="ro"> <title>Autogenerated text</title> <variablelist> @@ -53,4 +53,4 @@ </varlistentry> </variablelist> </section> - + http://cvs.php.net/viewvc.cgi/phd/include/langs/ru.xml?r1=1.3&r2=1.3.10.1&diff_format=u Index: phd/include/langs/ru.xml diff -u phd/include/langs/ru.xml:1.3 phd/include/langs/ru.xml:1.3.10.1 --- phd/include/langs/ru.xml:1.3 Wed Mar 12 16:11:01 2008 +++ phd/include/langs/ru.xml Wed Feb 11 05:07:45 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.3.10.1 $ --> <section xml:id="autogen" xml:lang="ru"> <title>Сгенерированный текст</title> <variablelist> @@ -53,4 +53,4 @@ </varlistentry> </variablelist> </section> - + http://cvs.php.net/viewvc.cgi/phd/schema/phd.xsd?r1=1.2&r2=1.2.12.1&diff_format=u Index: phd/schema/phd.xsd diff -u phd/schema/phd.xsd:1.2 phd/schema/phd.xsd:1.2.12.1 --- phd/schema/phd.xsd:1.2 Wed Jul 25 21:59:54 2007 +++ phd/schema/phd.xsd Wed Feb 11 05:07:46 2009 @@ -27,7 +27,7 @@ the world-wide-web at: &lt;http://phd.php.net/LICENSE&gt; </xsd:documentation> - <xsd:appinfo>$Id: phd.xsd,v 1.2 2007/07/25 21:59:54 gwynne Exp $</xsd:appinfo> + <xsd:appinfo>$Id: phd.xsd,v 1.2.12.1 2009/02/11 05:07:46 cweiske Exp $</xsd:appinfo> </xsd:annotation> <xsd:include schemaLocation="docbook.xsd"/> @@ -53,7 +53,7 @@ <xsd:element name="constant" id="constant" type="constantType"/> <xsd:element name="c" id="c" type="constantType"/> - + <!-- This pattern tries to be lax about accepting both simple revision numbers and CVS/SVN-generated revision keywords. A Perl backwards-assertion would @@ -64,10 +64,10 @@ <xsd:pattern value="(\$Rev(ision)?:\s*)?(\d+\.)+\d+\s*\$?"/> </xsd:restriction> </xsd:simpleType> - + <xsd:element name="my-rev" id="my-rev" type="revisionNumber"/> <xsd:element name="en-rev" id="en-rev" type="revisionNumber"/> - + <xsd:element name="revision" id="revision"> <xsd:complexType> <xsd:sequence> @@ -76,7 +76,7 @@ </xsd:sequence> </xsd:complexType> </xsd:element> - + <xsd:element name="meta" id="meta"> <xsd:complexType> <xsd:simpleContent> @@ -86,5 +86,5 @@ </xsd:simpleContent> </xsd:complexType> </xsd:element> - + </xsd:schema> http://cvs.php.net/viewvc.cgi/phd/tests/xhtml/003.phpt?r1=1.1&r2=1.1.10.1&diff_format=u Index: phd/tests/xhtml/003.phpt diff -u phd/tests/xhtml/003.phpt:1.1 phd/tests/xhtml/003.phpt:1.1.10.1 --- phd/tests/xhtml/003.phpt:1.1 Sun Aug 5 22:57:14 2007 +++ phd/tests/xhtml/003.phpt Wed Feb 11 05:07:46 2009 @@ -2,7 +2,7 @@ CALS Table rendering#003 --FILE-- <?php -/* $Id: 003.phpt,v 1.1 2007/08/05 22:57:14 bjori Exp $ */ +/* $Id: 003.phpt,v 1.1.10.1 2009/02/11 05:07:46 cweiske Exp $ */ require "include/PhDReader.class.php"; require "include/PhDFormat.class.php"; @@ -152,7 +152,7 @@ D_T_FMT </td> <td colspan="1" rowspan="1" align="left"> -String that can be used as the format string for +String that can be used as the format string for <a href="function.strftime.html">strftime</a> to represent time and date. </td> @@ -163,7 +163,7 @@ D_FMT </td> <td colspan="1" rowspan="1" align="left"> -String that can be used as the format string for +String that can be used as the format string for <a href="function.strftime.html">strftime</a> to represent date. </td> @@ -174,7 +174,7 @@ T_FMT </td> <td colspan="1" rowspan="1" align="left"> -String that can be used as the format string for +String that can be used as the format string for <a href="function.strftime.html">strftime</a> to represent time. </td> @@ -185,7 +185,7 @@ T_FMT_AMPM </td> <td colspan="1" rowspan="1" align="left"> -String that can be used as the format string for +String that can be used as the format string for <a href="function.strftime.html">strftime</a> to represent time in 12-hour format with ante/post meridian. </td> @@ -214,7 +214,7 @@ ERA_D_T_FMT </td> <td colspan="1" rowspan="1" align="left"> -Date and time in alternate era format (string can be used in +Date and time in alternate era format (string can be used in <a href="function.strftime.html">strftime</a> ). </td> @@ -225,7 +225,7 @@ ERA_D_FMT </td> <td colspan="1" rowspan="1" align="left"> -Date in alternate era format (string can be used in +Date in alternate era format (string can be used in <a href="function.strftime.html">strftime</a> ). </td> @@ -236,7 +236,7 @@ ERA_T_FMT </td> <td colspan="1" rowspan="1" align="left"> -Time in alternate era format (string can be used in +Time in alternate era format (string can be used in <a href="function.strftime.html">strftime</a> ). </td> @@ -386,35 +386,35 @@ <p class="simpara"> Returns 0 if parentheses surround the quantity and currency_symbol. - + </p> </li> <li class="listitem"> <p class="simpara"> Returns 1 if the sign string precedes the quantity and currency_symbol. - + </p> </li> <li class="listitem"> <p class="simpara"> Returns 2 if the sign string follows the quantity and currency_symbol. - + </p> </li> <li class="listitem"> <p class="simpara"> Returns 3 if the sign string immediately precedes the currency_symbol. - + </p> </li> <li class="listitem"> <p class="simpara"> Returns 4 if the sign string immediately follows the currency_symbol. - + </p> </li> </ul> http://cvs.php.net/viewvc.cgi/phd/themes/pear/pearbightml.php?r1=1.1.6.2&r2=1.1.6.2.2.1&diff_format=u Index: phd/themes/pear/pearbightml.php diff -u phd/themes/pear/pearbightml.php:1.1.6.2 phd/themes/pear/pearbightml.php:1.1.6.2.2.1 --- phd/themes/pear/pearbightml.php:1.1.6.2 Thu Oct 16 15:43:46 2008 +++ phd/themes/pear/pearbightml.php Wed Feb 11 05:07:46 2009 @@ -33,7 +33,7 @@ public function footer() { fwrite($this->stream, "</div></div></body></html>"); } - + public function format_qandaset($open, $name, $attrs) { if ($open) { $this->cchunk["qandaentry"] = array(); http://cvs.php.net/viewvc.cgi/phd/themes/pear/pearweb.php?r1=1.1.6.2.2.4&r2=1.1.6.2.2.5&diff_format=u Index: phd/themes/pear/pearweb.php diff -u phd/themes/pear/pearweb.php:1.1.6.2.2.4 phd/themes/pear/pearweb.php:1.1.6.2.2.5 --- phd/themes/pear/pearweb.php:1.1.6.2.2.4 Tue Feb 10 22:32:29 2009 +++ phd/themes/pear/pearweb.php Wed Feb 11 05:07:46 2009 @@ -5,12 +5,12 @@ * PEAR theme for the many php files used for pearweb * * @package PhD -* @version CVS: $Id: pearweb.php,v 1.1.6.2.2.4 2009/02/10 22:32:29 cweiske Exp $ +* @version CVS: $Id: pearweb.php,v 1.1.6.2.2.5 2009/02/11 05:07:46 cweiske Exp $ */ class pearweb extends peartheme { protected $streams = array(); - + protected $writeit = false; public $outputdir = ''; @@ -44,13 +44,13 @@ } } } - + /** * Write an individual chunk of the manual * * @param string $id ID of the chunk * @param resource $stream Stream containing the contents of the chunk - * + * * @return void */ public function writeChunk($id, $stream) @@ -80,13 +80,13 @@ v("Wrote %s", $this->outputdir . $filename, VERBOSE_CHUNK_WRITING); } - + /** * Append data to the streams. * * @param string $data Data to write * @param PhDReader::CLOSE_CHUNK|PhDReader::OPEN_CHUNK $isChunk constant - * + * * @return int|false */ public function appendData($data, $isChunk) @@ -113,18 +113,18 @@ return $retval; } } - + /** * Add the header to this file. * * @param string $id The id of this chunk - * + * * @return string */ public function header($id) { $ext = "." . $this->ext; - + $parent = PhDHelper::getParent($id); if (!$parent || $parent == "ROOT") @@ -165,9 +165,9 @@ /** * Create the footer for the given page id and return it. - * + * * In this instance, we return raw php with the pearweb manual footer call. - * + * * @param string $id Page ID * * @return string Footer code @@ -186,7 +186,7 @@ * @param string $id ID of the page * @param string $parent ID of the parent element * @param array $siblings array of siblings - * + * * @return array(0=>filename,1=>description) */ protected function createPrev($id, $parent, $siblings) @@ -220,14 +220,14 @@ return array(PhDHelper::getFilename($parent).$ext, PhDHelper::getDescription($parent, false)); } - + /** * Create the next page link information * * @param string $id ID of the page * @param string $parent ID of the parent element * @param array $siblings array of siblings - * + * * @return array(0=>filename,1=>description) */ protected function createNext($id, $parent, $siblings) @@ -277,7 +277,7 @@ } while (true); return $next; } - + /** * Destructor - if guide.php exists, this must be the index file copy it over. */ @@ -294,7 +294,7 @@ * @param bool $open if a chunk is open we should append to * @param unknown_type $name The name * @param unknown_type $attrs attributes - * + * * @return string */ public function format_qandaset($open, $name, $attrs) http://cvs.php.net/viewvc.cgi/phd/themes/php/chmsource.php?r1=1.4.2.5.2.9&r2=1.4.2.5.2.10&diff_format=u Index: phd/themes/php/chmsource.php diff -u phd/themes/php/chmsource.php:1.4.2.5.2.9 phd/themes/php/chmsource.php:1.4.2.5.2.10 --- phd/themes/php/chmsource.php:1.4.2.5.2.9 Thu Jan 8 10:59:22 2009 +++ phd/themes/php/chmsource.php Wed Feb 11 05:07:46 2009 @@ -1,11 +1,11 @@ <?php -/* $Id: chmsource.php,v 1.4.2.5.2.9 2009/01/08 10:59:22 rquadling Exp $ */ +/* $Id: chmsource.php,v 1.4.2.5.2.10 2009/02/11 05:07:46 cweiske Exp $ */ require_once $ROOT . '/themes/php/chunkedhtml.php'; class chmsource extends chunkedhtml { const DEFAULT_FONT = "Arial,10,0"; const DEFAULT_TITLE = "PHP Manual"; - + // Array to manual code -> HTML Help Code conversion // Code list: http://www.helpware.net/htmlhelp/hh_info.htm // Charset list: http://www.microsoft.com/globaldev/nlsweb/default.asp @@ -176,7 +176,7 @@ "preferred_font" => "simsun,10,0" ) ); - + // HTML Help Workshop project file protected $hhpStream; // CHM Table of contents @@ -188,7 +188,7 @@ protected $hhkStream; // Project files Output directory protected $chmdir; - + public function __construct(array $IDs, $filename, $ext = "html", $dir = "chm") { chunkedhtml::__construct($IDs, $filename, $ext); $this->chmdir = $GLOBALS['OPTIONS']['output_dir'] . $dir . DIRECTORY_SEPARATOR; @@ -207,17 +207,17 @@ self::headerChm(); } - + public function __destruct() { self::footerChm(); - + fclose($this->hhpStream); fclose($this->hhcStream); fclose($this->hhkStream); - + chunkedhtml::__destruct(); } - + protected function appendChm($name, $ref, $isChunk, $hasChild) { switch ($isChunk) { case PhDReader::OPEN_CHUNK : @@ -241,7 +241,7 @@ break; } } - + protected function headerChm() { $lang = $GLOBALS['OPTIONS']['language']; fwrite($this->hhpStream, '[OPTIONS] @@ -331,14 +331,14 @@ " </object>\n </li>\n"); return false; } - + public function header($id) { $header = parent::header($id); // Add CSS link to <head> $pattern = '/(.*)(\r|\n|\r\n|\n\r)(.*)<\/head>/'; $replacement = '$1 <link media="all" rel="stylesheet" type="text/css" href="style.css"/>$2$3</head>'; - - $header = preg_replace($pattern, $replacement, $header); + + $header = preg_replace($pattern, $replacement, $header); return $header; } @@ -371,5 +371,5 @@ $spaces .= " "; return $spaces; } - + } http://cvs.php.net/viewvc.cgi/phd/themes/php/phpbigpdf.php?r1=1.2.4.2&r2=1.2.4.2.2.1&diff_format=u Index: phd/themes/php/phpbigpdf.php diff -u phd/themes/php/phpbigpdf.php:1.2.4.2 phd/themes/php/phpbigpdf.php:1.2.4.2.2.1 --- phd/themes/php/phpbigpdf.php:1.2.4.2 Fri Aug 1 11:17:06 2008 +++ phd/themes/php/phpbigpdf.php Wed Feb 11 05:07:46 2009 @@ -1,15 +1,15 @@ <?php require_once $ROOT . '/themes/php/phppdf.php'; class phpbigpdf extends phppdf { - + public function __construct(array $IDs, array $filenames, $format = "pdf", $chunked = true) { parent::__construct($IDs, $filenames, $format, $chunked); $this->outputdir = $GLOBALS['OPTIONS']['output_dir']; } - + // Do nothing public function appendData($data, $isChunk) {} - + public function format_root_set($open, $name, $attrs, $props) { if ($open) { $this->format->newChunk(); @@ -17,15 +17,15 @@ $pdfDoc = new PdfWriter(); try { $pdfDoc->setCompressionMode(HaruDoc::COMP_ALL); - } catch (HaruException $e) { + } catch (HaruException $e) { v("PDF Compression failed, you need to compile libharu with Zlib...", E_USER_WARNING); } $this->format->setPdfDoc($pdfDoc); - + if (isset($attrs[PhDReader::XMLNS_XML]["base"]) && $base = $attrs[PhDReader::XMLNS_XML]["base"]) $this->format->setChunkInfo("xml-base", $base); $id = $attrs[PhDReader::XMLNS_XML]["id"]; - $this->cchunk["root-outline"] = $this->cchunk["id-to-outline"][$id] = + $this->cchunk["root-outline"] = $this->cchunk["id-to-outline"][$id] = $pdfDoc->createOutline(PhDHelper::getDescription($id), null, true); $this->setIdToPage($id); } else { @@ -37,11 +37,11 @@ } return ""; } - + public function format_set($open, $name, $attrs, $props) { return $this->format_tocnode_newpage($open, $name, $attrs, $props); } - + public function format_book($open, $name, $attrs, $props) { return $this->format_tocnode_newpage($open, $name, $attrs, $props); } http://cvs.php.net/viewvc.cgi/phd/themes/php/phpdotnet.php?r1=1.53.2.4.2.10&r2=1.53.2.4.2.11&diff_format=u Index: phd/themes/php/phpdotnet.php diff -u phd/themes/php/phpdotnet.php:1.53.2.4.2.10 phd/themes/php/phpdotnet.php:1.53.2.4.2.11 --- phd/themes/php/phpdotnet.php:1.53.2.4.2.10 Thu Jan 29 15:49:47 2009 +++ phd/themes/php/phpdotnet.php Wed Feb 11 05:07:46 2009 @@ -1,5 +1,5 @@ <?php -/* $Id: phpdotnet.php,v 1.53.2.4.2.10 2009/01/29 15:49:47 cweiske Exp $ */ +/* $Id: phpdotnet.php,v 1.53.2.4.2.11 2009/02/11 05:07:46 cweiske Exp $ */ abstract class phpdotnet extends PhDTheme { protected $elementmap = array( @@ -311,7 +311,7 @@ } $href = '<a href="' .$href. '">'; } - + if ( $this->cchunk["fieldsynopsis"]["modifier"] == "const" || ( @@ -465,7 +465,7 @@ } } $content .= "</div>\n"; - + return $content; } public function format_exception_chunk($open, $name, $attrs, $props) { @@ -529,17 +529,17 @@ /* ignore it */ return ""; } - + 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; } - + $ref = strtolower(str_replace(array("_", "::", "->"), array("-", "-", "-"), $value)); if (($filename = $this->getRefnameLink($ref)) !== null) { if ($this->CURRENT_ID !== $filename) { http://cvs.php.net/viewvc.cgi/phd/themes/php/phpfunctions.php?r1=1.1.2.4.2.1&r2=1.1.2.4.2.2&diff_format=u Index: phd/themes/php/phpfunctions.php diff -u phd/themes/php/phpfunctions.php:1.1.2.4.2.1 phd/themes/php/phpfunctions.php:1.1.2.4.2.2 --- phd/themes/php/phpfunctions.php:1.1.2.4.2.1 Sun Oct 19 13:48:16 2008 +++ phd/themes/php/phpfunctions.php Wed Feb 11 05:07:46 2009 @@ -4,7 +4,7 @@ const OPEN_CHUNK = 0x01; const CLOSE_CHUNK = 0x02; const OPENED_CHUNK = 0x03; - + protected $elementmap = array( 'set' => 'format_set', 'refentry' => 'format_refentry', @@ -22,12 +22,12 @@ ), ), ); - + public $role = false; protected $chunked = true; - + protected $CURRENT_ID = ""; - + /* Current Chunk settings */ protected $cchunk = array(); /* Default Chunk settings */ @@ -35,32 +35,32 @@ "funcname" => array(), "firstrefname" => true, ); - + protected $isChunk = false; - + /* Common properties for all functions pages */ protected $bookName = ""; protected $date = ""; protected $outputdir = ""; protected $isFunctionRefSet = false; - + public function __construct(array $IDs, array $filenames, $format = "man3", $chunked = true) { parent::__construct($IDs); $this->format = $format; $this->outputdir = $GLOBALS['OPTIONS']['output_dir'] . $this->format . DIRECTORY_SEPARATOR; if(!file_exists($this->outputdir) || is_file($this->outputdir)) mkdir($this->outputdir) or die("Can't create the cache directory"); } - + public function header($index) { return ".TH " . strtoupper($this->cchunk["funcname"][$index]) . " 3 \"" . $this->date . "\" \"PHP Documentation Group\" \"" . $this->bookName . "\""; } - + public function writeChunk($stream) { if (!isset($this->cchunk["funcname"][0])) return; $index = 0; rewind($stream); - + $filename = $this->cchunk["funcname"][$index] . '.3.gz'; $gzfile = gzopen($this->outputdir . $filename, "w9"); @@ -73,9 +73,9 @@ $filename = $this->cchunk["funcname"][$index] . '.3.gz'; rewind($stream); // Replace the default function name by the alternative one - $content = preg_replace('/'.$this->cchunk["funcname"][0].'/', - $this->cchunk["funcname"][$index], stream_get_contents($stream), 1); - + $content = preg_replace('/'.$this->cchunk["funcname"][0].'/', + $this->cchunk["funcname"][$index], stream_get_contents($stream), 1); + $gzfile = gzopen($this->outputdir . $filename, "w9"); gzwrite($gzfile, $this->header($index)); @@ -85,7 +85,7 @@ v("Wrote %s", $this->outputdir . $filename, VERBOSE_CHUNK_WRITING); } } - + public function appendData($data, $isChunk) { if (!$this->isFunctionRefSet) return 0; @@ -104,7 +104,7 @@ case self::OPEN_CHUNK: $this->streams[] = fopen("php://temp/maxmemory", "r+"); $this->isChunk = self::OPENED_CHUNK; - + case self::OPENED_CHUNK: $stream = end($this->streams); // Remove whitespace nodes @@ -114,24 +114,24 @@ return 0; } } - + public function format_bookname($value, $tag) { $this->bookName = $value; return false; } - + public function format_pubdate($value, $tag) { $this->date = $value; return false; } - + public function format_set($open, $name, $attrs, $props) { if (isset($attrs[PhDReader::XMLNS_XML]["id"]) && $attrs[PhDReader::XMLNS_XML]["id"] == "funcref") { $this->isFunctionRefSet = $open; } return false; } - + public function format_refentry($open, $name, $attrs, $props) { if (!$this->isFunctionRefSet) return false; @@ -145,7 +145,7 @@ } return false; } - + public function format_refname($open, $name, $attrs, $props) { if ($open) { return (isset($this->cchunk["firstrefname"]) && $this->cchunk["firstrefname"]) ? false : ""; @@ -157,7 +157,7 @@ return ""; } } - + public function format_refname_text($value, $tag) { $this->cchunk["funcname"][] = $this->format->toValidName(trim($value)); if (isset($this->cchunk["firstrefname"]) && $this->cchunk["firstrefname"]) { @@ -165,7 +165,7 @@ } return ""; } - - + + } http://cvs.php.net/viewvc.cgi/phd/themes/php/phpkdevelop.php?r1=1.2.2.2&r2=1.2.2.2.2.1&diff_format=u Index: phd/themes/php/phpkdevelop.php diff -u phd/themes/php/phpkdevelop.php:1.2.2.2 phd/themes/php/phpkdevelop.php:1.2.2.2.2.1 --- phd/themes/php/phpkdevelop.php:1.2.2.2 Thu Jul 24 10:21:06 2008 +++ phd/themes/php/phpkdevelop.php Wed Feb 11 05:07:46 2009 @@ -4,7 +4,7 @@ class phpkdevelop extends PhDTheme { const DEFAULT_TITLE = "PHP Manual"; const DEFAULT_HREF = "http://www.php.net/manual/en/"; - + protected $elementmap = array( 'book' => 'format_tocsect1', 'bibliography' => array( @@ -51,67 +51,67 @@ 'refname' => 'format_suppressed_tags', 'refpurpose' => 'format_suppressed_tags', 'refsection' => 'format_suppressed_tags', - + ); protected $textmap = array( 'refname' => 'format_refname_text', ); - + // Kdevelop TOC file protected $tocStream; // TOC Output directory protected $tocDir; protected $ext; - + protected $currentEntryName; protected $index = array(); - + // CHM Table of contents protected $currentTocDepth = 0; protected $lastContent = null; protected $toc; // CHM Index Map protected $hhkStream; - + public function __construct(array $IDs, $filename, $ext = "php") { parent::__construct($IDs, $ext); $this->tocDir = $GLOBALS['OPTIONS']['output_dir']; $this->ext = $ext; - + $this->tocStream = fopen($this->tocDir . "php.toc", "w"); - + self::headerToc(); } - + public function __destruct() { self::footerToc(); fclose($this->tocStream); } - + public function format_suppressed_tags($open, $name, $attrs) { return ""; } - - + + protected function headerToc() { fwrite($this->tocStream, "<!DOCTYPE kdeveloptoc>\n<kdeveloptoc>\n<title>" . self::DEFAULT_TITLE . "</title>\n" . "<base href=\"" . self::DEFAULT_HREF . "\"/>\n"); } - + protected function footerToc() { fwrite($this->tocStream, "<index>\n"); foreach ($this->index as $name => $url) fwrite($this->tocStream, "<entry name=\"{$name}\" url=\"{$url}\"/>\n"); fwrite($this->tocStream, "</index>\n</kdeveloptoc>\n"); } - + public function appendData($data, $isChunk) { } - + public function format_tocsect1($open, $name, $attrs) { if (!isset($attrs[PhDReader::XMLNS_XML]["id"])) return ""; $id = $attrs[PhDReader::XMLNS_XML]["id"]; @@ -126,7 +126,7 @@ } return ""; } - + public function format_tocsect2($open, $name, $attrs) { if (!isset($attrs[PhDReader::XMLNS_XML]["id"])) return ""; $id = $attrs[PhDReader::XMLNS_XML]["id"]; @@ -138,7 +138,7 @@ } return ""; } - + public function format_refentry($open, $name, $attrs) { if (!isset($attrs[PhDReader::XMLNS_XML]["id"])) return ""; $id = $attrs[PhDReader::XMLNS_XML]["id"]; @@ -151,7 +151,7 @@ } return ""; } - + public function format_refname_text($value, $tag) { $this->currentEntryName = $value; return ""; http://cvs.php.net/viewvc.cgi/phd/themes/php/phppdf.php?r1=1.7.4.3&r2=1.7.4.3.2.1&diff_format=u Index: phd/themes/php/phppdf.php diff -u phd/themes/php/phppdf.php:1.7.4.3 phd/themes/php/phppdf.php:1.7.4.3.2.1 --- phd/themes/php/phppdf.php:1.7.4.3 Sat Aug 23 13:51:14 2008 +++ phd/themes/php/phppdf.php Wed Feb 11 05:07:46 2009 @@ -1,8 +1,8 @@ <?php -/* $Id: phppdf.php,v 1.7.4.3 2008/08/23 13:51:14 bjori Exp $ */ +/* $Id: phppdf.php,v 1.7.4.3.2.1 2009/02/11 05:07:46 cweiske Exp $ */ class phppdf extends PhDTheme { - + protected $elementmap = array( 'article' => 'format_tocnode_newpage', 'appendix' => 'format_tocnode_newpage', @@ -79,14 +79,14 @@ ); - - + + private $acronyms = array(); - + /* Common properties for all functions pages */ protected $bookName = ""; protected $outputdir = ""; - + /* Current Chunk settings */ protected $cchunk = array(); /* Default Chunk settings */ @@ -99,7 +99,7 @@ "id-to-page" => array(), "root-outline" => null, ); - + public function __construct(array $IDs, array $filenames, $format = "pdf", $chunked = true) { parent::__construct($IDs); $this->format = $format; @@ -107,17 +107,17 @@ $this->outputdir = $GLOBALS['OPTIONS']['output_dir'] . $this->format . DIRECTORY_SEPARATOR; if(!file_exists($this->outputdir) || is_file($this->outputdir)) mkdir($this->outputdir) or die("Can't create the cache directory.\n"); } - + public function __destruct() {} - - + + // Do nothing public function appendData($data, $isChunk) {} - + // To override public function format_root_set($open, $name, $attrs, $props) {} public function format_set($open, $name, $attrs, $props) {} - + public function format_book($open, $name, $attrs, $props) { if ($open) { $this->format->newChunk(); @@ -125,15 +125,15 @@ $pdfDoc = new PdfWriter(); try { $pdfDoc->setCompressionMode(HaruDoc::COMP_ALL); - } catch (HaruException $e) { + } catch (HaruException $e) { v("PDF Compression failed, you need to compile libharu with Zlib...", E_USER_WARNING); } $this->format->setPdfDoc($pdfDoc); if (isset($attrs[PhDReader::XMLNS_XML]["base"]) && $base = $attrs[PhDReader::XMLNS_XML]["base"]) $this->format->setChunkInfo("xml-base", $base); - + $id = $attrs[PhDReader::XMLNS_XML]["id"]; - $this->cchunk["root-outline"] = $this->cchunk["id-to-outline"][$id] = + $this->cchunk["root-outline"] = $this->cchunk["id-to-outline"][$id] = $pdfDoc->createOutline(PhDHelper::getDescription($id), null, true); $this->setIdToPage($id); } else { @@ -145,28 +145,28 @@ } return false; } - + public function format_bookname($value, $tag) { $this->cchunk["bookname"] = trim($value); $this->format->getPdfDoc()->setCurrentBookName($this->cchunk["bookname"]); return false; } - + public function format_setname($value, $tag) { $this->cchunk["setname"] = trim($value); return false; } - + public function format_tocnode($open, $name, $attrs, $props, $newpage = false) { if ($open) { if ($newpage) $this->format->getPdfDoc()->add(PdfWriter::PAGE); - else + else $this->format->getPdfDoc()->add(PdfWriter::LINE_JUMP); - + if (isset($attrs[PhDReader::XMLNS_XML]["base"]) && $base = $attrs[PhDReader::XMLNS_XML]["base"]) $this->format->setChunkInfo("xml-base", $base); - + if (isset($attrs[PhDReader::XMLNS_XML]["id"]) && $id = $attrs[PhDReader::XMLNS_XML]["id"]) { $parentId = PhDHelper::getParent($id); if (isset($this->cchunk["id-to-outline"][$parentId])) { @@ -182,14 +182,14 @@ } return ""; } - + public function format_tocnode_newpage($open, $name, $attrs, $props) { return $this->format_tocnode($open, $name, $attrs, $props, true); - } - + } + public function format_tocnode_exception($open, $name, $attrs, $props) { return $this->format_tocnode($open, "reference", $attrs, $props, true); - } + } public function format_tocnode_class($open, $name, $attrs, $props) { return $this->format_tocnode($open, "reference", $attrs, $props, true); @@ -198,18 +198,18 @@ public function format_grep_classname_text($value, $tag) { $this->cchunk["phpdoc:classref"] = strtolower($value); } - + // Convert the book name to a Unix valid filename protected function toValidName($functionName) { return str_replace(array(":", "::", "->", "/", "\\", " "), array(".", ".", ".", "-", "-", "-"), $functionName); - } - + } + protected function setIdToPage($id) { if (isset($this->cchunk["id-to-page"]) && is_array($this->cchunk["id-to-page"])) { $this->cchunk["id-to-page"][$id] = $this->format->getPdfDoc()->getCurrentPage(); } } - + protected function resolveLinks($name) { v("Resolving Internal Links... (%s)", $name, VERBOSE_TOC_WRITING); $linksToResolve = $this->format->getChunkInfo("links-to-resolve"); @@ -223,10 +223,10 @@ } } } - } - + } + public function format_type_text($type, $tagname) { - $type = trim(ereg_replace( "[ \n\t]+", ' ', $type)); + $type = trim(preg_replace('/[ \n\t]+/', ' ', $type)); $t = strtolower($type); $href = $fragment = ""; @@ -272,14 +272,14 @@ $this->format->getPdfDoc()->revertFont(); return ''; } - + public function format_type_if_object_or_pseudo_text($type, $tagname) { if (in_array(strtolower($type), array("bool", "int", "double", "boolean", "integer", "float", "string", "array", "object", "resource", "null"))) { return false; } return self::format_type_text($type, $tagname); } - + public function format_collect_id($open, $name, $attrs, $props, $newpage = false) { if ($open && isset($attrs[PhDReader::XMLNS_XML]["id"]) && $id = $attrs[PhDReader::XMLNS_XML]["id"]) { $this->setIdToPage($id);
« previous php.doc.cvs (#3188) next »