From 135660463335cabaf8f5ddbeb89df6fa5fab502c Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Wed, 30 Jun 2010 10:33:30 +0200 Subject: [PATCH] Cleanup first draft. --- framework/Qc/lib/Horde/Qc/Autoloader.php | 22 +++++++++++++++++ framework/Qc/lib/Horde/Qc/Config/Cli.php | 18 +++++--------- framework/Qc/lib/Horde/Qc/Config/Interface.php | 33 -------------------------- framework/Qc/package.xml | 2 ++ framework/Qc/script/horde-quality-control.php | 2 +- 5 files changed, 31 insertions(+), 46 deletions(-) create mode 100644 framework/Qc/lib/Horde/Qc/Autoloader.php delete mode 100644 framework/Qc/lib/Horde/Qc/Config/Interface.php diff --git a/framework/Qc/lib/Horde/Qc/Autoloader.php b/framework/Qc/lib/Horde/Qc/Autoloader.php new file mode 100644 index 000000000..e91dad399 --- /dev/null +++ b/framework/Qc/lib/Horde/Qc/Autoloader.php @@ -0,0 +1,22 @@ +addClassPathMapper(new Horde_Autoloader_ClassPathMapper_Default($path)); + } + } + } +} + +$__autoloader = new Horde_Qc_Autoloader(); +$__autoloader->registerAutoloader(); diff --git a/framework/Qc/lib/Horde/Qc/Config/Cli.php b/framework/Qc/lib/Horde/Qc/Config/Cli.php index 66f0ad998..3e4c72314 100644 --- a/framework/Qc/lib/Horde/Qc/Config/Cli.php +++ b/framework/Qc/lib/Horde/Qc/Config/Cli.php @@ -29,11 +29,7 @@ erver */ class Horde_Qc_Config_Cli -implements Horde_Qc_Config_Interface { - - private $_parser; - private $_opts; private $_args; @@ -45,18 +41,16 @@ implements Horde_Qc_Config_Interface */ public function __construct(Horde_Qc_Modules $modules) { - $options = array(); - - foreach ($modules as $module) { - $options = array_merge($options, $module->getOptions()); - } - - $this->_parser = new Horde_Argv_Parser( + $parser = new Horde_Argv_Parser( array( - 'optionList' => array_values($options), 'usage' => '%prog ' . _("[options] PACKAGE_PATH") ) ); + + foreach ($modules as $module) { + $parser->addOptionGroup($module->getOptions()); + } + list($this->_opts, $this->_args) = $parser->parseArgs(); } } diff --git a/framework/Qc/lib/Horde/Qc/Config/Interface.php b/framework/Qc/lib/Horde/Qc/Config/Interface.php deleted file mode 100644 index bf0bfeb67..000000000 --- a/framework/Qc/lib/Horde/Qc/Config/Interface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Qc - */ - -/** - * Horde_Qc_Config_Interface:: represents configuration for the Horde quality - * control tool. - * - * Copyright 2010 The Horde Project (http://www.horde.org/) - * - * See the enclosed file COPYING for license information (LGPL). If you - * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. - * - * @category Horde - * @package Qc - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Qc -erver - */ -interface Horde_Qc_Config_Interface -{ -} \ No newline at end of file diff --git a/framework/Qc/package.xml b/framework/Qc/package.xml index 3f99a8dac..4d41851ab 100644 --- a/framework/Qc/package.xml +++ b/framework/Qc/package.xml @@ -43,6 +43,7 @@ + @@ -82,6 +83,7 @@ + diff --git a/framework/Qc/script/horde-quality-control.php b/framework/Qc/script/horde-quality-control.php index afa8f199c..64ac2b72d 100755 --- a/framework/Qc/script/horde-quality-control.php +++ b/framework/Qc/script/horde-quality-control.php @@ -1,4 +1,4 @@ #!/usr/bin/env php