2008-01-16 06:24:27 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Returns information about the current site instance.
|
2008-06-15 15:33:53 +02:00
|
|
|
* @package sapphire
|
|
|
|
* @subpackage control
|
2008-01-16 06:24:27 +01:00
|
|
|
*/
|
|
|
|
class SapphireInfo extends Controller {
|
2008-03-03 00:21:58 +01:00
|
|
|
function Version() {
|
|
|
|
$sapphireVersionFile = file_get_contents('../sapphire/silverstripe_version');
|
|
|
|
|
|
|
|
if(strstr($sapphireVersionFile, "/sapphire/trunk")) {
|
|
|
|
$sapphireVersion = "trunk";
|
|
|
|
} else {
|
|
|
|
preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches);
|
|
|
|
$sapphireVersion = $matches[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
return $sapphireVersion;
|
|
|
|
}
|
|
|
|
|
|
|
|
function EnvironmentType() {
|
|
|
|
if(Director::isLive()) return "live";
|
|
|
|
else if(Director::isTest()) return "test";
|
|
|
|
else return "dev";
|
2008-01-16 06:24:27 +01:00
|
|
|
}
|
|
|
|
|
2008-03-03 00:21:58 +01:00
|
|
|
function BaseURL() {
|
|
|
|
return Director::absoluteBaseURL();
|
|
|
|
}
|
2008-01-16 06:24:27 +01:00
|
|
|
}
|