cvs: phpdoc /scripts/docgen configure.tpl docgen.php
| From: | Philip Olson | Date: | Mon, 02 Mar 2009 19:14:50 +0000 |
| Subject: | cvs: phpdoc /scripts/docgen configure.tpl docgen.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3371@lists.php.net to get a copy of this message | ||
philip Mon Mar 2 19:14:50 2009 UTC
Modified files:
/phpdoc/scripts/docgen docgen.php configure.tpl
Log:
Added --pecl that when enabled will alter configure.xml and versions.xml accordingly
Also improved configure.xml
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/docgen/docgen.php?r1=1.20&r2=1.21&diff_format=u
Index: phpdoc/scripts/docgen/docgen.php
diff -u phpdoc/scripts/docgen/docgen.php:1.20 phpdoc/scripts/docgen/docgen.php:1.21
--- phpdoc/scripts/docgen/docgen.php:1.20 Thu Feb 12 01:38:30 2009
+++ phpdoc/scripts/docgen/docgen.php Mon Mar 2 19:14:50 2009
@@ -16,7 +16,7 @@
| Authors: Felipe Pena <felipe@php.net> |
+----------------------------------------------------------------------+
- $Id: docgen.php,v 1.20 2009/02/12 01:38:30 philip Exp $
+ $Id: docgen.php,v 1.21 2009/03/02 19:14:50 philip Exp $
*/
if (!(extension_loaded('reflection') & extension_loaded('pcre'))) {
@@ -72,6 +72,7 @@
-h,--help -- show this help
-m,--method -- method name (require -c)
-o,--output -- output dir
+ -p,--pecl -- is a PECL extension
-q,--quiet -- quiet mode
-v,--version -- show the version
-V,--verbose -- disable show progress
@@ -471,7 +472,7 @@
/* }}} */
function gen_extension_markup(ReflectionExtension $obj, $content, $xml_file) { /* {{{ */
- global $INFO;
+ global $INFO, $OPTION;
switch ($xml_file) {
case 'ini.xml':
@@ -543,13 +544,53 @@
}
break;
+ case 'configure.xml':
+
+ $ident = get_ident_size('EXT_INSTALL_MAIN', $content);
+ $ident2 = get_ident_size('EXT_INSTALL_WIN', $content);
+
+ $markup = '';
+ $markup2 = '';
+ if ($OPTION['pecl'] === true) {
+
+ $markup .= "<para>\n";
+ $markup .= str_repeat(' ', $ident + 1) ."&pecl.info;\n";
+ $markup .= str_repeat(' ', $ident + 1) ."<link
xlink:href=\"&url.pecl.package;{EXT_NAME_ID}\">&url.pecl.package;{EXT_NAME_ID}</link>\n";
+ $markup .= str_repeat(' ', $ident) . "</para>\n";
+
+ $markup2 .= "<para>\n";
+ $markup2 .= str_repeat(' ', $ident2 + 1) ."The latest PECL/{EXT_NAME_ID} Win32
DLL is available here:\n";
+ $markup2 .= str_repeat(' ', $ident2 + 1) ."<link
xlink:href=\"&url.pecl.win.ext;php_{EXT_NAME_ID}.dll\">php_{EXT_NAME_ID}.dll</link>\n";
+ $markup2 .= str_repeat(' ', $ident2) ."</para>\n";
+ } else {
+
+ $markup .= "<para>\n";
+ $markup .= str_repeat(' ', $ident + 1) ."Use <option
role=\"configure\">--with-{EXT_NAME_ID}[=DIR]</option> when compiling
PHP.\n";
+ $markup .= str_repeat(' ', $ident) ."</para>\n";
+
+ $markup2 .= "<para>\n";
+ $markup2 .= str_repeat(' ', $ident2 + 1) ."Windows users should include
<filename>php_{EXT_NAME_ID}.dll</filename> into &php.ini;\n";
+ $markup2 .= str_repeat(' ', $ident2) ."</para>\n";
+ }
+
+ $content = str_replace('{EXT_INSTALL_MAIN}', $markup, $content);
+ $content = str_replace('{EXT_INSTALL_WIN}', $markup2, $content);
+
+ break;
+
case 'versions.xml':
+
+ $version_default = 'PHP 5 >= Unknown';
+ if ($OPTION['pecl'] === true) {
+ $version_default = 'PECL {EXT_NAME_ID} >= Unknown';
+ }
+
$markup = "";
/* Function list */
if ($functions = $obj->getFunctions()) {
$markup .= "<!-- Functions -->\n";
foreach ($functions as $function) {
- $markup .= " <function name='". strtolower($function->getName())
."' from='Unknown'/>\n";
+ $markup .= " <function name='". strtolower($function->getName())
."' from='$version_default'/>\n";
}
}
/* Method list */
@@ -557,7 +598,7 @@
$markup .= " <!-- Methods -->\n";
foreach ($classes as $class) {
foreach ($class->getMethods() as $method) {
- $markup .= " <function name='". strtolower($class->name .'::'.
$method->getName()) ."' from='PHP 5 >= 5.2.0'/>\n";
+ $markup .= " <function name='". strtolower($class->name .'::'.
$method->getName()) ."' from='$version_default'/>\n";
}
}
}
@@ -736,12 +777,14 @@
$OPTION['output'] = getcwd();
$OPTION['verbose'] = true;
$OPTION['quiet'] = false;
+$OPTION['pecl'] = false;
$arropts = array(
'verbose' => 'v', /* version */
'version' => 'V', /* verbose */
'quiet' => 'q', /* quiet */
'help' => 'h', /* help */
+ 'pecl' => 'p', /* pecl */
'output:' => 'o:', /* output dir */
'class:' => 'c:', /* classname */
'extension:' => 'e:', /* extension */
@@ -760,7 +803,7 @@
switch ($opt) {
case 'v':
case 'version':
- printf("%s\n", '$Revision: 1.20 $');
+ printf("%s\n", '$Revision: 1.21 $');
break;
case 'V':
case 'verbose':
@@ -800,6 +843,10 @@
}
$OPTION['output'] = $value;
break;
+ case 'p':
+ case 'pecl':
+ $OPTION['pecl'] = true;
+ break;
case 'q':
case 'quiet':
$OPTION['quiet'] = true;
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/docgen/configure.tpl?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/scripts/docgen/configure.tpl
diff -u phpdoc/scripts/docgen/configure.tpl:1.1 phpdoc/scripts/docgen/configure.tpl:1.2
--- phpdoc/scripts/docgen/configure.tpl:1.1 Wed May 28 01:14:24 2008
+++ phpdoc/scripts/docgen/configure.tpl Mon Mar 2 19:14:50 2009
@@ -1,15 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<section xml:id="{EXT_NAME_ID}.installation" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.install;
- <!-- There are various PECL related entities in language-snippets.ent -->
- <para>
- To enable {EXT_NAME} support, configure PHP with ...
- </para>
- <para>
- Windows users ...
- </para>
+
+ {EXT_INSTALL_MAIN}
+ {EXT_INSTALL_WIN}
</section>