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);
}
}