X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/9a23a8c0a51b7ec38a96f525484134f3cb85dc7e..1b74bf5bac7eb20285f7020f14b26e56f33df6c8:/WEB-INF/lib/pear/PEAR/Task/Postinstallscript/rw.php diff --git a/WEB-INF/lib/pear/PEAR/Task/Postinstallscript/rw.php b/WEB-INF/lib/pear/PEAR/Task/Postinstallscript/rw.php index 8f358bf2..66296006 100644 --- a/WEB-INF/lib/pear/PEAR/Task/Postinstallscript/rw.php +++ b/WEB-INF/lib/pear/PEAR/Task/Postinstallscript/rw.php @@ -4,14 +4,13 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: rw.php 313023 2011-07-06 19:17:11Z dufuz $ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 1.4.0a10 + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a10 */ /** * Base class @@ -24,7 +23,7 @@ require_once 'PEAR/Task/Postinstallscript.php'; * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: 1.9.4 + * @version Release: 1.10.1 * @link http://pear.php.net/package/PEAR * @since Class available since Release 1.4.0a10 */ @@ -35,30 +34,31 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript * * @var PEAR_PackageFile_v2_rw */ - var $_pkg; + public $_pkg; /** * Enter description here... * - * @param PEAR_PackageFile_v2_rw $pkg - * @param PEAR_Config $config - * @param PEAR_Frontend $logger - * @param array $fileXml + * @param PEAR_PackageFile_v2_rw $pkg Package + * @param PEAR_Config $config Config + * @param PEAR_Frontend $logger Logger + * @param array $fileXml XML + * * @return PEAR_Task_Postinstallscript_rw */ - function PEAR_Task_Postinstallscript_rw(&$pkg, &$config, &$logger, $fileXml) + function __construct(&$pkg, &$config, &$logger, $fileXml) { - parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE); + parent::__construct($config, $logger, PEAR_TASK_PACKAGE); $this->_contents = $fileXml; $this->_pkg = &$pkg; $this->_params = array(); } - function validate() + public function validate() { return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents); } - function getName() + public function getName() { return 'postinstallscript'; } @@ -73,30 +73,31 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript * * Use {@link addConditionTypeGroup()} to add a containing * a tag - * @param string $id id as seen by the script - * @param array|false $params array of getParam() calls, or false for no params + * + * @param string $id id as seen by the script + * @param array|false $params array of getParam() calls, or false for no params * @param string|false $instructions */ - function addParamGroup($id, $params = false, $instructions = false) + public function addParamGroup($id, $params = false, $instructions = false) { if ($params && isset($params[0]) && !isset($params[1])) { $params = $params[0]; } $stuff = array( - $this->_pkg->getTasksNs() . ':id' => $id, + $this->_pkg->getTasksNs().':id' => $id, ); if ($instructions) { - $stuff[$this->_pkg->getTasksNs() . ':instructions'] = $instructions; + $stuff[$this->_pkg->getTasksNs().':instructions'] = $instructions; } if ($params) { - $stuff[$this->_pkg->getTasksNs() . ':param'] = $params; + $stuff[$this->_pkg->getTasksNs().':param'] = $params; } - $this->_params[$this->_pkg->getTasksNs() . ':paramgroup'][] = $stuff; + $this->_params[$this->_pkg->getTasksNs().':paramgroup'][] = $stuff; } /** - * add a complex to the post-install script with conditions + * Add a complex to the post-install script with conditions * * This inserts a with * @@ -107,63 +108,75 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript * * Use {@link addParamGroup()} to add a simple * - * @param string $id id as seen by the script - * @param string $oldgroup id of the section referenced by - * - * @param string $param name of the from the older section referenced - * by - * @param string $value value to match of the parameter - * @param string $conditiontype one of '=', '!=', 'preg_match' - * @param array|false $params array of getParam() calls, or false for no params + * @param string $id id as seen by the script + * @param string $oldgroup id of the section referenced by + * + * @param string $param name of the from the older section referenced + * by + * @param string $value value to match of the parameter + * @param string $conditiontype one of '=', '!=', 'preg_match' + * @param array|false $params array of getParam() calls, or false for no params * @param string|false $instructions */ - function addConditionTypeGroup($id, $oldgroup, $param, $value, $conditiontype = '=', - $params = false, $instructions = false) - { + public function addConditionTypeGroup($id, + $oldgroup, + $param, + $value, + $conditiontype = '=', + $params = false, + $instructions = false + ) { if ($params && isset($params[0]) && !isset($params[1])) { $params = $params[0]; } $stuff = array( - $this->_pkg->getTasksNs() . ':id' => $id, + $this->_pkg->getTasksNs().':id' => $id, ); if ($instructions) { - $stuff[$this->_pkg->getTasksNs() . ':instructions'] = $instructions; + $stuff[$this->_pkg->getTasksNs().':instructions'] = $instructions; } - $stuff[$this->_pkg->getTasksNs() . ':name'] = $oldgroup . '::' . $param; - $stuff[$this->_pkg->getTasksNs() . ':conditiontype'] = $conditiontype; - $stuff[$this->_pkg->getTasksNs() . ':value'] = $value; + $stuff[$this->_pkg->getTasksNs().':name'] = $oldgroup.'::'.$param; + $stuff[$this->_pkg->getTasksNs().':conditiontype'] = $conditiontype; + $stuff[$this->_pkg->getTasksNs().':value'] = $value; if ($params) { - $stuff[$this->_pkg->getTasksNs() . ':param'] = $params; + $stuff[$this->_pkg->getTasksNs().':param'] = $params; } - $this->_params[$this->_pkg->getTasksNs() . ':paramgroup'][] = $stuff; + $this->_params[$this->_pkg->getTasksNs().':paramgroup'][] = $stuff; } - function getXml() + public function getXml() { return $this->_params; } /** * Use to set up a param tag for use in creating a paramgroup - * @static + * + * @param mixed $name Name of parameter + * @param mixed $prompt Prompt + * @param string $type Type, defaults to 'string' + * @param mixed $default Default value + * + * @return array */ - function getParam($name, $prompt, $type = 'string', $default = null) - { + public static function getParam( + $name, $prompt, $type = 'string', $default = null + ) { if ($default !== null) { return array( - $this->_pkg->getTasksNs() . ':name' => $name, - $this->_pkg->getTasksNs() . ':prompt' => $prompt, - $this->_pkg->getTasksNs() . ':type' => $type, - $this->_pkg->getTasksNs() . ':default' => $default + $this->_pkg->getTasksNs().':name' => $name, + $this->_pkg->getTasksNs().':prompt' => $prompt, + $this->_pkg->getTasksNs().':type' => $type, + $this->_pkg->getTasksNs().':default' => $default, ); } + return array( - $this->_pkg->getTasksNs() . ':name' => $name, - $this->_pkg->getTasksNs() . ':prompt' => $prompt, - $this->_pkg->getTasksNs() . ':type' => $type, + $this->_pkg->getTasksNs().':name' => $name, + $this->_pkg->getTasksNs().':prompt' => $prompt, + $this->_pkg->getTasksNs().':type' => $type, ); } } -?> \ No newline at end of file