Conditions | 3 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | { |
||
16 | return StorageDriverInterface::class; |
||
17 | } |
||
18 | |||
19 | protected static function getFactoryMap(): array |
||
20 | { |
||
21 | $return = []; |
||
22 | |||
23 | $return['dummy'] = DummyStorageDriver::class; |
||
24 | |||
25 | $return['local'] = function(VaultConfiguration $vaultConfiguration) |
||
26 | { |
||
27 | $path = TildeExpansion::expand($vaultConfiguration->getSetting('path')); |
||
28 | |||
29 | if (!is_dir($path) || !is_writable($path)) |
||
30 | { |
||
31 | throw new ConfigurationException(sprintf('Path "%s" does not exist or is not writable.', $path)); |
||
32 | } |
||
33 | |||
34 | $adapter = new Local($path); |
||
35 | $filesystem = new Filesystem($adapter); |
||
36 | |||
37 | return new FlysystemStorageDriver($filesystem); |
||
43 |