svn: /phd/trunk/ package.xml phpdotnet/phd/BuildOptionsParser.php phpdotnet/phd/Config.php render.php
| From: | Hannes Magnusson | Date: | Tue, 05 Jan 2010 13:23:02 +0000 |
| Subject: | svn: /phd/trunk/ package.xml phpdotnet/phd/BuildOptionsParser.php phpdotnet/phd/Config.php render.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-5758@lists.php.net to get a copy of this message | ||
bjori Tue, 05 Jan 2010 13:23:02 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=293147
Log:
Fixed bug#50668 (add xinclude processing in phd) (Shahar Evron)
Bug: http://bugs.php.net/50668 (Open) Feature Request: add
xinclude processing in phd
Changed paths:
U phd/trunk/package.xml
U phd/trunk/phpdotnet/phd/BuildOptionsParser.php
U phd/trunk/phpdotnet/phd/Config.php
U phd/trunk/render.php
Modified: phd/trunk/package.xml
===================================================================
--- phd/trunk/package.xml 2010-01-05 13:03:40 UTC (rev 293146)
+++ phd/trunk/package.xml 2010-01-05 13:23:02 UTC (rev 293147)
@@ -59,6 +59,7 @@
</stability>
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD
Style</license>
<notes>
+ - Implemented FR#50668 - add xinclude processing in phd (Shahar Evron)
- Fixed bug#45098 - named constants require long opt. (Hannes)
</notes>
Modified: phd/trunk/phpdotnet/phd/BuildOptionsParser.php
===================================================================
--- phd/trunk/phpdotnet/phd/BuildOptionsParser.php 2010-01-05 13:03:40 UTC (rev 293146)
+++ phd/trunk/phpdotnet/phd/BuildOptionsParser.php 2010-01-05 13:23:02 UTC (rev 293147)
@@ -23,6 +23,7 @@
'help' => 'h', // Print out help
'package:' => 'P:', // The package of formats
'css:' => 'C:', // External CSS
+ 'xinclude' => 'x', // Automatically process xinclude
directives
);
}
@@ -250,6 +251,15 @@
Config::set_css($styles);
}
+ public function option_x($k, $v)
+ {
+ $this->option_xinclude($k, 'true');
+ }
+ public function option_xinclude($k, $v)
+ {
+ Config::set_process_xincludes(true);
+ }
+
/**
* Prints out the current PhD and PHP version.
* Exits directly.
@@ -288,6 +298,9 @@
(default: false)
-d <filename>
--docbook <filename> The Docbook file to render from
+ -x
+ --xinclude Process XML Inclusions (XInclude)
+ (default: false)
-p <id[=bool]>
--partial <id[=bool]> The ID to render, optionally skipping its children
chunks (default to true; render children)
Modified: phd/trunk/phpdotnet/phd/Config.php
===================================================================
--- phd/trunk/phpdotnet/phd/Config.php 2010-01-05 13:03:40 UTC (rev 293146)
+++ phd/trunk/phpdotnet/phd/Config.php 2010-01-05 13:23:02 UTC (rev 293147)
@@ -40,6 +40,7 @@
'Generic',
),
'css' => array(),
+ 'process_xincludes' => false,
);
public static function init(array $a) {
Modified: phd/trunk/render.php
===================================================================
--- phd/trunk/render.php 2010-01-05 13:03:40 UTC (rev 293146)
+++ phd/trunk/render.php 2010-01-05 13:23:02 UTC (rev 293147)
@@ -38,13 +38,19 @@
$render = new Render();
$reader = new Reader();
+// Set reader LIBXML options
+$readerOpts = 0;
+if (Config::process_xincludes()) {
+ $readerOpts |= LIBXML_XINCLUDE;
+}
+
// Indexing
if (Index::requireIndexing()) {
v("Indexing...", VERBOSE_INDEXING);
// Create indexer
$format = $render->attach(new Index);
- $reader->open(Config::xml_file());
+ $reader->open(Config::xml_file(), NULL, $readerOpts);
$render->execute($reader);
$render->detach($format);
@@ -78,7 +84,7 @@
}
// Render formats
-$reader->open(Config::xml_file());
+$reader->open(Config::xml_file(), NULL, $readerOpts);
foreach($render as $format) {
$format->notify(Render::VERBOSE, true);
}