From: Gunnar Wrobel
Date: Mon, 5 Jul 2010 03:44:04 +0000 (+0200)
Subject: Make the package.xml handling functional again. Integrate all patches the action...
X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8df71e31a323f8862d90eac58556c93f95d722e6;p=horde.git
Make the package.xml handling functional again. Integrate all patches the action has seen.
---
diff --git a/framework/Qc/lib/Horde/Qc.php b/framework/Qc/lib/Horde/Qc.php
index 50c799419..eedf26fd7 100644
--- a/framework/Qc/lib/Horde/Qc.php
+++ b/framework/Qc/lib/Horde/Qc.php
@@ -46,14 +46,13 @@ class Horde_Qc
$modules = self::_prepareModules();
$config->handleModules($modules);
try {
- self::_validateArguments($config->getArguments());
+ self::_validateArguments($config);
} catch (Horde_Qc_Exception $e) {
$parser->parserError($e->getMessage());
return;
}
- $options = $config->getOptions();
foreach ($modules as $module) {
- $module->handle($options);
+ $module->handle($config);
}
}
@@ -89,8 +88,9 @@ class Horde_Qc
return $modules;
}
- static private function _validateArguments(array $arguments)
+ static private function _validateArguments(Horde_Qc_Config $config)
{
+ $arguments = $config->getArguments();
if (empty($arguments[0])) {
throw new Horde_Qc_Exception('Please specify the path of the PEAR package!');
}
diff --git a/framework/Qc/lib/Horde/Qc/Module.php b/framework/Qc/lib/Horde/Qc/Module.php
index 14beed8bb..ac7886ec0 100644
--- a/framework/Qc/lib/Horde/Qc/Module.php
+++ b/framework/Qc/lib/Horde/Qc/Module.php
@@ -33,7 +33,7 @@ interface Horde_Qc_Module
public function getOptionGroupOptions();
- public function handle(array $config);
+ public function handle(Horde_Qc_Config $config);
- public function run();
+ public function run(Horde_Qc_Config $config);
}
\ No newline at end of file
diff --git a/framework/Qc/lib/Horde/Qc/Module/PearPackageXml.php b/framework/Qc/lib/Horde/Qc/Module/PearPackageXml.php
index ea7d5a758..bd8eacb0b 100644
--- a/framework/Qc/lib/Horde/Qc/Module/PearPackageXml.php
+++ b/framework/Qc/lib/Horde/Qc/Module/PearPackageXml.php
@@ -61,82 +61,93 @@ implements Horde_Qc_Module
);
}
- public function handle(array $config)
+ public function handle(Horde_Qc_Config $config)
{
+ $options = $config->getOptions();
+ if (!empty($options['packagexml']) ||
+ !empty($options['updatexml'])) {
+ $this->run($config);
+ }
}
- public function run()
+ public function run(Horde_Qc_Config $config)
{
-
-PEAR::setErrorHandling(PEAR_ERROR_DIE);
-
-
- $package_file = $package_path . '/package.xml';
-
-if (!file_exists($package_file)) {
- print sprintf("There is no package.xml at %s!\n", $package_path);
- exit(1);
-}
-
-$package = PEAR_PackageFileManager2::importOptions(
- $package_file,
- array(
- 'packagedirectory' => $package_path,
- 'filelistgenerator' => 'file',
- 'clearcontents' => false,
- 'clearchangelog' => false,
- 'simpleoutput' => true,
- 'include' => '*',
- 'dir_roles' =>
- array(
- 'lib' => 'php',
- 'doc' => 'doc',
- 'example' => 'doc',
- 'script' => 'script',
- 'test' => 'test',
- ),
- )
-);
-
-$package->generateContents();
-
-/**
- * This is required to clear the