From: Jan Schneider Date: Thu, 28 Oct 2010 10:34:50 +0000 (+0200) Subject: Fix location of post-install script, and change class name to make the post-install... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0cec2e34f2a53c9ecf904f1c7773565a761ccde2;p=horde.git Fix location of post-install script, and change class name to make the post-install prompt clearer. --- diff --git a/framework/Role/Horde/Role.php b/framework/Role/Horde/Role.php new file mode 100644 index 000000000..15d968f28 --- /dev/null +++ b/framework/Role/Horde/Role.php @@ -0,0 +1,75 @@ + + * @category Horde + * @copyright 2010 The Horde Project (http://www.horde.org/) + * @license http://www.fsf.org/copyleft/gpl.html GPL + * @package Role + */ + +/** + * @author Michael Slusarz + * @category Horde + * @copyright 2010 The Horde Project (http://www.horde.org/) + * @license http://www.fsf.org/copyleft/gpl.html GPL + * @package Role + */ +class Horde_Role_postinstall +{ + /** + * PEAR config object. + * + * @var PEAR_Config + */ + protected $_config; + + /** + * Init postinstall task. + * + * @param PEAR_Config $config Config object. + * @param PEAR_PackageFile_v2 $pkg Package object. + * @param string $version Last version installed. + * + * @returns boolean Success. + */ + public function init($config, $pkg, $version) + { + $this->_config = $config; + + return true; + } + + /** + * Run task after prompt. + * + * @param array $info Parameter array. + * @param string $name Postinstall phase. + */ + public function run($info, $phase) + { + if ($phase !== 'first') { + return; + } + + if (!$this->_config->set('horde_dir', $info['horde_dir'], 'user', 'pear.horde.org')) { + print "Could not save horde_dir configuration value to PEAR config.\n"; + return; + } + + $res = $this->_config->writeConfigFile(); + if ($res instanceof PEAR_Error) { + print 'ERROR: ' . $res->getMessage() . "\n"; + exit; + } + + print "Configuration successfully saved to PEAR config.\n"; + } + +} diff --git a/framework/Role/Setconfig.php b/framework/Role/Setconfig.php deleted file mode 100644 index 29364f6ed..000000000 --- a/framework/Role/Setconfig.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @category Horde - * @copyright 2010 The Horde Project (http://www.horde.org/) - * @license http://www.fsf.org/copyleft/gpl.html GPL - * @package Role - */ - -/** - * @author Michael Slusarz - * @category Horde - * @copyright 2010 The Horde Project (http://www.horde.org/) - * @license http://www.fsf.org/copyleft/gpl.html GPL - * @package Role - */ -class Setconfig_postinstall -{ - /** - * PEAR config object. - * - * @var PEAR_Config - */ - protected $_config; - - /** - * Init postinstall task. - * - * @param PEAR_Config $config Config object. - * @param PEAR_PackageFile_v2 $pkg Package object. - * @param string $version Last version installed. - * - * @returns boolean Success. - */ - public function init($config, $pkg, $version) - { - $this->_config = $config; - - return true; - } - - /** - * Run task after prompt. - * - * @param array $info Parameter array. - * @param string $name Postinstall phase. - */ - public function run($info, $phase) - { - if ($phase !== 'first') { - return; - } - - if (!$this->_config->set('horde_dir', $info['horde_dir'], 'user', 'pear.horde.org')) { - print "Could not save horde_dir configuration value to PEAR config.\n"; - return; - } - - $res = $this->_config->writeConfigFile(); - if ($res instanceof PEAR_Error) { - print 'ERROR: ' . $res->getMessage() . "\n"; - exit; - } - - print "Configuration successfully saved to PEAR config.\n"; - } - -} diff --git a/framework/Role/package.xml b/framework/Role/package.xml index d04be4f14..6779fae83 100644 --- a/framework/Role/package.xml +++ b/framework/Role/package.xml @@ -15,10 +15,10 @@ http://pear.php.net/dtd/package-2.0.xsd"> slusarz@horde.org yes - 2010-08-27 + 2010-10-28 - 0.1.0 - 0.1.0 + 0.2.0 + 0.2.0 beta @@ -29,20 +29,22 @@ http://pear.php.net/dtd/package-2.0.xsd"> + + + + + first + + horde_dir + Filesystem location where the Horde application is installed. + string + + + + + - - - - first - - horde_dir - Filesystem location where the Horde application is installed. - string - - - - @@ -57,6 +59,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> +