protected function execute($arguments = array(), $options = array()) { // Remove E_STRICT and E_DEPRECATED from error_reporting error_reporting(error_reporting() & ~(E_STRICT | E_DEPRECATED)); if (sfConfig::get('op_http_proxy')) { $config = $this->getPluginManager()->getEnvironment()->getConfig(); $config->set('http_proxy', sfConfig::get('op_http_proxy'), 'user', 'pear.php.net'); } if ($this->isSelfInstalledPlugins($arguments['name'])) { $str = "\"%s\" is already installed manually, so it will not be reinstalled.\n" . "If you want to manage it automatically, delete it manually and retry this command."; $this->logBlock(sprintf($str, $arguments['name']), 'INFO'); return false; } try { $isExists = $this->isPluginExists($arguments['name']); parent::execute($arguments, $options); if (count(sfFinder::type('file')->name('databases.yml')->in(sfConfig::get('sf_config_dir'))) && !$isExists) { $databaseManager = new sfDatabaseManager($this->configuration); Doctrine::getTable('SnsConfig')->set($arguments['name'] . '_needs_data_load', '1'); } } catch (sfPluginException $e) { $this->logBlock($e->getMessage(), 'ERROR'); return false; } }
protected function execute($arguments = array(), $options = array()) { // Remove E_STRICT and E_DEPRECATED from error_reporting error_reporting(error_reporting() & ~(E_STRICT | E_DEPRECATED)); if (empty($options['channel'])) { $options['channel'] = opPluginManager::getDefaultPluginChannelServerName(); } $manager = $this->getPluginManager($options['channel']); if (sfConfig::get('op_http_proxy')) { $config = $this->getPluginManager()->getEnvironment()->getConfig(); $config->set('http_proxy', sfConfig::get('op_http_proxy'), 'user', 'pear.php.net'); } if ($this->isSelfInstalledPlugins($arguments['name'], $options['channel'])) { $str = "\"%s\" is already installed manually, so it will not be reinstalled.\n" . "If you want to manage it automatically, delete it manually and retry this command."; $this->logBlock(sprintf($str, $arguments['name']), 'INFO'); return false; } try { $isExists = $this->isPluginExists($arguments['name']); parent::execute($arguments, $options); if (count(sfFinder::type('file')->name('databases.yml')->in(sfConfig::get('sf_config_dir'))) && !$isExists) { $databaseManager = new sfDatabaseManager($this->configuration); if ($this->isSnsConfigTableExists()) { Doctrine::getTable('SnsConfig')->set($arguments['name'] . '_needs_data_load', '1'); } } } catch (sfPluginException $e) { $this->logBlock($e->getMessage(), 'ERROR'); $registry = $this->getPluginManager()->getEnvironment()->getRegistry(); $dependency = opPluginDownloader::getCachedDependency($options['channel'], $arguments['name']); if ($dependency && $dependency->hasFailedDependency()) { $message = array('', $this->formatter->format('You must resolve the following failed dependency to install this plugin:', 'INFO'), ''); foreach ($dependency->failedDependency['package'] as $dep) { $message['package'] = $this->formatter->format('Packages and plugins:', 'COMMENT'); $depname = $dependency->_getExtraString($dep); if (array_key_exists('conflicts', $dep)) { $depname = ' ' . $this->formatter->format('(conflicts - please uninstall this)', 'ERROR'); } $message[] = ' ' . $registry->parsedPackageNameToString($dep, true) . $depname; } foreach ($dependency->failedDependency['extension'] as $dep) { $message['extension'] = $this->formatter->format('Extensions:', 'COMMENT'); $message[] = ' ' . $dep['name'] . $dependency->_getExtraString($dep); } if ($dependency->failedDependency['php']) { $dep = $dependency->failedDependency['php']; $message[] = $this->formatter->format('PHP:', 'COMMENT'); $message[] = $dependency->_getExtraString($dep); } if ($dependency->failedDependency['pearinstaller']) { $dep = $dependency->failedDependency['pearinstaller']; $message[] = $this->formatter->format('PEAR:', 'COMMENT'); $message[] = $dependency->_getExtraString($dep); } $this->log($message); } return false; } }