config = $GLOBALS['_PEAR_Frontend_Web_config']; if (PEAR::isError($this->config)) { throw new Exception('Error: '.$this->config->getMessage()); } // end // Init PEAR Frontend class // PEAR_Frontend::setFrontendClass('PEAR_Frontend_CLI'); $this->ui = PEAR_Frontend::setFrontendClass('stPearFrontendWeb'); PEAR_Frontend::setFrontendObject($this->ui); return true; } /** * Execute PEAR command. * * @param string $command PEAR command eg. 'install' * @param array $params parameters np. array('pear.dev.quad.sote.pl/stApplicationTest') * @param array $opts options np. array('force'=>false,...) * @return bool */ public function command($command,$params=array(),$opts=array()) { if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) $timer = sfTimerManager::getTimer('__SOTE executeUpgradeList stInstallerFrontendWeb::command('.$command.')'); if (($command=='install') && (! sizeof($opts))) { $opts['onlyreqdeps'] = true; $opts['force'] = false; } // install force (eg. upload action) if ($command=='force-install') { $command='install'; $opts['force'] = true; } $cmd = PEAR_Command::factory($command, $this->config); if (PEAR::isError($cmd)) { $this->error=$cmd->getMessage(); } else { // execute PEAR command $ok = $cmd->run($command, $opts, $params); if (PEAR::isError($ok)) { $this->error=$ok->getMessage(); } } if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) $timer->addTime(); return true; } /** * Get Errors. * * @return string */ public function getErrors() { return $this->error; } }