<?php
 define('PEAR_TASK_ERROR_NOATTRIBS', 1); define('PEAR_TASK_ERROR_MISSING_ATTRIB', 2); define('PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE', 3); define('PEAR_TASK_ERROR_INVALID', 4); define('PEAR_TASK_PACKAGE', 1); define('PEAR_TASK_INSTALL', 2); define('PEAR_TASK_PACKAGEANDINSTALL', 3); class PEAR_Task_Common { var $type = 'simple'; var $phase = PEAR_TASK_INSTALL; var $config; var $registry; var $logger; var $installphase; function PEAR_Task_Common(&$config, &$logger, $phase) { $this->config = &$config; $this->registry = &$config->getRegistry(); $this->logger = &$logger; $this->installphase = $phase; if ($this->type == 'multiple') { $GLOBALS['_PEAR_TASK_POSTINSTANCES'][get_class($this)][] = &$this; } } function validateXml($pkg, $xml, $config, $fileXml) { } function init($xml, $fileAttributes, $lastVersion) { } function startSession($pkg, $contents, $dest) { } function run($tasks) { } function hasPostinstallTasks() { return isset($GLOBALS['_PEAR_TASK_POSTINSTANCES']); } function runPostinstallTasks() { foreach ($GLOBALS['_PEAR_TASK_POSTINSTANCES'] as $class => $tasks) { $err = call_user_func(array($class, 'run'), $GLOBALS['_PEAR_TASK_POSTINSTANCES'][$class]); if ($err) { return PEAR_Task_Common::throwError($err); } } unset($GLOBALS['_PEAR_TASK_POSTINSTANCES']); } function isScript() { return $this->type == 'script'; } function throwError($msg, $code = -1) { include_once 'PEAR.php'; return PEAR::raiseError($msg, $code); } } ?>