validatePear() public static method

Validates and normalizes a version to be a valid PEAR version.
public static validatePear ( string $version ) : string
$version string A version string.
return string The normalized version string.
示例#1
0
 /**
  * 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::nextPearVersion($options['old_version']);
     } else {
         $next_version = $options['next_version'];
     }
     if (isset($options['commit'])) {
         $options['commit']->commit('Development mode for ' . $this->getComponent()->getName() . '-' . Components_Helper_Version::validatePear($next_version));
     }
 }
示例#2
0
 /**
  * Run the task.
  *
  * @param array &$options Additional options.
  *
  * @return NULL
  */
 public function run(&$options)
 {
     $api_state = isset($options['next_apistate']) ? $options['next_apistate'] : null;
     $rel_state = isset($options['next_relstate']) ? $options['next_relstate'] : null;
     if (empty($options['next_version'])) {
         if (empty($options['old_version'])) {
             $options['old_version'] = $this->getComponent()->getVersion();
         }
         $next_version = Components_Helper_Version::nextPearVersion($options['old_version']);
     } else {
         $next_version = $options['next_version'];
     }
     $result = $this->getComponent()->nextVersion(Components_Helper_Version::validatePear($next_version), $options['next_note'], $api_state, $rel_state, $options);
     if (!$this->getTasks()->pretend()) {
         $this->getOutput()->ok($result);
     } else {
         $this->getOutput()->info($result);
     }
 }