1 | <?php |
||
9 | class Environment |
||
10 | { |
||
11 | /** |
||
12 | * Environment file |
||
13 | */ |
||
14 | const ENV_FILE = 'env.json'; |
||
15 | |||
16 | /** |
||
17 | * Configuration file |
||
18 | */ |
||
19 | const CONFIG_FILE = 'config.json'; |
||
20 | |||
21 | /** |
||
22 | * Signature file for cache bust |
||
23 | */ |
||
24 | const SIGNATURE_FILE = 'signature.txt'; |
||
25 | |||
26 | /** |
||
27 | * Is Development |
||
28 | * @var |
||
29 | */ |
||
30 | protected $blnIsDev; |
||
31 | |||
32 | /** |
||
33 | * Environment Settings |
||
34 | * @var |
||
35 | */ |
||
36 | protected $objEnvironmentSettings; |
||
37 | |||
38 | /** |
||
39 | * Environment constructor. |
||
40 | */ |
||
41 | 3 | public function __construct() |
|
44 | |||
45 | /** |
||
46 | * Set env to Dev |
||
47 | * |
||
48 | * @param bool $bln |
||
49 | * @return $this |
||
50 | */ |
||
51 | 3 | public function setDev($bln = true) |
|
57 | |||
58 | /** |
||
59 | * Determine if we are in development environment |
||
60 | * |
||
61 | * @return bool |
||
62 | */ |
||
63 | 3 | public function isDevEnv() |
|
76 | |||
77 | /** |
||
78 | * Determine if it has develompent env set |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | public function hasDevEnv() |
||
92 | |||
93 | /** |
||
94 | * Create a settings file |
||
95 | * |
||
96 | * @param $strFilePath |
||
97 | * @param $arrSettings |
||
98 | * @return object |
||
99 | */ |
||
100 | 3 | public function createSettingsFile($strFilePath, $arrSettings) |
|
107 | |||
108 | /** |
||
109 | * Get settings |
||
110 | * |
||
111 | * @param null $strFile |
||
112 | * @param array $arrSettings |
||
113 | * @return mixed|object |
||
114 | */ |
||
115 | 3 | public function getSettings($strFile = null, $arrSettings = []) |
|
125 | |||
126 | /** |
||
127 | * Get Config |
||
128 | * |
||
129 | * @param $strFilesFolder |
||
130 | * @return mixed|object |
||
131 | */ |
||
132 | 3 | public function getConfig($strFilesFolder) |
|
142 | |||
143 | /** |
||
144 | * Set environment |
||
145 | * |
||
146 | * @param null $strFilesFolder |
||
147 | */ |
||
148 | 3 | public function setEnvironment($strFilesFolder = null) |
|
158 | } |
||
159 |