mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Added Director::get_environment_type()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63463 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
40fd160743
commit
655395a8e7
@ -621,6 +621,23 @@ class Director {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Can also be checked with {@link Director::isDev()}, {@link Director::isTest()}, and {@link Director::isLive()}.
|
||||
*
|
||||
* @return string 'dev', 'test' or 'live'
|
||||
*/
|
||||
static function get_environment_type() {
|
||||
if(Director::isLive()) {
|
||||
return 'live';
|
||||
} elseif(Director::isTest()) {
|
||||
return 'test';
|
||||
} elseif(Director::isDev()) {
|
||||
return 'dev';
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify HTTP_HOST values that are development environments.
|
||||
* For information about environment types, see {@link Director::set_environment_type()}.
|
||||
|
Loading…
Reference in New Issue
Block a user