svn: /phd/trunk/ package.xml phpdotnet/phd/Config.php phpdotnet/phd/Options/Handler.php render.php
| From: | Richard Quadling | Date: | Wed, 16 Mar 2011 12:38:23 +0000 |
| Subject: | svn: /phd/trunk/ package.xml phpdotnet/phd/Config.php phpdotnet/phd/Options/Handler.php render.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-7861@lists.php.net to get a copy of this message | ||
rquadling Wed, 16 Mar 2011 12:38:23 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=309302
Log:
Added --quit option to quit after processing command line params. Useful when used with --saveconfig
to just save the config.
Changed paths:
U phd/trunk/package.xml
U phd/trunk/phpdotnet/phd/Config.php
U phd/trunk/phpdotnet/phd/Options/Handler.php
U phd/trunk/render.php
Modified: phd/trunk/package.xml
===================================================================
--- phd/trunk/package.xml 2011-03-16 11:51:56 UTC (rev 309301)
+++ phd/trunk/package.xml 2011-03-16 12:38:23 UTC (rev 309302)
@@ -53,6 +53,12 @@
<email>loudi@php.net</email>
<active>no</active>
</developer>
+ <developer>
+ <name>Richard Quadling</name>
+ <user>rquadling</user>
+ <email>rquadling@php.net</email>
+ <active>yes</active>
+ </developer>
<date>2011-03-07</date>
<version>
@@ -65,7 +71,7 @@
</stability>
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD
Style</license>
<notes>
- - notes
+ - Added --quit option to quit after processing command line params. Useful when used with
--saveconfig to just save the config (Richard Quadling)
</notes>
<contents>
Modified: phd/trunk/phpdotnet/phd/Config.php
===================================================================
--- phd/trunk/phpdotnet/phd/Config.php 2011-03-16 11:51:56 UTC (rev 309301)
+++ phd/trunk/phpdotnet/phd/Config.php 2011-03-16 12:38:23 UTC (rev 309302)
@@ -50,6 +50,7 @@
'ext' => null,
'package_dirs' => array(__INSTALLDIR__),
'saveconfig' => false,
+ 'quit' => false,
);
private static $optionArray = null;
@@ -87,6 +88,9 @@
// command line without them being automatically saved.
self::$optionArray['saveconfig'] = false;
+ // As well as the quit option.
+ self::$optionArray['quit'] = false;
+
// Set the error reporting level to the restored level.
error_reporting($GLOBALS['olderrrep'] |
self::$optionArray['verbose']);
}
Modified: phd/trunk/phpdotnet/phd/Options/Handler.php
===================================================================
--- phd/trunk/phpdotnet/phd/Options/Handler.php 2011-03-16 11:51:56 UTC (rev 309301)
+++ phd/trunk/phpdotnet/phd/Options/Handler.php 2011-03-16 12:38:23 UTC (rev 309302)
@@ -15,7 +15,7 @@
'output:' => 'o:', // The output directory
'partial:' => 'p:', // The ID to render (optionally
ignoring its children)
'skip:' => 's:', // The ID to skip (optionally
skipping its children too)
- 'verbose:' => 'v::', // Adjust the verbosity level
+ 'verbose:' => 'v::', // Adjust the verbosity level
'list' => 'l', // List supported
packages/formats
'lang::' => 'L:', // Language hint (used by the
CHM)
'color:' => 'c:', // Use color output if possible
@@ -27,6 +27,7 @@
'xinclude' => 'x', // Automatically process xinclude
directives
'ext:' => 'e:', // The file-format extension to
use, including the dot
'saveconfig::' => 'S::', // Save the generated config ?
+ 'quit' => 'Q', // Do not run the render. Use
with -S to just save the config.
);
}
@@ -168,6 +169,15 @@
Config::set_package($v);
}
+ public function option_q($k, $v)
+ {
+ $this->option_quit($k, $v);
+ }
+ public function option_quit($k, $v)
+ {
+ Config::set_quit(true);
+ }
+
public function option_s($k, $v)
{
if ($k == "S") {
@@ -341,8 +351,8 @@
--forceindex Force re-indexing under all circumstances
(default: false)
-t
- --notoc Do not rewrite TOC before rendering but load from cache
- (default: false)
+ --notoc Do not rewrite TOC before rendering but load from
+ cache (default: false)
-d <filename>
--docbook <filename> The Docbook file to render from
-x
@@ -373,11 +383,15 @@
-h
--help This help
-e <extension>
- --ext <extension> The alternative filename extension to use, including
- the dot. Use 'false' for no extension.
+ --ext <extension> The alternative filename extension to use,
+ including the dot. Use 'false' for no extension.
-S <bool>
--saveconfig <bool> Save the generated config (default: false).
+ -Q
+ --quit Don't run the build. Use with --saveconfig to
+ just save the config.
+
Most options can be passed multiple times for greater effect.
";
exit(0);
Modified: phd/trunk/render.php
===================================================================
--- phd/trunk/render.php 2011-03-16 11:51:56 UTC (rev 309301)
+++ phd/trunk/render.php 2011-03-16 12:38:23 UTC (rev 309302)
@@ -54,6 +54,10 @@
file_put_contents("phd.config.php", "<?php\nreturn " .
var_export(Config::getAllFiltered(), 1) . ";");
}
+if (Config::quit()) {
+ exit(0);
+}
+
$render = new Render();
$reader = new Reader();