getVersion() public method

Return the version of the component.
public getVersion ( ) : string
return string The component version.
示例#1
0
 /**
  * List a Horde component as dependency.
  *
  * @param Components_Component $component The component for which the
  *                                        dependency tree should be shown     * @param int                  $level     The current list level.
  * @param string               $parent    Name of the parent element.
  * @param array                $options   Options for generating the list.
  *
  * @return boolean True in case listing should continue.
  */
 private function _listComponent(Components_Component $component, $level, $parent, $options)
 {
     $key = $component->getName() . '/' . $component->getChannel();
     if (in_array($key, array_keys($this->_displayed_dependencies))) {
         if (empty($this->_displayed_dependencies[$key])) {
             $add = '(RECURSION) ***STOP***';
         } else {
             $add = '(ALREADY LISTED WITH ' . $this->_displayed_dependencies[$key] . ') ***STOP***';
         }
     } else {
         $add = '';
     }
     $this->_element($component->getChannel() == 'pear.horde.org' ? 'green' : 'yellow', $level, $key, $component->getName() . '-' . $component->getVersion(), $component->getChannel(), $add, $options);
     if (in_array($key, array_keys($this->_displayed_dependencies))) {
         return false;
     } else {
         $this->_displayed_dependencies[$key] = $parent;
         return true;
     }
 }
示例#2
0
文件: Notes.php 项目: horde/horde
    /**
     * Populates the release information for the current component.
     */
    protected function _setReleaseNotes()
    {
        if (!($file = $this->_component->getReleaseNotesPath())) {
            return;
        }
        if (basename($file) == 'release.yml') {
            $version = Components_Helper_Version::parsePearVersion($this->_component->getVersion());
            $description = Horde_String::lower($version->description);
            if (strpos($description, 'release') === false) {
                $description .= ' release';
            }
            $infofile = dirname($file) . '/horde.yml';
            try {
                $info = Horde_Yaml::loadFile($infofile);
            } catch (Horde_Yaml_Exception $e) {
                throw new Components_Exception($e);
            }
            $this->_notes['name'] = $info['name'];
            if (isset($info['list'])) {
                $this->_notes['list'] = $info['list'];
            }
            try {
                $release = Horde_Yaml::loadFile($file);
            } catch (Horde_Yaml_Exception $e) {
                throw new Components_Exception($e);
            }
            if (isset($release['branch'])) {
                $this->_notes['branch'] = $release['branch'];
            }
            $this->_notes['security'] = $release['security'];
            if (is_array($release['changes'])) {
                if (!is_array(reset($release['changes']))) {
                    $release['changes'] = array($release['changes']);
                }
            } else {
                $release['changes'] = array();
            }
            $currentSection = null;
            $changes = '';
            foreach ($release['changes'] as $section => $sectionChanges) {
                if ($section != $currentSection) {
                    $changes .= "\n\n" . $section . ':';
                    $currentSection = $section;
                }
                foreach ($sectionChanges as $change) {
                    $changes .= "\n    * " . $change;
                }
            }
            switch ($version->description) {
                case 'Final':
                    $prerelease = '';
                    break;
                case 'Alpha':
                case 'Beta':
                    $prerelease = '
This is a preview version that should not be used on production systems. This version is considered feature complete but there might still be a few bugs. You should not use this preview version over existing production data.

We encourage widespread testing and feedback via the mailing lists or our bug tracking system. Updated translations are very welcome, though some strings might still change before the final release.
';
                    break;
                case 'Release Candidate':
                    $prerelease = sprintf('
Barring any problems, this code will be released as %s %s.
Testing is requested and comments are encouraged. Updated translations would also be great.
', $info['name'], $version->version);
                    break;
            }
            $this->_notes['changes'] = sprintf('The Horde Team is pleased to announce the %s%s of the %s version %s.

%s
%s
For upgrading instructions, please see
http://www.horde.org/apps/%s/docs/UPGRADING

For detailed installation and configuration instructions, please see
http://www.horde.org/apps/%s/docs/INSTALL
%s
The major changes compared to the %s version %s are:%s', $version->subversion ? NumberFormatter::create('en_US', NumberFormatter::ORDINAL)->format($version->subversion) . ' ' : '', $description, $info['full'], $version->version, $info['description'], $prerelease, $info['id'], $info['id'], !empty($release['additional']) ? "\n" . implode("\n\n", $release['additional']) . "\n" : '', $info['name'], $this->_component->getPreviousVersion(), $changes);
        } else {
            $this->_notes = (include $file);
        }
    }