1 | <?php |
||
7 | class FileLoader implements LoaderInterface |
||
8 | { |
||
9 | /** |
||
10 | * The filesystem instance. |
||
11 | * |
||
12 | * @var \Illuminate\Filesystem\Filesystem |
||
13 | */ |
||
14 | protected $files; |
||
15 | |||
16 | /** |
||
17 | * The default configuration path. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $defaultPath; |
||
22 | |||
23 | /** |
||
24 | * All of the named path hints. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $hints = []; |
||
29 | |||
30 | /** |
||
31 | * A cache of whether namespaces and groups exists. |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $exists = []; |
||
36 | |||
37 | /** |
||
38 | * Create a new file configuration loader. |
||
39 | * |
||
40 | * @param \Illuminate\Filesystem\Filesystem $files |
||
41 | * @param string $defaultPath |
||
42 | */ |
||
43 | 6 | public function __construct(Filesystem $files, $defaultPath) |
|
48 | |||
49 | /** |
||
50 | * Load the given configuration group. |
||
51 | * |
||
52 | * @param string $group |
||
53 | * @param string $namespace |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | 2 | public function load($group, $namespace = null) |
|
75 | |||
76 | /** |
||
77 | * Determine if the given group exists. |
||
78 | * |
||
79 | * @param string $group |
||
80 | * @param string $namespace |
||
81 | * |
||
82 | * @return bool |
||
83 | */ |
||
84 | 4 | public function exists($group, $namespace = null) |
|
113 | |||
114 | /** |
||
115 | * Get the configuration path for a namespace. |
||
116 | * |
||
117 | * @param string $namespace |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | 6 | protected function getPath($namespace) |
|
129 | |||
130 | /** |
||
131 | * Add a new namespace to the loader. |
||
132 | * |
||
133 | * @param string $namespace |
||
134 | * @param string $hint |
||
135 | */ |
||
136 | 2 | public function addNamespace($namespace, $hint) |
|
140 | |||
141 | /** |
||
142 | * Returns all registered namespaces with the config |
||
143 | * loader. |
||
144 | * |
||
145 | * @return array |
||
146 | */ |
||
147 | public function getNamespaces() |
||
151 | |||
152 | /** |
||
153 | * Get a file's contents by requiring it. |
||
154 | * |
||
155 | * @param string $path |
||
156 | * |
||
157 | * @return mixed |
||
158 | */ |
||
159 | 1 | protected function getRequire($path) |
|
163 | |||
164 | /** |
||
165 | * Get the Filesystem instance. |
||
166 | * |
||
167 | * @return \Illuminate\Filesystem\Filesystem |
||
168 | */ |
||
169 | 4 | public function getFilesystem() |
|
173 | } |
||
174 |