1 | <?php |
||
7 | class Config |
||
8 | { |
||
9 | /** |
||
10 | * Name for module config file (without .php extension) |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $configName = 'modular'; |
||
15 | |||
16 | /** |
||
17 | * @var Application |
||
18 | */ |
||
19 | protected $app; |
||
20 | |||
21 | /** |
||
22 | * Config constructor. |
||
23 | * |
||
24 | * @param Application $app |
||
25 | */ |
||
26 | public function __construct(Application $app) |
||
27 | { |
||
28 | $this->app = $app; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Get config file name |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | public function configName() |
||
40 | |||
41 | /** |
||
42 | * Get full path where configuration file should be placed |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | public function configPath() |
||
51 | |||
52 | /** |
||
53 | * Get value from module configuration file |
||
54 | * |
||
55 | * @param string|null $key |
||
56 | * @param mixed $default |
||
57 | * |
||
58 | * @return mixed |
||
59 | */ |
||
60 | protected function get($key = null, $default = null) |
||
65 | |||
66 | /** |
||
67 | * Get modules configuration |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | public function modules() |
||
75 | |||
76 | /** |
||
77 | * Get directory where modules will be stored |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | public function directory() |
||
85 | |||
86 | /** |
||
87 | * Get namespace prefix for all modules |
||
88 | * |
||
89 | * @return string |
||
90 | */ |
||
91 | public function modulesNamespace() |
||
95 | |||
96 | /** |
||
97 | * Get seeder namespace prefix |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | public function seederNamespace() |
||
105 | |||
106 | /** |
||
107 | * Get seeder file |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | public function seederFile() |
||
115 | |||
116 | /** |
||
117 | * Get service provider filename |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | public function serviceProviderNamespace() |
||
125 | |||
126 | /** |
||
127 | * Get namespace for controllers when loading routes |
||
128 | * |
||
129 | * @return string |
||
130 | */ |
||
131 | public function routingControllerNamespace() |
||
135 | |||
136 | /** |
||
137 | * Get routing file |
||
138 | * |
||
139 | * @param string $prefix |
||
140 | * |
||
141 | * @return string |
||
142 | */ |
||
143 | public function routingFile($prefix) |
||
147 | |||
148 | /** |
||
149 | * Get factory file |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | public function factoryFile() |
||
157 | |||
158 | /** |
||
159 | * Get start separator for replacements |
||
160 | * |
||
161 | * @return string |
||
162 | */ |
||
163 | public function startSeparator() |
||
167 | |||
168 | /** |
||
169 | * Get end separator for replacements |
||
170 | * |
||
171 | * @return string |
||
172 | */ |
||
173 | public function endSeparator() |
||
177 | |||
178 | /** |
||
179 | * Get default stubs group name when creating module |
||
180 | * |
||
181 | * @return string |
||
182 | */ |
||
183 | public function stubsDefaultGroup() |
||
187 | |||
188 | /** |
||
189 | * Get default stubs group name when creating module files |
||
190 | * |
||
191 | * @return string |
||
192 | */ |
||
193 | public function filesStubsDefaultGroup() |
||
197 | |||
198 | /** |
||
199 | * Get default migration type |
||
200 | * |
||
201 | * @return string |
||
202 | */ |
||
203 | public function migrationDefaultType() |
||
207 | |||
208 | /** |
||
209 | * Get stub name for migration of given type |
||
210 | * |
||
211 | * @param string $type |
||
212 | * |
||
213 | * @return string |
||
214 | */ |
||
215 | public function migrationStubFileName($type) |
||
219 | |||
220 | /** |
||
221 | * Get path where migrations are stored inside Module |
||
222 | * |
||
223 | * @return string |
||
224 | */ |
||
225 | public function migrationsPath() |
||
229 | |||
230 | /** |
||
231 | * Get service provider file |
||
232 | * |
||
233 | * @return string |
||
234 | */ |
||
235 | public function serviceProviderFile() |
||
239 | |||
240 | /** |
||
241 | * Get path where stubs are located |
||
242 | * |
||
243 | * @return string |
||
244 | */ |
||
245 | public function stubsPath() |
||
249 | |||
250 | /** |
||
251 | * Get relative directory for given stub group |
||
252 | * |
||
253 | * @param string $group |
||
254 | * |
||
255 | * @return string |
||
256 | */ |
||
257 | public function stubGroupDirectory($group) |
||
261 | |||
262 | /** |
||
263 | * Get directories to create for given stub group |
||
264 | * |
||
265 | * @param string $group |
||
266 | * |
||
267 | * @return array |
||
268 | */ |
||
269 | public function stubGroupDirectories($group) |
||
273 | |||
274 | /** |
||
275 | * Get files to create for given stub group |
||
276 | * |
||
277 | * @param string $group |
||
278 | * |
||
279 | * @return array |
||
280 | */ |
||
281 | public function stubGroupFiles($group) |
||
285 | |||
286 | /** |
||
287 | * Get all existing stub groups |
||
288 | * |
||
289 | * @return array |
||
290 | */ |
||
291 | public function stubGroups() |
||
295 | |||
296 | /** |
||
297 | * Get auto add to configuration status |
||
298 | * |
||
299 | * @return bool |
||
300 | */ |
||
301 | public function autoAdd() |
||
305 | |||
306 | /** |
||
307 | * Get auto add pattern |
||
308 | * |
||
309 | * @return string |
||
310 | */ |
||
311 | public function autoAddPattern() |
||
315 | |||
316 | /** |
||
317 | * Get auto add template |
||
318 | * |
||
319 | * @return string |
||
320 | */ |
||
321 | public function autoAddTemplate() |
||
325 | } |
||
326 |