1 | <?php |
||
5 | class Environment implements EnvironmentInterface |
||
6 | { |
||
7 | const PRODUCTION = 'prod'; |
||
8 | const STAGING = 'test'; |
||
9 | const DEVELOPMENT = 'dev'; |
||
10 | const LOCAL = 'local'; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $environment; |
||
16 | |||
17 | /** |
||
18 | * Constructor, fires init() hook to initialize the environment. |
||
19 | */ |
||
20 | 111 | public function __construct() |
|
25 | |||
26 | /** |
||
27 | * Calculates and returns the environment. |
||
28 | * |
||
29 | * @return string |
||
30 | */ |
||
31 | 12 | protected function init() |
|
35 | |||
36 | /** |
||
37 | * {@inheritDoc} |
||
38 | * |
||
39 | * @return \Acquia\Environment\Environment |
||
40 | */ |
||
41 | 111 | public function setEnvironment($environment) |
|
49 | |||
50 | /** |
||
51 | * {@inheritDoc} |
||
52 | */ |
||
53 | 33 | public function getEnvironment() |
|
57 | |||
58 | /** |
||
59 | * {@inheritDoc} |
||
60 | */ |
||
61 | 3 | public function isProduction() |
|
65 | |||
66 | /** |
||
67 | * {@inheritDoc} |
||
68 | */ |
||
69 | 15 | public function __toString() |
|
73 | } |
||
74 |