public static function parseCoreVersion($Path)
{
$fp = fopen($Path, 'rb');
$Application = false;
$Version = '';
while (($Line = fgets($fp)) !== false) {
if (preg_match("`define\\('(.*?)', '(.*?)'\\);`", $Line, $Matches)) {
$Name = $Matches[1];
$Value = $Matches[2];
switch ($Name) {
case 'APPLICATION':
$Application = $Value;
break;
case 'APPLICATION_VERSION':
$Version = $Value;
}
}
if ($Application !== false && $Version !== '') {
break;
}
}
fclose($fp);
return $Version;
}