-
Notifications
You must be signed in to change notification settings - Fork 14
/
config.php
29 lines (25 loc) · 664 Bytes
/
config.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
<?php
/**
* Created by PhpStorm.
* User: alpipego
* Date: 09.04.18
* Time: 18:41
*/
declare(strict_types = 1);
namespace WpBerlin;
use Noodlehaus\Config;
use Noodlehaus\Exception\EmptyDirectoryException;
use Noodlehaus\Exception\FileNotFoundException;
try {
$env = new Config(__DIR__ . '/config/env.json');
$conf = new Config([
__DIR__ . '/config/env/default.json',
__DIR__ . '/config/env/' . $env->get('env') . '.json',
]);
$conf['env'] = $env->get('env');
return $conf;
} catch (EmptyDirectoryException $e) {
echo $e->getMessage();
} catch (FileNotFoundException $e) {
echo $e->getMessage();
}