Re: [PHP-DOC] Intro and quick patches
On Wed, Jul 15, 2009 at 02:23, Philip Olsonphi...@roshambo.org wrote: This diff brings up a good point for us to discuss. What is the preferred method to check something out from SVN? Most anything we do requires at least two SVN checkouts. A classic example for English: - cd /where/doc/stuff/is/stored - svn co http://svn.php.net/repository/phpdoc/en/trunk phpdoc/en - svn co http://svn.php.net/repository/phpdoc/doc-base/trunk phpdoc/doc-base People have already created these helper modules: http://svn.php.net/repository/phpdoc/modules/ -Hannes
Re: [PHP-DOC] Intro and quick patches
On Wed, Jul 15, 2009 at 02:06, Niel Archern...@chance.now wrote: However the phd installed doesn't appear to be a working version. i.e. there is no phd.bat file created which makes it is unusable on WIndows I'd guess. Hmh. Richard or Kalle, could you verify this? I'm pretty darn sure we use normal PhD installs over the channel on the Windows box to generate the CHM files.. That phd.bat _should_ be there. Niel: Please fix your From: address.. -Hannes
Re: [PHP-DOC] Intro and quick patches
On Jul 15, 2009, at 12:00 AM, Hannes Magnusson wrote: On Wed, Jul 15, 2009 at 02:23, Philip Olsonphi...@roshambo.org wrote: This diff brings up a good point for us to discuss. What is the preferred method to check something out from SVN? Most anything we do requires at least two SVN checkouts. A classic example for English: - cd /where/doc/stuff/is/stored - svn co http://svn.php.net/repository/phpdoc/en/trunk phpdoc/en - svn co http://svn.php.net/repository/phpdoc/doc-base/trunk phpdoc/doc-base People have already created these helper modules: http://svn.php.net/repository/phpdoc/modules/ So in this case the English example changes to: - cd /where/doc/stuff/is/stored - svn co http://svn.php.net/repository/phpdoc/modules/doc-en Everyone feel comfortable with promoting this as our official method? Which then creates: - /where/doc/stuff/is/stored/doc-en/en - /where/doc/stuff/is/stored/doc-en/doc-base Seems okay. Each translation includes the above plus the language directory. In IRC we discussed a few potential svn:externals gotchas including (KSChan also mentioned these): - They must be manually updated - like when new modules are created or changed. Although, we rarely add languages so this is a bigger worry for other parts of php.net, like pecl - We can't do the following (and no error is given): --- cd /where/doc/stuff/is/stored/doc-en/ --- svn diff --- svn commit -m 'changes I made to both doc-base/ and en/' Not show stoppers here but worth noting and documenting. It's rare people will want to do the latter, except for let's say adding an URL (as the entity lives in doc-base) but then again the following does work: --- cd /where/doc/stuff/is/stored/doc-en/ --- svn diff en doc-base --- svn commit en doc-base -m 'changes I made to both doc-base/ and en/' One thing we shouldn't do anyways is for example commit to both en/ and ja/ in one commit, or phpdoc and php-src... Regards, Philip
Re: [PHP-DOC] Intro and quick patches
2009/7/15 Hannes Magnusson hannes.magnus...@gmail.com: On Wed, Jul 15, 2009 at 02:06, Niel Archern...@chance.now wrote: However the phd installed doesn't appear to be a working version. i.e. there is no phd.bat file created which makes it is unusable on WIndows I'd guess. Hmh. Richard or Kalle, could you verify this? I'm pretty darn sure we use normal PhD installs over the channel on the Windows box to generate the CHM files.. That phd.bat _should_ be there. Niel: Please fix your From: address.. -Hannes I use the CVS (now SVN), so there is no phd.bat by default, only if installed via PEAR. So, in my case, I use phd's build.php instead. As mentioned on http://wiki.php.net/doc/phd/install#using_cvs (which is wonky with the CVS terminology, but still relevant). Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! ZOPA : http://uk.zopa.com/member/RQuadling
Re: [PHP-DOC] Intro and quick patches
On Wed, Jul 15, 2009 at 10:45, Richard Quadlingrquadl...@googlemail.com wrote: 2009/7/15 Hannes Magnusson hannes.magnus...@gmail.com: On Wed, Jul 15, 2009 at 02:06, Niel Archern...@chance.now wrote: However the phd installed doesn't appear to be a working version. i.e. there is no phd.bat file created which makes it is unusable on WIndows I'd guess. Hmh. Richard or Kalle, could you verify this? I'm pretty darn sure we use normal PhD installs over the channel on the Windows box to generate the CHM files.. That phd.bat _should_ be there. Niel: Please fix your From: address.. -Hannes I use the CVS (now SVN), so there is no phd.bat by default, only if installed via PEAR. So, in my case, I use phd's build.php instead. What do you mean? The file is in SVN: http://svn.php.net/viewvc/phd/branches/PHD_0_4/phd.bat?view=log And you should also be able to `pear install package.xml` just fine. -Hannes
Re: [PHP-DOC] Intro and quick patches
2009/7/15 Hannes Magnusson hannes.magnus...@gmail.com: On Wed, Jul 15, 2009 at 10:45, Richard Quadlingrquadl...@googlemail.com wrote: 2009/7/15 Hannes Magnusson hannes.magnus...@gmail.com: On Wed, Jul 15, 2009 at 02:06, Niel Archern...@chance.now wrote: However the phd installed doesn't appear to be a working version. i.e. there is no phd.bat file created which makes it is unusable on WIndows I'd guess. Hmh. Richard or Kalle, could you verify this? I'm pretty darn sure we use normal PhD installs over the channel on the Windows box to generate the CHM files.. That phd.bat _should_ be there. Niel: Please fix your From: address.. -Hannes I use the CVS (now SVN), so there is no phd.bat by default, only if installed via PEAR. So, in my case, I use phd's build.php instead. What do you mean? The file is in SVN: http://svn.php.net/viewvc/phd/branches/PHD_0_4/phd.bat?view=log And you should also be able to `pear install package.xml` just fine. -Hannes I meant that the phd.bat isn't ready to use if you get phd via SVN. You don't actually need PEAR. Therefore no need to PEAR INSTALL. phd/phd.bat just calls phd/build.bat, so cutting out the middle man. But typing ... pear install package.xml from the checkedout svn folder quite happily installs phd into pear and configures the phd.bat script. Regards, Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! ZOPA : http://uk.zopa.com/member/RQuadling
[PHP-DOC] Using set xml:base
Hello. I recently submitted a hack to get the images copied when building phpdoc via phd_0_4 when the doc-base and en folders are parallel. I was looking into a proper way to handle this. One option I think is appropriate would be to use ... set xml:base=xxx where xxx is realpath(dirname(@LANGDIR@)) (sort of thing). I don't know the performance penalty of this option. I think all the absolute paths (file-entities.xml for one) would have to become relative to xxx for this to work. Or the hack could just stand. Richard. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! ZOPA : http://uk.zopa.com/member/RQuadling
Re: [PHP-DOC] Intro and quick patches
On Wed, Jul 15, 2009 at 02:06, Niel Archern...@chance.now wrote: However the phd installed doesn't appear to be a working version. i.e. there is no phd.bat file created which makes it is unusable on WIndows I'd guess. My mistake. I was expecting to find it in the phd directory under PEAR. not in the PHP directory. Hmh. Richard or Kalle, could you verify this? I'm pretty darn sure we use normal PhD installs over the channel on the Windows box to generate the CHM files.. That phd.bat _should_ be there. Niel: Please fix your From: address.. Fixed. It's habitual for me to use a dummy address in from to avoid spam, and include my address in the sig. -Hannes -- Niel Archer niel.archer (at) blueyonder.co.uk
[PHP-DOC] Patch for doc-base/README
Hi Mostly SVN related. One typo and some white space fixes (spaces/tabs in blank lines) also. doc-base_README.diff Description: Binary data
Re: [PHP-DOC] Patch for doc-base/README
Forgot to mention, the HOWTO page refereed to in the README (http://doc.php.net/php/dochowto/) is not available (404 error)
[PHP-DOC] Patches
Hey guys, Some patches to improve the factory system and load the formats dynamically. what do you think? --Moacir Index: phpdotnet/phd/BuildOptionsParser.php === --- phpdotnet/phd/BuildOptionsParser.php(revision 284053) +++ phpdotnet/phd/BuildOptionsParser.php(working copy) @@ -36,21 +36,8 @@ { $formats = array(); foreach((array)$v as $i = $val) { -switch($val) { -case xhtml: -case bigxhtml: -case howto: -case php: -case manpage: -case kdevelop: -case pdf: -case bigpdf: -if (!in_array($val, $formats)) { -$formats[] = $val; -} -break; -default: -trigger_error(Format not supported at this time, E_USER_ERROR); +if (!in_array($val, $formats)) { +$formats[] = $val; } } Config::set_output_format($formats); @@ -139,7 +126,7 @@ if (is_null($packageList)) { $packageList = array(); foreach (glob($GLOBALS['ROOT'] . /phpdotnet/phd/Package/*, GLOB_ONLYDIR) as $item) { -if (!in_array(basename($item), array('CVS', '.', '..'))) { +if (!in_array(basename($item), array('.svn', '.', '..'))) { $packageList[] = basename($item); } } @@ -223,21 +210,16 @@ if (is_null($packageList)) { $packageList = array(); foreach (glob($GLOBALS['ROOT'] . /phpdotnet/phd/Package/*, GLOB_ONLYDIR) as $item) { -if (!in_array(basename($item), array('CVS', '.', '..'))) { -$formats = array(); -foreach (glob($item . /*.php) as $subitem) { -if (strcmp(basename($subitem), Factory.php) != 0) { -$formats[] = substr(basename($subitem), 0, -4); -} -} -$packageList[basename($item)] = $formats; +if (!in_array(basename($item), array('.svn', '.', '..'))) { + $packageList[] = basename($item); } } } echo Supported packages:\n; -foreach ($packageList as $package = $formats) { -echo \t . $package . \n\t\t . implode(\n\t\t, $formats) . \n; +foreach ($packageList as $package) { +$factory = Format_Factory::createFactory($package); +echo \t . $package . \n\t\t . implode(\n\t\t, $factory-getOutputFormats()) . \n; } exit(0); Index: phpdotnet/phd/Config.php === --- phpdotnet/phd/Config.php(revision 284053) +++ phpdotnet/phd/Config.php(working copy) @@ -7,16 +7,7 @@ class Config { private static $optionArray = array( -'output_format' = array( -'xhtml', -'php', -'bigxhtml', -'howto', -'manpage', -'kdevelop', -'pdf', -'bigpdf', -), +'output_format' = array(), 'chunk_extra' = array( legalnotice = true, phpdoc:exception = true, Index: ../phpdotnet/phd/Package/Default/Factory.php === --- ../phpdotnet/phd/Package/Default/Factory.php(revision 283894) +++ ../phpdotnet/phd/Package/Default/Factory.php(working copy) @@ -2,18 +2,15 @@ namespace phpdotnet\phd; class Package_Default_Factory extends Format_Factory { -public function createXhtmlFormat() { -return new Package_Default_ChunkedXHTML(); -} - -public function createBigXhtmlFormat() { -return new Package_Default_BigXHTML(); -} - -public function createPHPFormat() { -return new Package_Default_PHP(); -} +private $formats = array( +'xhtml' = 'Package_Default_ChunkedXHTML', +'bigxhtml' = 'Package_Default_BigXHTML', +'php' = 'Package_Default_PHP', +); +public function __construct() { +parent::registerOutputFormats($this-formats); +} } ? Index: phpdotnet/phd/Format/Factory.php === --- phpdotnet/phd/Format/Factory.php(revision 284054) +++ phpdotnet/phd/Format/Factory.php(working copy) @@ -1,36 +1,34 @@ ?php namespace phpdotnet\phd; -abstract class Format_Factory -{ -public function createXhtmlFormat() { -trigger_error(This format is not supported by this package, E_USER_ERROR); +abstract class Format_Factory { +private $formats = array(); + +public final function