cvs: pearweb / package.php package.xml pearweb.php

From: Date: Sun, 01 Oct 2006 22:31:55 +0000
Subject: cvs: pearweb / package.php package.xml pearweb.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-42337@lists.php.net to get a copy of this message
cellog Sun Oct 1 22:31:55 2006 UTC Modified files: /pearweb package.php package.xml pearweb.php Log: update package.xml in preparation for better post-install script. # this post-install script best viewed in PEAR 1.5.0a2 with the # feature I just implemented http://cvs.php.net/viewvc.cgi/pearweb/package.php?r1=1.4&r2=1.5&diff_format=u Index: pearweb/package.php diff -u pearweb/package.php:1.4 pearweb/package.php:1.5 --- pearweb/package.php:1.4 Sat Sep 30 22:24:21 2006 +++ pearweb/package.php Sun Oct 1 22:31:55 2006 @@ -9,7 +9,7 @@ 'exceptions' => array('pearweb.php' => 'php'), 'simpleoutput' => true, )); -$a->setReleaseVersion('0.2.0'); +$a->setReleaseVersion('0.3.0'); $a->setNotes('use web role, add post-install script'); $a->resetUsesrole(); $a->addUsesRole('web', 'Role_Web', 'pearified.com'); @@ -41,6 +41,12 @@ $a->addPackageDepWithChannel('required', 'Role_Web', 'pearified.com'); $script = &$a->initPostinstallScript('pearweb.php'); $script->addParamGroup( + 'askdb', + array( + $script->getParam('yesno', 'Update pearweb database?', 'yesno', 'y'), + ) + ); +$script->addParamGroup( 'init', array( $script->getParam('driver', 'Database driver', 'string', 'mysqli'), @@ -48,7 +54,20 @@ $script->getParam('password', 'Database password', 'password', 'pear'), $script->getParam('host', 'Database host', 'string', 'localhost'), $script->getParam('database', 'Database name', 'string', 'pear'), - )); + ) + ); +$script->addParamGroup( + 'askhttpd', + array( + $script->getParam('yesno', 'Update httpd.conf to add pearweb? (y/n)', 'yesno', 'y'), + ) + ); +$script->addParamGroup( + 'httpdconf', + array( + $script->getParam('path', 'Full path to httpd.conf', 'string'), + ) + ); $a->addPostinstallTask($script, 'pearweb.php'); $a->addReplacement('pearweb.php', 'pear-config', '@web-dir@', 'web_dir'); http://cvs.php.net/viewvc.cgi/pearweb/package.xml?r1=1.29&r2=1.30&diff_format=u Index: pearweb/package.xml diff -u pearweb/package.xml:1.29 pearweb/package.xml:1.30 --- pearweb/package.xml:1.29 Sat Sep 30 22:24:21 2006 +++ pearweb/package.xml Sun Oct 1 22:31:55 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<package packagerversion="1.5.0a1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> +<package packagerversion="1.5.0a2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> <name>pearweb</name> <channel>pear.php.net</channel> <summary>The source code for the PEAR website</summary> @@ -52,10 +52,10 @@ <email>dufuz@php.net</email> <active>no</active> </developer> - <date>2006-09-30</date> - <time>17:03:37</time> + <date>2006-10-01</date> + <time>17:31:08</time> <version> - <release>0.2.0</release> + <release>0.3.0</release> <api>0.1.1</api> </version> <stability> @@ -498,6 +498,15 @@ <file name="pearweb.php" role="php"> <tasks:postinstallscript> <tasks:paramgroup> + <tasks:id>askdb</tasks:id> + <tasks:param> + <tasks:name>yesno</tasks:name> + <tasks:prompt>Update pearweb database?</tasks:prompt> + <tasks:type>yesno</tasks:type> + <tasks:default>y</tasks:default> + </tasks:param> + </tasks:paramgroup> + <tasks:paramgroup> <tasks:id>init</tasks:id> <tasks:param> <tasks:name>driver</tasks:name> @@ -530,6 +539,23 @@ <tasks:default>pear</tasks:default> </tasks:param> </tasks:paramgroup> + <tasks:paramgroup> + <tasks:id>askhttpd</tasks:id> + <tasks:param> + <tasks:name>yesno</tasks:name> + <tasks:prompt>Update httpd.conf to add pearweb? (y/n)</tasks:prompt> + <tasks:type>yesno</tasks:type> + <tasks:default>y</tasks:default> + </tasks:param> + </tasks:paramgroup> + <tasks:paramgroup> + <tasks:id>httpdconf</tasks:id> + <tasks:param> + <tasks:name>path</tasks:name> + <tasks:prompt>Full path to httpd.conf</tasks:prompt> + <tasks:type>string</tasks:type> + </tasks:param> + </tasks:paramgroup> </tasks:postinstallscript> <tasks:replace from="@web-dir@" to="web_dir" type="pear-config" /> </file> @@ -683,7 +709,20 @@ <release>devel</release> <api>devel</api> </stability> - <date>2006-09-30</date> + <date>2006-10-01</date> + <license uri="http://www.php.net/license">PHP License</license> + <notes>use web role, add post-install script</notes> + </release> + <release> + <version> + <release>0.3.0</release> + <api>0.1.1</api> + </version> + <stability> + <release>devel</release> + <api>devel</api> + </stability> + <date>2006-10-01</date> <license uri="http://www.php.net/license">PHP License</license> <notes>use web role, add post-install script</notes> </release> http://cvs.php.net/viewvc.cgi/pearweb/pearweb.php?r1=1.2&r2=1.3&diff_format=u Index: pearweb/pearweb.php diff -u pearweb/pearweb.php:1.2 pearweb/pearweb.php:1.3 --- pearweb/pearweb.php:1.2 Sat Sep 30 22:24:21 2006 +++ pearweb/pearweb.php Sun Oct 1 22:31:55 2006 @@ -21,9 +21,37 @@ function run($answers, $phase) { switch ($phase) { + case 'askdb' : + if ($answers['yesno'] != 'y') { + $this->_ui->skipParamgroup('init'); + } + return true; + break; case 'init' : + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + if (PEAR::isError($err = MDB2::loadFile('Driver' . DIRECTORY_SEPARATOR . + $answers['driver']))) { + PEAR::popErrorHandling(); + $this->_ui->outputData('ERROR: Unknown MDB2 driver "' . + $answers['driver'] . '": ' . + $err->getUserInfo() . '. Be sure you have installed ' . + 'MDB2_Driver_' . $answers['driver']); + return false; + } + PEAR::popErrorHandling(); + return true; return $this->initializeDatabase($answers); break; + case 'askhttpd' : + if ($answers['yesno'] != 'y') { + $this->_ui->skipParamgroup('httpdconf'); + } + return true; + break; + case 'httpdconf' : + $this->_ui->outputData('httpdconf'); + return true; + break; } return true; } @@ -44,6 +72,7 @@ realpath('@web-dir@/sql/pearweb_mdb2schema.xml')); $c['name'] = $answers['database']; $c['create'] = 1; + $c['overwrite'] = 0; PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); $err = $a->createDatabase($c); PEAR::staticPopErrorHandling();

« previous php.pear.cvs (#42337) next »