BUG 5978 Moved version to System class

This commit is contained in:
Alexandre Rosenfeld
2011-04-06 11:15:16 -04:00
parent 35d119cc4f
commit a240eea0e8
2 changed files with 21 additions and 19 deletions

View File

@@ -83,6 +83,25 @@ class System {
return $aWorkspaces;
}
public static function getVersion() {
if (! defined ( 'PM_VERSION' )) {
if (file_exists ( PATH_METHODS . 'login/version-pmos.php' )) {
include (PATH_METHODS . 'login/version-pmos.php');
}
else {
$cmd = sprintf ("cd %s && git status | grep 'On branch' | awk '{print \"Branch: \" $4} '", PATH_TRUNK);
if ( exec ( $cmd , $target) ) {
$cmd = sprintf ("cd %s && git describe ", PATH_TRUNK);
$commit = exec ( $cmd , $target);
define ( 'PM_VERSION', implode(' ', $target) );
}
else
define ( 'PM_VERSION', 'Development Version' );
}
}
return PM_VERSION;
}
/**
* Get system information
*