cvs: phd(PHD_ENTERPRISE) /include PhDBuildOptions.class.php

From: Date: Wed, 03 Jun 2009 17:48:26 +0000
Subject: cvs: phd(PHD_ENTERPRISE) /include PhDBuildOptions.class.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4106@lists.php.net to get a copy of this message
moacir Wed Jun 3 17:48:26 2009 UTC Modified files: (Branch: PHD_ENTERPRISE) /phd/include PhDBuildOptions.class.php Log: Added Listing Packages http://cvs.php.net/viewvc.cgi/phd/include/PhDBuildOptions.class.php?r1=1.6.2.5&r2=1.6.2.6&diff_format=u Index: phd/include/PhDBuildOptions.class.php diff -u phd/include/PhDBuildOptions.class.php:1.6.2.5 phd/include/PhDBuildOptions.class.php:1.6.2.6 --- phd/include/PhDBuildOptions.class.php:1.6.2.5 Thu May 28 19:37:39 2009 +++ phd/include/PhDBuildOptions.class.php Wed Jun 3 17:48:26 2009 @@ -1,5 +1,5 @@ <?php -/* $Id: PhDBuildOptions.class.php,v 1.6.2.5 2009/05/28 19:37:39 moacir Exp $ */ +/* $Id: PhDBuildOptions.class.php,v 1.6.2.6 2009/06/03 17:48:26 moacir Exp $ */ class PhDBuildOptionsParser extends PhDOptionParser { @@ -128,8 +128,8 @@ if (is_null($packageList)) { $packageList = array(); - foreach (glob($GLOBALS['ROOT'] . "/packages/*") as $item) { - if (is_dir($item) && !($item == "." || $item == "..")) { + foreach (glob($GLOBALS['ROOT'] . "/packages/*", GLOB_ONLYDIR) as $item) { + if (!in_array(basename($item), array('CVS', '.', '..'))) { $packageList[] = basename($item); } } @@ -205,18 +205,27 @@ } public function option_list($k, $v) { - static $formatList = NULL; + static $packageList = NULL; - if (is_null($formatList)) { - $formatList = array(); - foreach (glob($GLOBALS['ROOT'] . "/formats/*.php") as $item) { - $formatList[] = substr(basename($item), 0, -4); + if (is_null($packageList)) { + $packageList = array(); + foreach (glob($GLOBALS['ROOT'] . "/packages/*", GLOB_ONLYDIR) as $item) { + if (!in_array(basename($item), array('CVS', '.', '..'))) { + $formats = array(); + foreach (glob($item . "/*.php") as $subitem) { + if (substr(basename($subitem), -17) != "Factory.class.php") { + $formats[] = substr(basename($subitem), 0, -4); + } + } + $packageList[basename($item)] = $formats; + } } } - echo "Supported formats:\n"; - echo "\t" . implode("\n\t", $formatList) . "\n"; - //break; + echo "Supported packages:\n"; + foreach ($packageList as $package => $formats) { + echo "\t" . $package . "\n\t\t" . implode("\n\t\t", $formats) . "\n"; + } exit(0); }

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