Fix location of post-install script, and change class name to make the post-install...
authorJan Schneider <jan@horde.org>
Thu, 28 Oct 2010 10:34:50 +0000 (12:34 +0200)
committerJan Schneider <jan@horde.org>
Thu, 28 Oct 2010 10:34:50 +0000 (12:34 +0200)
framework/Role/Horde/Role.php [new file with mode: 0644]
framework/Role/Setconfig.php [deleted file]
framework/Role/package.xml

diff --git a/framework/Role/Horde/Role.php b/framework/Role/Horde/Role.php
new file mode 100644 (file)
index 0000000..15d968f
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/**
+ * PEAR_Installer_Role_Horde postconfig script.
+ *
+ * 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.
+ *
+ * @author    Michael Slusarz <slusarz@horde.org>
+ * @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 <slusarz@horde.org>
+ * @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 (file)
index 29364f6..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-/**
- * PEAR_Installer_Role_Horde postconfig script.
- *
- * 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.
- *
- * @author    Michael Slusarz <slusarz@horde.org>
- * @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 <slusarz@horde.org>
- * @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";
-    }
-
-}
index d04be4f..6779fae 100644 (file)
@@ -15,10 +15,10 @@ http://pear.php.net/dtd/package-2.0.xsd">
   <email>slusarz@horde.org</email>
   <active>yes</active>
  </lead>
- <date>2010-08-27</date>
+ <date>2010-10-28</date>
  <version>
-  <release>0.1.0</release>
-  <api>0.1.0</api>
+  <release>0.2.0</release>
+  <api>0.2.0</api>
  </version>
  <stability>
   <release>beta</release>
@@ -29,20 +29,22 @@ http://pear.php.net/dtd/package-2.0.xsd">
  </notes>
  <contents>
   <dir name="/">
+   <dir name="Horde">
+    <file name="Role.php" role="php">
+     <tasks:postinstallscript>
+      <tasks:paramgroup>
+       <tasks:id>first</tasks:id>
+       <tasks:param>
+        <tasks:name>horde_dir</tasks:name>
+        <tasks:prompt>Filesystem location where the Horde application is installed.</tasks:prompt>
+        <tasks:type>string</tasks:type>
+       </tasks:param>
+      </tasks:paramgroup>
+     </tasks:postinstallscript>
+    </file>
+   </dir> <!-- /Horde -->
    <file name="Horde.php" role="php" />
    <file name="Horde.xml" role="php" />
-   <file name="Setconfig.php" role="php">
-    <tasks:postinstallscript>
-     <tasks:paramgroup>
-      <tasks:id>first</tasks:id>
-      <tasks:param>
-       <tasks:name>horde_dir</tasks:name>
-       <tasks:prompt>Filesystem location where the Horde application is installed.</tasks:prompt>
-       <tasks:type>string</tasks:type>
-      </tasks:param>
-     </tasks:paramgroup>
-    </tasks:postinstallscript>
-   </file>
   </dir> <!-- / -->
  </contents>
  <dependencies>
@@ -57,6 +59,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
  </dependencies>
  <phprelease>
   <filelist>
+   <install name="Horde/Role.php" as="PEAR/Installer/Role/Horde/Role.php" />
    <install name="Horde.php" as="PEAR/Installer/Role/Horde.php" />
    <install name="Horde.xml" as="PEAR/Installer/Role/Horde.xml" />
   </filelist>