Re: [PHP-DOC] Manually adding version information to "random pages" now possible
Great news! Some thoughts on improvement: I think it would be better to have print-version-for attribute optional, so if it's absent phd would take current xml:id of current section i.e. its parent, because it will be frequently written as so it's effectively duplicates already written information. It would be also nicer if it was regular tag like and , if it possible, of course :) Secondly, won't it have namespace issues if those ids would coincide? It seems they don't strictly match xml:id attribute. That's all for now :) Again, great work! 2011/7/6 Hannes Magnusson : > PhD has now support for > > This means you can now print out the version information on any page, > such as namespace docs, language constructs or wherever. > See http://svn.php.net/viewvc?view=revision&revision=312947 for examples. > > Remember, the `foobar` entry needs to be available in some versions.xml file. > You can create a new versions.xml file if it doesn't already exists. > configure.php will aggregate all versions.xml under > en///versions.xml > > > -Hannes > > -- Forwarded message -- > From: Hannes Magnusson > Date: Tue, Jul 5, 2011 at 20:54 > Subject: [DOC-CVS] svn: /phd/trunk/ package.xml > phpdotnet/phd/PI/PHPDOCHandler.php phpdotnet/phd/Package/PHP/XHTML.php > phpdotnet/phd/Render.php > To: doc-...@lists.php.net > > > bjori Tue, 05 Jul 2011 18:54:18 + > > Revision: http://svn.php.net/viewvc?view=revision&revision=312946 > > Log: > Add support for > Initially only supports > where `foobar` is an item in the aggregated version.xml file. > print-version-for will go through the same mechanism as all > refpages to generate version information, and therefore > fallback to "may only be in svn" if no found. > > Changed paths: > U phd/trunk/package.xml > A phd/trunk/phpdotnet/phd/PI/PHPDOCHandler.php > U phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php > U phd/trunk/phpdotnet/phd/Render.php > > Modified: phd/trunk/package.xml > === > --- phd/trunk/package.xml 2011-07-05 18:38:56 UTC (rev 312945) > +++ phd/trunk/package.xml 2011-07-05 18:54:18 UTC (rev 312946) > @@ -24,18 +24,18 @@ > yes > > > - Christian Weiske > - cweiske > - cwei...@php.net > - yes > - > - > Moacir de Oliveira > moacir > moa...@php.net > yes > > > + Christian Weiske > + cweiske > + cwei...@php.net > + yes > + > + > Paul M Jones > pmjones > pmjo...@php.net > @@ -71,7 +71,7 @@ > > http://www.opensource.org/licenses/bsd-license.php";>BSD > Style > > - -notes > + - Added phpdoc PI handler to handle manually added version information. > > > > @@ -117,6 +117,7 @@ > > > > + > > > > > Added: phd/trunk/phpdotnet/phd/PI/PHPDOCHandler.php > === > --- phd/trunk/phpdotnet/phd/PI/PHPDOCHandler.php > (rev 0) > +++ phd/trunk/phpdotnet/phd/PI/PHPDOCHandler.php 2011-07-05 > 18:54:18 UTC (rev 312946) > @@ -0,0 +1,29 @@ > + +namespace phpdotnet\phd; > +/* $Id: PHPDOCHandler.php 293260 2010-01-08 10:41:19Z rquadling $ */ > + > +class PI_PHPDOCHandler extends PIHandler { > + > + public function __construct($format) { > + parent::__construct($format); > + } > + > + public function parse($target, $data) { > + $pattern = > "/(?[\w]+[\w\-\.]*)[\s]*=[\s]*\"(?[^\"]*)\"/"; > + > + preg_match($pattern, $data, $matches); > + switch($matches["attr"]) { > + case "print-version-for": > + // FIXME: Figureout a way to detect the current > language (for unknownversion) > + return > $this->format->autogenVersionInfo($matches["value"], "en"); > + } > + } > + > +} > + > +/* > +* vim600: sw=4 ts=4 syntax=php et > +* vim<600: sw=4 ts=4 > +*/ > + > + > > Modified: phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php > === > --- phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php 2011-07-05 > 18:38:56 UTC (rev 312945) > +++ phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php 2011-07-05 > 18:54:18 UTC (rev 312946) > @@ -134,12 +134,18 @@ > "refname" => array(), > ); > > + protected $pihandlers = array( > + 'dbhtml' => 'PI_DBHTMLHandler', > + 'dbtimestamp' => 'PI_DBHTMLHandler', > + 'phpdoc' => 'PI_PHPDOCHandler', > + ); > + > public function __construct() { > parent::__construct(); > $this->myelementmap = > array_merge(parent::getDefaultElementMap(), > static::getDefaultElementMap()); > $this->mytextmap = array_merge(parent::getDefaultTextMap(), > static::getDefaultTextMap()); > $this->dchunk = array_merge(parent::getDefaultChunkInfo(), > stat
[PHP-DOC] SVN Account Request: cythrawll
updating documentation
Re: [PHP-DOC] SVN Account Request: chunsong
On Jul 3, 2011, at 8:54 PM, Chunsong Tang wrote: > Maintaining the documentation Greetings Chunsong, Your account has been approved with phpdoc karma granted, welcome to the PHP documentation team! :) Regards, Philip
RE: [PHP-DOC] SQLSRV and PDO_SQLSRV Documentation Patch
Thanks for the feedback! :) I'll get on to the changes, wait a day for more updates, then commit it. Thank you! Jonathan > -Original Message- > From: Philip Olson [mailto:phi...@roshambo.org] > Sent: Tuesday, July 05, 2011 12:27 PM > To: Jonathan Guerin > Cc: phpdoc@lists.php.net > Subject: Re: [PHP-DOC] SQLSRV and PDO_SQLSRV Documentation Patch > > > On Jul 5, 2011, at 10:43 AM, Jonathan Guerin wrote: > > > Update: Sounds like I sent this to the wrong mailing list. Resending to the > appropriate one! > > > >> Hi everyone, > >> > >> Here is our patch for the initial addition of the PHP Manual for the > >> SQLSRV and PDO_SQLSRV extensions. > > Overall it looks good and nicely detailed. However: > > Please cleanup the whitespace, which should include using spaces instead of > tabs. And the wide line widths makes it difficult to read, so should be > closer to > 80 than 300 in length. > > And although we have a questionable and non-existent style guide (sorry about > that, our bad): > > - A few entities worth using (common for return value descriptions): > > - &null; instead of NULL > - &true; '' > - &false; '' > > - Random: > > - should not contain ending periods > - Adding output to examples is often useful, and is done using > within > > - " " where the &example.outputs.similar; entity is useful in cases like > this > - Example within sqlsrv-num-fields.xml contains a parse error > - You may want to link (and edit) the new install/cloud/azure.xml docs > - Third-person active voice is preferred (don't worry about this now, too > much > work) > > And feel free to ask further questions here or casually within #php.doc on > EFNet > IRC. The above are common problems for new docs, and I thought all of it was > written down (???) but now I cannot find. Getting old I guess. But, thanks to > your efforts, this will certainly be written down so people in the future will > know from the beginning and perform less work. Again, sorry about that > > >> We would love to gather feedback, as well as understand the next > >> steps. Do we simply commit this patch once it is approved? > > Yes, you'll commit it then random people (including you, at any time, no > approval needed) will update it in the future. > > Regards, > Philip >
Re: [PHP-DOC] SQLSRV and PDO_SQLSRV Documentation Patch
On Jul 5, 2011, at 10:43 AM, Jonathan Guerin wrote: > Update: Sounds like I sent this to the wrong mailing list. Resending to the > appropriate one! > >> Hi everyone, >> >> Here is our patch for the initial addition of the PHP Manual for the SQLSRV >> and >> PDO_SQLSRV extensions. Overall it looks good and nicely detailed. However: Please cleanup the whitespace, which should include using spaces instead of tabs. And the wide line widths makes it difficult to read, so should be closer to 80 than 300 in length. And although we have a questionable and non-existent style guide (sorry about that, our bad): - A few entities worth using (common for return value descriptions): - &null; instead of NULL - &true; '' - &false; '' - Random: - should not contain ending periods - Adding output to examples is often useful, and is done using within - " " where the &example.outputs.similar; entity is useful in cases like this - Example within sqlsrv-num-fields.xml contains a parse error - You may want to link (and edit) the new install/cloud/azure.xml docs - Third-person active voice is preferred (don't worry about this now, too much work) And feel free to ask further questions here or casually within #php.doc on EFNet IRC. The above are common problems for new docs, and I thought all of it was written down (???) but now I cannot find. Getting old I guess. But, thanks to your efforts, this will certainly be written down so people in the future will know from the beginning and perform less work. Again, sorry about that >> We would love to gather feedback, as well as understand the next steps. Do we >> simply commit this patch once it is approved? Yes, you'll commit it then random people (including you, at any time, no approval needed) will update it in the future. Regards, Philip
[PHP-DOC] Manually adding version information to "random pages" now possible
PhD has now support for This means you can now print out the version information on any page, such as namespace docs, language constructs or wherever. See http://svn.php.net/viewvc?view=revision&revision=312947 for examples. Remember, the `foobar` entry needs to be available in some versions.xml file. You can create a new versions.xml file if it doesn't already exists. configure.php will aggregate all versions.xml under en///versions.xml -Hannes -- Forwarded message -- From: Hannes Magnusson Date: Tue, Jul 5, 2011 at 20:54 Subject: [DOC-CVS] svn: /phd/trunk/ package.xml phpdotnet/phd/PI/PHPDOCHandler.php phpdotnet/phd/Package/PHP/XHTML.php phpdotnet/phd/Render.php To: doc-...@lists.php.net bjori Tue, 05 Jul 2011 18:54:18 + Revision: http://svn.php.net/viewvc?view=revision&revision=312946 Log: Add support for Initially only supports where `foobar` is an item in the aggregated version.xml file. print-version-for will go through the same mechanism as all refpages to generate version information, and therefore fallback to "may only be in svn" if no found. Changed paths: U phd/trunk/package.xml A phd/trunk/phpdotnet/phd/PI/PHPDOCHandler.php U phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php U phd/trunk/phpdotnet/phd/Render.php Modified: phd/trunk/package.xml === --- phd/trunk/package.xml 2011-07-05 18:38:56 UTC (rev 312945) +++ phd/trunk/package.xml 2011-07-05 18:54:18 UTC (rev 312946) @@ -24,18 +24,18 @@ yes - Christian Weiske - cweiske - cwei...@php.net - yes - - Moacir de Oliveira moacir moa...@php.net yes + Christian Weiske + cweiske + cwei...@php.net + yes + + Paul M Jones pmjones pmjo...@php.net @@ -71,7 +71,7 @@ http://www.opensource.org/licenses/bsd-license.php";>BSD Style - -notes + - Added phpdoc PI handler to handle manually added version information. @@ -117,6 +117,7 @@ + Added: phd/trunk/phpdotnet/phd/PI/PHPDOCHandler.php === --- phd/trunk/phpdotnet/phd/PI/PHPDOCHandler.php (rev 0) +++ phd/trunk/phpdotnet/phd/PI/PHPDOCHandler.php 2011-07-05 18:54:18 UTC (rev 312946) @@ -0,0 +1,29 @@ +[\w]+[\w\-\.]*)[\s]*=[\s]*\"(?[^\"]*)\"/"; + + preg_match($pattern, $data, $matches); + switch($matches["attr"]) { + case "print-version-for": + // FIXME: Figureout a way to detect the current language (for unknownversion) + return $this->format->autogenVersionInfo($matches["value"], "en"); + } + } + +} + +/* +* vim600: sw=4 ts=4 syntax=php et +* vim<600: sw=4 ts=4 +*/ + + Modified: phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php === --- phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php 2011-07-05 18:38:56 UTC (rev 312945) +++ phd/trunk/phpdotnet/phd/Package/PHP/XHTML.php 2011-07-05 18:54:18 UTC (rev 312946) @@ -134,12 +134,18 @@ "refname" => array(), ); + protected $pihandlers = array( + 'dbhtml' => 'PI_DBHTMLHandler', + 'dbtimestamp' => 'PI_DBHTMLHandler', + 'phpdoc' => 'PI_PHPDOCHandler', + ); + public function __construct() { parent::__construct(); $this->myelementmap = array_merge(parent::getDefaultElementMap(), static::getDefaultElementMap()); $this->mytextmap = array_merge(parent::getDefaultTextMap(), static::getDefaultTextMap()); $this->dchunk = array_merge(parent::getDefaultChunkInfo(), static::getDefaultChunkInfo()); - $this->extraIndexInformation(); + $this->registerPIHandlers($this->pihandlers); } public function getDefaultElementMap() { @@ -154,14 +160,6 @@ return $this->dchunk; } - public function extraIndexInformation() { - $this->addRefname("function.include", "include"); - $this->addRefname("function.include-once", "include-once"); - $this->addRefname("function.require", "require"); - $this->addRefname("function.require-once", "require-once"); - $this->addRefname("function.return", "return"); - } - public function loadVersionAcronymInfo() { $this->versions = self::generateVersionInfo(Config::phpweb_version_filename()); $this->acronyms = self::generateAcronymInfo(Config::phpweb_acronym_filename()); @@ -234,23 +232,27 @@ return $acronyms; } + public function autogenVersionInfo($refnames, $lang) { + $verinfo = null; + foreach((array)$refnames as $refname) { + $verinfo = $this->versionInfo($refname); + + if ($verinfo) { + break; + } + } + if (!$verinfo) { +