svn: /phd/trunk/ package.xml phpdotnet/phd/Config.php phpdotnet/phd/Options/Handler.php
| From: | Richard Quadling | Date: | Thu, 03 Feb 2011 17:36:30 +0000 |
| Subject: | svn: /phd/trunk/ package.xml phpdotnet/phd/Config.php phpdotnet/phd/Options/Handler.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-7706@lists.php.net to get a copy of this message | ||
rquadling Thu, 03 Feb 2011 17:36:30 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=307980
Log:
Do not disable color configuration settings when loading from phd.config.php on Windows when saved
setting is enabled.
Changed paths:
U phd/trunk/package.xml
U phd/trunk/phpdotnet/phd/Config.php
U phd/trunk/phpdotnet/phd/Options/Handler.php
Modified: phd/trunk/package.xml
===================================================================
--- phd/trunk/package.xml 2011-02-03 17:21:14 UTC (rev 307979)
+++ phd/trunk/package.xml 2011-02-03 17:36:30 UTC (rev 307980)
@@ -66,6 +66,7 @@
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD
Style</license>
<notes>
Added support for package cli options (Moacir)
+ Do not disable color configuration settings when loading from phd.config.php on Windows when
saved setting is enabled (Richard Quadling)
</notes>
<contents>
Modified: phd/trunk/phpdotnet/phd/Config.php
===================================================================
--- phd/trunk/phpdotnet/phd/Config.php 2011-02-03 17:21:14 UTC (rev 307979)
+++ phd/trunk/phpdotnet/phd/Config.php 2011-02-03 17:36:30 UTC (rev 307980)
@@ -10,7 +10,7 @@
{
const VERSION = 'phd-from-svn';
- private static $optionArray = array(
+ private static $optionArrayDefault = array(
'output_format' => array(),
'chunk_extra' => array(
'legalnotice' => true,
@@ -52,7 +52,23 @@
'saveconfig' => false,
);
+ private static $optionArray = null;
+
public static function init(array $a) {
+ // Override any defaults due to operating system constraints
+ // and copy defaults to working optionArray
+ if (is_null(self::$optionArray)) {
+
+ // By default, Windows does not support colors on the console.
+ // ANSICON by Jason Hood can be used to provide colors at the console.
+ // Color output can still be enabled via the command line parameters --color
+ if('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
+ self::$optionArrayDefault['color_output'] = false;
+ }
+
+ self::$optionArray = self::$optionArrayDefault;
+ }
+
// add the include-path to the package dirs
$include_path = explode(PATH_SEPARATOR, get_include_path());
foreach ($include_path as $dir) {
Modified: phd/trunk/phpdotnet/phd/Options/Handler.php
===================================================================
--- phd/trunk/phpdotnet/phd/Options/Handler.php 2011-02-03 17:21:14 UTC (rev 307979)
+++ phd/trunk/phpdotnet/phd/Options/Handler.php 2011-02-03 17:36:30 UTC (rev 307980)
@@ -4,16 +4,6 @@
class Options_Handler implements Options_Interface
{
- public function __construct()
- {
- // By default, Windows does not support colors on the console.
- // ANSICON by Jason Hood can be used to provide colors at the console.
- // Color output can still be set via the command line parameters.
- if('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
- $this->option_color('color', 'off');
- }
- }
-
public function optionList()
{
return array(
@@ -373,7 +363,7 @@
theme). (default: en)
-c <bool>
--color <bool> Enable color output when output is to a terminal
- (default: true; On Windows the default is false)
+ (default: " . (Config::color_output() ? 'true' :
'false') . ")
-C <filename>
--css <filename> Link for an external CSS file.
-g <classname>