svn: /phd/trunk/phpdotnet/phd/ BuildOptionsParser.php Config.php

From: Date: Tue, 28 Jul 2009 21:38:21 +0000
Subject: svn: /phd/trunk/phpdotnet/phd/ BuildOptionsParser.php Config.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4546@lists.php.net to get a copy of this message
bjori Tue, 28 Jul 2009 21:38:21 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=286472 Log: - Enable colors by default - Move the version constant to the Config class (and use real value) - --list/-l do not accept values - There is no such thing as $base_version - PHP 5.3 is an requirement now Changed paths: U phd/trunk/phpdotnet/phd/BuildOptionsParser.php U phd/trunk/phpdotnet/phd/Config.php Modified: phd/trunk/phpdotnet/phd/BuildOptionsParser.php =================================================================== --- phd/trunk/phpdotnet/phd/BuildOptionsParser.php 2009-07-28 21:35:15 UTC (rev 286471) +++ phd/trunk/phpdotnet/phd/BuildOptionsParser.php 2009-07-28 21:38:21 UTC (rev 286472) @@ -11,14 +11,13 @@ { return array( "format:" => "f:", // The format to render (xhtml, pdf...) - //"theme:" => "t:", // The theme to render (phpweb, bightml..) "noindex" => "I", // Re-index or load from cache "docbook:" => "d:", // The Docbook XML file to render from (.manual.xml) "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 - "list::" => "l::", // List supported packages/formats + "list" => "l", // List supported packages/formats "lang::" => "L:", // Language hint (used by the CHM) "color:" => "c:", // Use color output if possible 'highlighter:' => 'g:', // Class used as source code highlighter @@ -260,12 +259,7 @@ { $color = Config::phd_info_color(); $output = Config::phd_info_output(); - if (isset($GLOBALS['base_revision'])) { - $rev = preg_replace('/\$Re[v](?:ision)?(: ([\d.]+) ?)?\$$/e', "'\\1' == '' ? '??' : '\\2'", $GLOBALS['base_revision']); - fprintf($output, "%s\n", term_color("PhD Version: " . PHD_VERSION . " (" . $rev . ")", $color)); - } else { - fprintf($output, "%s\n", term_color("PhD Version: " . PHD_VERSION, $color)); - } + fprintf($output, "%s\n", term_color("PhD Version: " . Config::VERSION, $color)); fprintf($output, "%s\n", term_color("Copyright(c) 2007-2009 The PHP Documentation Group", $color)); exit(0); } @@ -276,7 +270,7 @@ } public function option_help($k, $v) { - echo "PhD version: " .PHD_VERSION; + echo "PhD version: " .Config::VERSION; echo "\nCopyright (c) 2007-2009 The PHP Documentation Group\n -v --verbose <int> Adjusts the verbosity level @@ -295,9 +289,8 @@ -s <id[=bool]> --skip <id[=bool]> The ID to skip, optionally skipping its children chunks (default to true; skip children) - -l <packages/formats> - --list <packages/formats> Print out the supported packages/formats - (default: both) + -l + --list Print out the supported packages and formats -o <directory> --output <directory> The output directory (default: .) -L <language> @@ -314,7 +307,7 @@ --help This help Most options can be passed multiple times for greater affect. -NOTE: Long options are only supported using PHP5.3\n"; +"; exit(0); } } @@ -352,20 +345,8 @@ } } -/* {{{ Workaround/fix for Windows prior to PHP5.3 */ -if (!function_exists('getopt')) { - //Use PEAR's PHP_Compat package - @include_once('PHP/Compat/Function/getopt.php'); -} -if (!function_exists('getopt')) { - function getopt($short, $long) { - global $argv; - printf("I'm sorry, you are running an operating system that does not support getopt()\n"); - printf("Please install PEAR's PHP_Compat package."); +/* +* vim600: sw=4 ts=4 syntax=php et +* vim<600: sw=4 ts=4 +*/ - return array(); - } -} -/* }}} */ - -?> Modified: phd/trunk/phpdotnet/phd/Config.php =================================================================== --- phd/trunk/phpdotnet/phd/Config.php 2009-07-28 21:35:15 UTC (rev 286471) +++ phd/trunk/phpdotnet/phd/Config.php 2009-07-28 21:38:21 UTC (rev 286472) @@ -2,10 +2,9 @@ namespace phpdotnet\phd; /* $Id$ */ -define("PHD_VERSION", "phd-from-cvs"); - class Config { + const VERSION = "1.0.0-dev"; private static $optionArray = array( 'output_format' => array(), 'chunk_extra' => array( @@ -23,15 +22,15 @@ ), 'skip_ids' => array( ), - 'color_output' => false, + 'color_output' => true, 'output_dir' => './output/', 'intermediate_output_dir' => '.', 'php_error_output' => NULL, - 'php_error_color' => false, + 'php_error_color' => "01;31", 'user_error_output' => NULL, - 'user_error_color' => false, + 'user_error_color' => "01;33", 'phd_info_output' => NULL, - 'phd_info_color' => false, + 'phd_info_color' => "01;32", 'highlighter' => "phpdotnet\\phd\\Highlighter", 'package' => 'Default', );

« previous php.doc.cvs (#4546) next »