Convert the PEAR package version number to Horde style and take the
branch name into account.
/** * Run the task. * * @param array &$options Additional options. * * @return NULL */ public function run(&$options) { $changes_version = $this->getComponent()->getVersion(); $application_version = Components_Helper_Version::pearToHordeWithBranch($this->getComponent()->getVersion(), $this->getNotes()->getBranch()); $result = $this->getComponent()->currentSentinel($changes_version, $application_version, $options); if (!$this->getTasks()->pretend()) { foreach ($result as $message) { $this->getOutput()->ok($message); } } else { foreach ($result as $message) { $this->getOutput()->info($message); } } }
public function run() { $arguments = $this->_config->getArguments(); $options = array_merge(array('new_version' => false, 'new_api' => false, 'new_state' => false, 'new_apistate' => false), $this->_config->getOptions()); if (!empty($options['updatexml']) || isset($arguments[0]) && $arguments[0] == 'update') { $action = !empty($options['action']) ? $options['action'] : 'update'; if (!empty($options['pretend']) && $action == 'update') { $action = 'diff'; } if (!empty($options['commit'])) { $options['commit'] = new Components_Helper_Commit($this->_output, $options); } $result = $this->_config->getComponent()->updatePackageXml($action, $options); if (!empty($options['new_version']) || !empty($options['new_api'])) { $this->_config->getComponent()->setVersion($options['new_version'], $options['new_api'], $options); if (!empty($options['new_version']) && !empty($options['sentinel'])) { $notes = new Components_Release_Notes($this->_output); $notes->setComponent($this->_config->getComponent()); $application_version = Components_Helper_Version::pearToHordeWithBranch($options['new_version'] . '-git', $notes->getBranch()); $sentinel_result = $this->_config->getComponent()->currentSentinel($options['new_version'] . '-git', $application_version, $options); foreach ($sentinel_result as $file) { $this->_output->ok($file); } } } if (!empty($options['new_state']) || !empty($options['new_apistate'])) { $this->_config->getComponent()->setState($options['new_state'], $options['new_apistate'], $options); } if (!empty($options['commit'])) { $options['commit']->commit('Components updated the package.xml.'); } if ($result === true) { $this->_output->ok('Successfully updated package.xml of ' . $this->_config->getComponent()->getName() . '.'); } else { print $result; } } }
/** * Run the task. * * @param array &$options Additional options. * * @return NULL */ public function run(&$options) { if (empty($options['next_version'])) { if (empty($options['old_version'])) { $options['old_version'] = $this->getComponent()->getVersion(); } $next_version = Components_Helper_Version::nextVersion($options['old_version']); } else { $next_version = $options['next_version']; } $changes_version = $next_version; $application_version = Components_Helper_Version::pearToHordeWithBranch($next_version, $this->getNotes()->getBranch()); $result = $this->getComponent()->nextSentinel($changes_version, $application_version, $options); if (!$this->getTasks()->pretend()) { foreach ($result as $message) { $this->getOutput()->ok($message); } } else { foreach ($result as $message) { $this->getOutput()->info($message); } } }