cvs: phd(PHD_ENTERPRISE) /include PhDBuildOptions.class.php
| From: | Moacir de Oliveira Miranda Júnior | Date: | Thu, 28 May 2009 19:37:39 +0000 |
| Subject: | cvs: phd(PHD_ENTERPRISE) /include PhDBuildOptions.class.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4080@lists.php.net to get a copy of this message | ||
moacir Thu May 28 19:37:39 2009 UTC
Modified files: (Branch: PHD_ENTERPRISE)
/phd/include PhDBuildOptions.class.php
Log:
Option --package added
http://cvs.php.net/viewvc.cgi/phd/include/PhDBuildOptions.class.php?r1=1.6.2.4&r2=1.6.2.5&diff_format=u
Index: phd/include/PhDBuildOptions.class.php
diff -u phd/include/PhDBuildOptions.class.php:1.6.2.4 phd/include/PhDBuildOptions.class.php:1.6.2.5
--- phd/include/PhDBuildOptions.class.php:1.6.2.4 Fri Aug 1 11:02:04 2008
+++ phd/include/PhDBuildOptions.class.php Thu May 28 19:37:39 2009
@@ -1,5 +1,5 @@
<?php
-/* $Id: PhDBuildOptions.class.php,v 1.6.2.4 2008/08/01 11:02:04 loudi Exp $ */
+/* $Id: PhDBuildOptions.class.php,v 1.6.2.5 2009/05/28 19:37:39 moacir Exp $ */
class PhDBuildOptionsParser extends PhDOptionParser
{
@@ -20,6 +20,7 @@
"color:" => "c:", // Use color output if possible
"version" => "V", // Print out version information
"help" => "h", // Print out help
+ "package:" => "P:", // The package of formats
);
}
@@ -99,6 +100,9 @@
public function option_p($k, $v)
{
+ if ($k == "P") {
+ return $this->option_package($k, $v);
+ }
$this->option_partial($k, $v);
}
public function option_partial($k, $v)
@@ -119,6 +123,25 @@
PhDConfig::set_render_ids($render_ids);
}
+ public function option_package($k, $v) {
+ static $packageList = NULL;
+
+ if (is_null($packageList)) {
+ $packageList = array();
+ foreach (glob($GLOBALS['ROOT'] . "/packages/*") as $item) {
+ if (is_dir($item) && !($item == "." || $item == ".."))
{
+ $packageList[] = basename($item);
+ }
+ }
+ }
+
+ if (in_array($v, $packageList)) {
+ PhDConfig::set_package($v);
+ } else {
+ trigger_error("Invalid Package", E_USER_ERROR);
+ }
+ }
+
public function option_s($k, $v)
{
$this->option_skip($k, $v);
@@ -193,7 +216,7 @@
echo "Supported formats:\n";
echo "\t" . implode("\n\t", $formatList) . "\n";
- break;
+ //break;
exit(0);
}