-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSSGuru_Controller.php
68 lines (61 loc) · 1.66 KB
/
SSGuru_Controller.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* @property Controller $owner
*/
class SSGuru_Controller extends Extension
{
public function onBeforeInit()
{
SSGuru_Requirements_Backend::enable();
}
/**
* This function will return true if the current controller .
* For information about environment types, see {@link Director::set_environment_type()}.
*
* @return bool
*/
public function IsCMS()
{
return $this->owner instanceof LeftAndMain;
}
/**
* This function will return true if the site is in a development environment.
* For information about environment types, see {@link Director::set_environment_type()}.
*
* @return bool
*/
public function IsDev()
{
return Director::isDev();
}
/**
* This function will return true if the site is in a test environment.
* For information about environment types, see {@link Director::set_environment_type()}.
*
* @return bool
*/
public function IsTest()
{
return Director::isTest();
}
/**
* This function will return true if the site is in a live environment.
* For information about environment types, see {@link Director::set_environment_type()}.
*
* @return bool
*/
public function IsLive()
{
return Director::isLive();
}
/**
* This function will return the string 'dev', 'test' or 'live' depending on the current site mode
* Can also be checked with {@link Director::get_environment_type()}.
*
* @return string 'dev', 'test' or 'live'
*/
public function getSiteMode()
{
return Director::get_environment_type();
}
}