|
8 | 8 | class Config implements ArrayAccess |
9 | 9 | { |
10 | 10 | /** @var array */ |
11 | | - private $config; |
| 11 | + private $config = array(); |
12 | 12 |
|
13 | 13 | public function __construct(array $config = array()) |
14 | 14 | { |
15 | | - $this->config = $this->getDefaultConfig(); |
| 15 | + $this->loadDefaultConfig(); |
16 | 16 | if ($config) { |
17 | 17 | $this->merge($config); |
18 | 18 | } |
@@ -66,38 +66,8 @@ public function offsetUnset($offset) |
66 | 66 | unset($this->config[$offset]); |
67 | 67 | } |
68 | 68 |
|
69 | | - /** |
70 | | - * @return array |
71 | | - */ |
72 | | - private function getDefaultConfig() |
| 69 | + private function loadDefaultConfig() |
73 | 70 | { |
74 | | - return array( |
75 | | - 'save.handler' => Profiler::SAVER_STACK, |
76 | | - 'save.handler.stack' => array( |
77 | | - 'savers' => array( |
78 | | - Profiler::SAVER_UPLOAD, |
79 | | - Profiler::SAVER_FILE, |
80 | | - ), |
81 | | - 'saveAll' => false, |
82 | | - ), |
83 | | - 'save.handler.file' => array( |
84 | | - 'filename' => sys_get_temp_dir() . '/xhgui.data.jsonl', |
85 | | - ), |
86 | | - 'profiler.enable' => function () { |
87 | | - return true; |
88 | | - }, |
89 | | - 'profiler.flags' => array( |
90 | | - ProfilingFlags::CPU, |
91 | | - ProfilingFlags::MEMORY, |
92 | | - ProfilingFlags::NO_BUILTINS, |
93 | | - ProfilingFlags::NO_SPANS, |
94 | | - ), |
95 | | - 'profiler.options' => array(), |
96 | | - 'profiler.exclude-env' => array(), |
97 | | - 'profiler.simple_url' => function ($url) { |
98 | | - return preg_replace('/=\d+/', '', $url); |
99 | | - }, |
100 | | - 'profiler.replace_url' => null, |
101 | | - ); |
| 71 | + $this->load(__DIR__ . '/../config/config.default.php'); |
102 | 72 | } |
103 | 73 | } |
0 commit comments