1 | <?php |
||
9 | class LoaderManager |
||
10 | { |
||
11 | /** |
||
12 | * @var Loader[] |
||
13 | */ |
||
14 | private $loaders = []; |
||
15 | |||
16 | /** |
||
17 | * @param Loader[] $loaders |
||
18 | */ |
||
19 | public function __construct(array $loaders = []) |
||
31 | |||
32 | /** |
||
33 | * Register a Loader for the given prefix. |
||
34 | * |
||
35 | * @param string $prefix |
||
36 | * @param Loader $loader |
||
37 | */ |
||
38 | public function registerLoader($prefix, Loader $loader) |
||
42 | |||
43 | /** |
||
44 | * Get all registered loaders, keyed by the prefix they are registered to load schemas for. |
||
45 | * |
||
46 | * @return Loader[] |
||
47 | */ |
||
48 | public function getLoaders() |
||
52 | |||
53 | /** |
||
54 | * Get the loader for the given prefix. |
||
55 | * |
||
56 | * @param string $prefix |
||
57 | * |
||
58 | * @return Loader |
||
59 | * @throws \InvalidArgumentException |
||
60 | */ |
||
61 | public function getLoader($prefix) |
||
69 | |||
70 | /** |
||
71 | * @param string $prefix |
||
72 | * |
||
73 | * @return bool |
||
74 | */ |
||
75 | public function hasLoader($prefix) |
||
79 | |||
80 | /** |
||
81 | * Register the default file loader. |
||
82 | */ |
||
83 | private function registerDefaultFileLoader() |
||
87 | |||
88 | /** |
||
89 | * Register the default web loaders. If the curl extension is loaded, |
||
90 | * the CurlWebLoader will be used. Otherwise the FileGetContentsWebLoader |
||
91 | * will be used. You can override this by registering your own loader |
||
92 | * for the 'http' and 'https' protocols. |
||
93 | */ |
||
94 | private function registerDefaultWebLoaders() |
||
104 | } |
||
105 |