Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (30 sloc) 0.809 kb
<?php
/**
* Returns information about the current site instance.
* @package framework
* @subpackage control
*/
class SapphireInfo extends Controller {
static $allowed_actions = array(
'baseurl',
'version',
'environmenttype',
);
function init() {
parent::init();
if(!Director::is_cli() && !Permission::check('ADMIN')) return Security::permissionFailure();
}
function Version() {
$sapphireVersion = file_get_contents(FRAMEWORK_PATH . '/silverstripe_version');
if(!$sapphireVersion) $sapphireVersion = _t('LeftAndMain.VersionUnknown', 'unknown');
return $sapphireVersion;
}
function EnvironmentType() {
if(Director::isLive()) return "live";
else if(Director::isTest()) return "test";
else return "dev";
}
function BaseURL() {
return Director::absoluteBaseURL();
}
}
Jump to Line
Something went wrong with that request. Please try again.