added function for version information

This commit is contained in:
Roland Gruber 2005-04-07 13:12:38 +00:00
parent 52fd5c9ccd
commit 5a263dbea3
2 changed files with 21 additions and 0 deletions

1
lam/VERSION Normal file
View File

@ -0,0 +1 @@
0.5.alpha1

View File

@ -72,6 +72,26 @@ function getConfigProfiles() {
return $ret;
}
/**
* Returns the version number of this LAM installation.
* Format: <major version>.<minor version>.<patch level>
* <br> Major/minor version are always numbers, patch level may contain letters for inofficial releases only (e.g. 0.5.alpha1).
*
* @return string version number
*/
function LAMVersion() {
$file = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/VERSION";
if (is_readable($file)) {
$handle = fopen($file, "r");
if (!feof($handle)) {
return trim(fgets($handle, 20));
}
}
// file was not readable
return '0.0.unknown';
}
/**
* Prints a meta refresh page
*