mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
a0fb07d8ba
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@50452 467b73ca-7a2a-4603-9d3b-597d59a354a9
29 lines
729 B
PHP
29 lines
729 B
PHP
<?php
|
|
|
|
/**
|
|
* Returns information about the current site instance.
|
|
*/
|
|
class SapphireInfo extends Controller {
|
|
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";
|
|
}
|
|
|
|
function BaseURL() {
|
|
return Director::absoluteBaseURL();
|
|
}
|
|
} |