mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-20 12:24:29 +02:00
parent
b69311165c
commit
abcdc5adb1
@ -15,6 +15,17 @@ class Version
|
|||||||
*/
|
*/
|
||||||
public static function get()
|
public static function get()
|
||||||
{
|
{
|
||||||
|
if (false !== ($gitHead = @file_get_contents((
|
||||||
|
$gitDir = Icinga::app()->getBaseDir('.git')
|
||||||
|
) . DIRECTORY_SEPARATOR . 'HEAD'))) {
|
||||||
|
$matches = array();
|
||||||
|
if ((1 !== @preg_match('/(?<!.)ref:\s+(?P<gitCommitID>.+?)$/ms', $gitHead, $matches) || false !== (
|
||||||
|
$gitHead = @file_get_contents($gitDir . DIRECTORY_SEPARATOR . $matches['gitCommitID'])
|
||||||
|
)) && 1 === @preg_match('/(?<!.)(?P<gitCommitID>[0-9a-f]+)$/ms', $gitHead, $matches)) {
|
||||||
|
return $matches;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (false === ($appVersion = @file_get_contents(
|
if (false === ($appVersion = @file_get_contents(
|
||||||
Icinga::app()->getApplicationDir() . DIRECTORY_SEPARATOR . 'VERSION'
|
Icinga::app()->getApplicationDir() . DIRECTORY_SEPARATOR . 'VERSION'
|
||||||
))) {
|
))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user