Horde_Release_Sentinel::getVersion PHP Method

getVersion() public method

Returns the current version from Application.php or Bundle.php.
public getVersion ( ) : string
return string Version string.
    public function getVersion()
    {
        if ($application = $this->applicationFileExists()) {
            $oldfp = fopen($application, 'r');
            while ($line = fgets($oldfp)) {
                if (preg_match('/public \\$version = \'([^\']*)\';/', $line, $match)) {
                    return $match[1];
                }
            }
            fclose($oldfp);
        }
        if ($bundle = $this->bundleFileExists()) {
            $oldfp = fopen($bundle, 'r');
            while ($line = fgets($oldfp)) {
                if (preg_match('/const VERSION = \'([^\']*)\';/', $line, $match)) {
                    return $match[1];
                }
            }
            fclose($oldfp);
        }
    }