cvs: pear /CodeGen_PECL TODO package.xml /CodeGen_PECL/PECL Extension.php ExtensionParser.php
| From: | Hartmut Holzgraefe | Date: | Fri, 18 Aug 2006 14:13:03 +0000 |
| Subject: | cvs: pear /CodeGen_PECL TODO package.xml /CodeGen_PECL/PECL Extension.php ExtensionParser.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-41782@lists.php.net to get a copy of this message | ||
hholzgra Fri Aug 18 14:13:03 2006 UTC
Modified files:
/pear/CodeGen_PECL TODO package.xml
/pear/CodeGen_PECL/PECL Extension.php ExtensionParser.php
Log:
standalone documentation generation hacked in
http://cvs.php.net/viewvc.cgi/pear/CodeGen_PECL/TODO?r1=1.32&r2=1.33&diff_format=u Index: pear/CodeGen_PECL/TODO diff -u pear/CodeGen_PECL/TODO:1.32 pear/CodeGen_PECL/TODO:1.33 --- pear/CodeGen_PECL/TODO:1.32 Wed Aug 16 10:42:10 2006 +++ pear/CodeGen_PECL/TODO Fri Aug 18 14:13:03 2006 @@ -32,6 +32,11 @@ - re2c and lemon support in config.m4 / Makefile.frag generation? +- headers and libs within <with> are not taken into account in the + documentation + +- make standalone docs Makefile more clever + not necessarily 1.1 http://cvs.php.net/viewvc.cgi/pear/CodeGen_PECL/package.xml?r1=1.19&r2=1.20&diff_format=u Index: pear/CodeGen_PECL/package.xml diff -u pear/CodeGen_PECL/package.xml:1.19 pear/CodeGen_PECL/package.xml:1.20 --- pear/CodeGen_PECL/package.xml:1.19 Mon Aug 14 22:50:43 2006 +++ pear/CodeGen_PECL/package.xml Fri Aug 18 14:13:03 2006 @@ -56,17 +56,18 @@ <release> <state>stable</state> - <version>1.0.2</version> - <date>2006-08-14</date> + <version>1.0.4</version> + <date>2006-08-17</date> <notes> -Changes since 1.0.1: -- conditional compile support for functions +Changes since 1.0.3: +- added support for constant grouping +- standalone documentation support hacked in </notes> <deps> <dep type="php" rel="ge" version="5"/> <dep type="pkg" rel="ge" version="1.2">PEAR</dep> - <dep type="pkg" rel="eq" version="1.0.1">CodeGen</dep> + <dep type="pkg" rel="eq" version="1.0.2">CodeGen</dep> </deps> <filelist> @@ -128,6 +129,17 @@ <changelog> <release> + <state>stable</state> + <version>1.0.3</version> + <date>2006-08-16</date> + <notes> +Changes since 1.0.2: +- fixed CodeGen dependency entry +- disabled #line output by default + </notes> + </release> + + <release> <state>stable</state> <version>1.0.1</version> <date>2006-08-14</date> http://cvs.php.net/viewvc.cgi/pear/CodeGen_PECL/PECL/Extension.php?r1=1.54&r2=1.55&diff_format=u Index: pear/CodeGen_PECL/PECL/Extension.php diff -u pear/CodeGen_PECL/PECL/Extension.php:1.54 pear/CodeGen_PECL/PECL/Extension.php:1.55 --- pear/CodeGen_PECL/PECL/Extension.php:1.54 Thu Aug 17 17:05:14 2006 +++ pear/CodeGen_PECL/PECL/Extension.php Fri Aug 18 14:13:03 2006 @@ -15,7 +15,7 @@ * @author Hartmut Holzgraefe <hartmut@php.net> * @copyright 2005 Hartmut Holzgraefe * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Extension.php,v 1.54 2006/08/17 17:05:14 hholzgra Exp $ + * @version CVS: $Id: Extension.php,v 1.55 2006/08/18 14:13:03 hholzgra Exp $ * @link http://pear.php.net/package/CodeGen_PECL */ @@ -570,7 +570,7 @@ $this->writeReadme(); // generate DocBook XML documantation for PHP manual - $manpath = $this->dirpath . "/manual/" . str_replace('_', '-', $this->name); + $manpath = $this->dirpath . "/manual/"; if (!@System::mkdir("-p $manpath")) { return PEAR::raiseError("can't create '$manpath'", E_USER_ERROR); } @@ -640,7 +640,66 @@ { $idName = str_replace('_', '-', $this->name); - $fp = new CodeGen_Tools_FileReplacer("$docdir/reference.xml"); + if (!@System::mkdir("-p $docdir/$idName")) { + return PEAR::raiseError("can't create '$docdir/$idName'", E_USER_ERROR); + } + + $manual = new CodeGen_Tools_FileReplacer("$docdir/manual.xml.in"); + $manual->puts("<?xml version='1.0' encoding='UTF-8' ?> +<!DOCTYPE book PUBLIC '-//OASIS//DTD DocBook XML V4.1.2//EN' + '@PHPDOC@/dtds/dbxml-4.1.2/docbookx.dtd' [ + +<!-- Add translated specific definitions and snippets --> +<!ENTITY % language-defs SYSTEM '@PHPDOC@/en/language-defs.ent'> +<!ENTITY % language-snippets SYSTEM '@PHPDOC@/en/language-snippets.ent'> + +%language-defs; +%language-snippets; + +<!-- Fallback to English definitions and snippets (in case of missing translation) --> +<!ENTITY % language-defs.default SYSTEM '@PHPDOC@/en/language-defs.ent'> +<!ENTITY % language-snippets.default SYSTEM '@PHPDOC@/en/language-snippets.ent'> +<!ENTITY % extensions.default SYSTEM '@PHPDOC@/en/extensions.ent'> + +%language-defs.default; +%language-snippets.default; +%extensions.default; + +<!-- All global entities for the XML files --> +<!ENTITY % global.entities SYSTEM '@PHPDOC@/entities/global.ent'> + +<!ENTITY % file.entities SYSTEM './file-entities.ent'> + +<!-- Include all external DTD parts defined previously --> +%global.entities; +%file.entities; + +<!-- Autogenerated missing entites and IDs to make build work --> +<!ENTITY % missing-entities SYSTEM '@PHPDOC@/entities/missing-entities.ent'> +%missing-entities; +]> + +<book id='manual' lang='en'> + &reference.cairo-wrapper.reference; +</book> +"); + $manual->close(); + + $makefile = new CodeGen_Tools_FileReplacer("$docdir/Makefile"); + $makefile->puts("# +all: +\t@if test \"x$(PHPDOC)\" = \"x\"; then echo PHPDOC not set; exit 3; fi +\trm -rf html; mkdir html +\tsed -e's:@PHPDOC@:\$(PHPDOC):g' < manual.xml.in > manual.xml +\tSP_ENCODING=XML SP_CHARSET_FIXED=YES /usr/bin/openjade -D $(PHPDOC) -wno-idref -c $(PHPDOC)/entities/ISO/catalog -c $(PHPDOC)/dsssl/docbook/catalog -c /usr/share/sgml/CATALOG.docbk41 -c /usr/share/sgml/CATALOG.jade_dsl -c $(PHPDOC)/dsssl/defaults/catalog -d dsssl/html.dsl -V use-output-dir -t sgml $(PHPDOC)/dtds/dbxml-4.1.2/phpdocxml.dcl manual.xml +"); + + $makefile->close(); + + $entities = new CodeGen_Tools_FileReplacer("$docdir/file-entities.ent"); + + $entities->puts("<!ENTITY reference.$idName.reference SYSTEM './$idName/reference.xml'>\n"); + $fp = new CodeGen_Tools_FileReplacer("$docdir/$idName/reference.xml"); $fp->puts( "<?xml version='1.0' encoding='iso-8859-1'?> <!-- ".'$'."Revision: 1.1 $ --> @@ -717,7 +776,8 @@ $fp->close(); // configure options and dependencies have their own file - $fp = new CodeGen_Tools_FileReplacer("$docdir/configure.xml"); + $entities->puts("<!ENTITY reference.$idName.configure SYSTEM './$idName/configure.xml'>\n"); + $fp = new CodeGen_Tools_FileReplacer("$docdir/$idName/configure.xml"); $fp->puts("\n <section id='$idName.requirements'>\n &reftitle.required;\n"); @@ -758,7 +818,7 @@ $fp->puts(" <para>\n".rtrim($with->summary)."\n </para>\n"); } } else { - // TODO default text + $fp->puts(" <para>Requires <literal>".$with->getName()."</literal></para>\n"); } } } @@ -779,14 +839,33 @@ $fp->puts($this->docEditorSettings()); $fp->close(); - @mkdir("$docdir/functions"); + + $function_entities = array(); + @mkdir("$docdir/$idName/functions"); foreach ($this->functions as $name => $function) { - $filename = $docdir . "/functions/" . strtolower(str_replace("_", "-", $name)) . ".xml"; - $funcfile = new CodeGen_Tools_FileReplacer($filename); + $functionId = strtolower(str_replace("_", "-", $name)); + $filepath = "$idName/functions/$functionId.xml"; + + $entity = "reference.$idName.functions.$functionId"; + $function_entities[] = $entity; + $entities->puts("<!ENTITY $entity SYSTEM './$filepath'>\n"); + + $funcfile = new CodeGen_Tools_FileReplacer("$docdir$filepath"); $funcfile->puts($function->docEntry($idName)); $funcfile->puts($this->docEditorSettings(4)); $funcfile->close(); } + + + $entities->puts("<!ENTITY reference.$idName.functions SYSTEM './functions.xml'>\n"); + $entities->close(); + + sort($function_entities); + foreach ($function_entities as $entity) { + $functionsXml = new CodeGen_Tools_FileReplacer($docdir."/functions.xml"); + $functionsXml->puts("&$entity;\n"); + $functionsXml->close(); + } } // }}} http://cvs.php.net/viewvc.cgi/pear/CodeGen_PECL/PECL/ExtensionParser.php?r1=1.48&r2=1.49&diff_format=u Index: pear/CodeGen_PECL/PECL/ExtensionParser.php diff -u pear/CodeGen_PECL/PECL/ExtensionParser.php:1.48 pear/CodeGen_PECL/PECL/ExtensionParser.php:1.49 --- pear/CodeGen_PECL/PECL/ExtensionParser.php:1.48 Thu Aug 17 17:05:14 2006 +++ pear/CodeGen_PECL/PECL/ExtensionParser.php Fri Aug 18 14:13:03 2006 @@ -15,7 +15,7 @@ * @author Hartmut Holzgraefe <hartmut@php.net> * @copyright 2005 Hartmut Holzgraefe * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: ExtensionParser.php,v 1.48 2006/08/17 17:05:14 hholzgra Exp $ + * @version CVS: $Id: ExtensionParser.php,v 1.49 2006/08/18 14:13:03 hholzgra Exp $ * @link http://pear.php.net/package/CodeGen */ @@ -708,7 +708,6 @@ $this->helper->addLib($lib); } - function tagend_deps_with($attr, $data) { $this->helper->setSummary($data);
http://cvs.php.net/viewvc.cgi/pear/CodeGen_PECL/TODO?r1=1.32&r2=1.33&diff_format=u Index: pear/CodeGen_PECL/TODO diff -u pear/CodeGen_PECL/TODO:1.32 pear/CodeGen_PECL/TODO:1.33 --- pear/CodeGen_PECL/TODO:1.32 Wed Aug 16 10:42:10 2006 +++ pear/CodeGen_PECL/TODO Fri Aug 18 14:13:03 2006 @@ -32,6 +32,11 @@ - re2c and lemon support in config.m4 / Makefile.frag generation? +- headers and libs within <with> are not taken into account in the + documentation + +- make standalone docs Makefile more clever + not necessarily 1.1 http://cvs.php.net/viewvc.cgi/pear/CodeGen_PECL/package.xml?r1=1.19&r2=1.20&diff_format=u Index: pear/CodeGen_PECL/package.xml diff -u pear/CodeGen_PECL/package.xml:1.19 pear/CodeGen_PECL/package.xml:1.20 --- pear/CodeGen_PECL/package.xml:1.19 Mon Aug 14 22:50:43 2006 +++ pear/CodeGen_PECL/package.xml Fri Aug 18 14:13:03 2006 @@ -56,17 +56,18 @@ <release> <state>stable</state> - <version>1.0.2</version> - <date>2006-08-14</date> + <version>1.0.4</version> + <date>2006-08-17</date> <notes> -Changes since 1.0.1: -- conditional compile support for functions +Changes since 1.0.3: +- added support for constant grouping +- standalone documentation support hacked in </notes> <deps> <dep type="php" rel="ge" version="5"/> <dep type="pkg" rel="ge" version="1.2">PEAR</dep> - <dep type="pkg" rel="eq" version="1.0.1">CodeGen</dep> + <dep type="pkg" rel="eq" version="1.0.2">CodeGen</dep> </deps> <filelist> @@ -128,6 +129,17 @@ <changelog> <release> + <state>stable</state> + <version>1.0.3</version> + <date>2006-08-16</date> + <notes> +Changes since 1.0.2: +- fixed CodeGen dependency entry +- disabled #line output by default + </notes> + </release> + + <release> <state>stable</state> <version>1.0.1</version> <date>2006-08-14</date> http://cvs.php.net/viewvc.cgi/pear/CodeGen_PECL/PECL/Extension.php?r1=1.54&r2=1.55&diff_format=u Index: pear/CodeGen_PECL/PECL/Extension.php diff -u pear/CodeGen_PECL/PECL/Extension.php:1.54 pear/CodeGen_PECL/PECL/Extension.php:1.55 --- pear/CodeGen_PECL/PECL/Extension.php:1.54 Thu Aug 17 17:05:14 2006 +++ pear/CodeGen_PECL/PECL/Extension.php Fri Aug 18 14:13:03 2006 @@ -15,7 +15,7 @@ * @author Hartmut Holzgraefe <hartmut@php.net> * @copyright 2005 Hartmut Holzgraefe * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Extension.php,v 1.54 2006/08/17 17:05:14 hholzgra Exp $ + * @version CVS: $Id: Extension.php,v 1.55 2006/08/18 14:13:03 hholzgra Exp $ * @link http://pear.php.net/package/CodeGen_PECL */ @@ -570,7 +570,7 @@ $this->writeReadme(); // generate DocBook XML documantation for PHP manual - $manpath = $this->dirpath . "/manual/" . str_replace('_', '-', $this->name); + $manpath = $this->dirpath . "/manual/"; if (!@System::mkdir("-p $manpath")) { return PEAR::raiseError("can't create '$manpath'", E_USER_ERROR); } @@ -640,7 +640,66 @@ { $idName = str_replace('_', '-', $this->name); - $fp = new CodeGen_Tools_FileReplacer("$docdir/reference.xml"); + if (!@System::mkdir("-p $docdir/$idName")) { + return PEAR::raiseError("can't create '$docdir/$idName'", E_USER_ERROR); + } + + $manual = new CodeGen_Tools_FileReplacer("$docdir/manual.xml.in"); + $manual->puts("<?xml version='1.0' encoding='UTF-8' ?> +<!DOCTYPE book PUBLIC '-//OASIS//DTD DocBook XML V4.1.2//EN' + '@PHPDOC@/dtds/dbxml-4.1.2/docbookx.dtd' [ + +<!-- Add translated specific definitions and snippets --> +<!ENTITY % language-defs SYSTEM '@PHPDOC@/en/language-defs.ent'> +<!ENTITY % language-snippets SYSTEM '@PHPDOC@/en/language-snippets.ent'> + +%language-defs; +%language-snippets; + +<!-- Fallback to English definitions and snippets (in case of missing translation) --> +<!ENTITY % language-defs.default SYSTEM '@PHPDOC@/en/language-defs.ent'> +<!ENTITY % language-snippets.default SYSTEM '@PHPDOC@/en/language-snippets.ent'> +<!ENTITY % extensions.default SYSTEM '@PHPDOC@/en/extensions.ent'> + +%language-defs.default; +%language-snippets.default; +%extensions.default; + +<!-- All global entities for the XML files --> +<!ENTITY % global.entities SYSTEM '@PHPDOC@/entities/global.ent'> + +<!ENTITY % file.entities SYSTEM './file-entities.ent'> + +<!-- Include all external DTD parts defined previously --> +%global.entities; +%file.entities; + +<!-- Autogenerated missing entites and IDs to make build work --> +<!ENTITY % missing-entities SYSTEM '@PHPDOC@/entities/missing-entities.ent'> +%missing-entities; +]> + +<book id='manual' lang='en'> + &reference.cairo-wrapper.reference; +</book> +"); + $manual->close(); + + $makefile = new CodeGen_Tools_FileReplacer("$docdir/Makefile"); + $makefile->puts("# +all: +\t@if test \"x$(PHPDOC)\" = \"x\"; then echo PHPDOC not set; exit 3; fi +\trm -rf html; mkdir html +\tsed -e's:@PHPDOC@:\$(PHPDOC):g' < manual.xml.in > manual.xml +\tSP_ENCODING=XML SP_CHARSET_FIXED=YES /usr/bin/openjade -D $(PHPDOC) -wno-idref -c $(PHPDOC)/entities/ISO/catalog -c $(PHPDOC)/dsssl/docbook/catalog -c /usr/share/sgml/CATALOG.docbk41 -c /usr/share/sgml/CATALOG.jade_dsl -c $(PHPDOC)/dsssl/defaults/catalog -d dsssl/html.dsl -V use-output-dir -t sgml $(PHPDOC)/dtds/dbxml-4.1.2/phpdocxml.dcl manual.xml +"); + + $makefile->close(); + + $entities = new CodeGen_Tools_FileReplacer("$docdir/file-entities.ent"); + + $entities->puts("<!ENTITY reference.$idName.reference SYSTEM './$idName/reference.xml'>\n"); + $fp = new CodeGen_Tools_FileReplacer("$docdir/$idName/reference.xml"); $fp->puts( "<?xml version='1.0' encoding='iso-8859-1'?> <!-- ".'$'."Revision: 1.1 $ --> @@ -717,7 +776,8 @@ $fp->close(); // configure options and dependencies have their own file - $fp = new CodeGen_Tools_FileReplacer("$docdir/configure.xml"); + $entities->puts("<!ENTITY reference.$idName.configure SYSTEM './$idName/configure.xml'>\n"); + $fp = new CodeGen_Tools_FileReplacer("$docdir/$idName/configure.xml"); $fp->puts("\n <section id='$idName.requirements'>\n &reftitle.required;\n"); @@ -758,7 +818,7 @@ $fp->puts(" <para>\n".rtrim($with->summary)."\n </para>\n"); } } else { - // TODO default text + $fp->puts(" <para>Requires <literal>".$with->getName()."</literal></para>\n"); } } } @@ -779,14 +839,33 @@ $fp->puts($this->docEditorSettings()); $fp->close(); - @mkdir("$docdir/functions"); + + $function_entities = array(); + @mkdir("$docdir/$idName/functions"); foreach ($this->functions as $name => $function) { - $filename = $docdir . "/functions/" . strtolower(str_replace("_", "-", $name)) . ".xml"; - $funcfile = new CodeGen_Tools_FileReplacer($filename); + $functionId = strtolower(str_replace("_", "-", $name)); + $filepath = "$idName/functions/$functionId.xml"; + + $entity = "reference.$idName.functions.$functionId"; + $function_entities[] = $entity; + $entities->puts("<!ENTITY $entity SYSTEM './$filepath'>\n"); + + $funcfile = new CodeGen_Tools_FileReplacer("$docdir$filepath"); $funcfile->puts($function->docEntry($idName)); $funcfile->puts($this->docEditorSettings(4)); $funcfile->close(); } + + + $entities->puts("<!ENTITY reference.$idName.functions SYSTEM './functions.xml'>\n"); + $entities->close(); + + sort($function_entities); + foreach ($function_entities as $entity) { + $functionsXml = new CodeGen_Tools_FileReplacer($docdir."/functions.xml"); + $functionsXml->puts("&$entity;\n"); + $functionsXml->close(); + } } // }}} http://cvs.php.net/viewvc.cgi/pear/CodeGen_PECL/PECL/ExtensionParser.php?r1=1.48&r2=1.49&diff_format=u Index: pear/CodeGen_PECL/PECL/ExtensionParser.php diff -u pear/CodeGen_PECL/PECL/ExtensionParser.php:1.48 pear/CodeGen_PECL/PECL/ExtensionParser.php:1.49 --- pear/CodeGen_PECL/PECL/ExtensionParser.php:1.48 Thu Aug 17 17:05:14 2006 +++ pear/CodeGen_PECL/PECL/ExtensionParser.php Fri Aug 18 14:13:03 2006 @@ -15,7 +15,7 @@ * @author Hartmut Holzgraefe <hartmut@php.net> * @copyright 2005 Hartmut Holzgraefe * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: ExtensionParser.php,v 1.48 2006/08/17 17:05:14 hholzgra Exp $ + * @version CVS: $Id: ExtensionParser.php,v 1.49 2006/08/18 14:13:03 hholzgra Exp $ * @link http://pear.php.net/package/CodeGen */ @@ -708,7 +708,6 @@ $this->helper->addLib($lib); } - function tagend_deps_with($attr, $data) { $this->helper->setSummary($data);