Conditions | 4 |
Paths | 3 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function __construct(VaultConfiguration $vaultConfiguration) |
||
13 | { |
||
14 | if (!($path = $vaultConfiguration->getSetting('path'))) |
||
15 | { |
||
16 | throw new ConfigurationException("Missing vault config setting 'path' for vault '{$vaultConfiguration->getTitle()}'.'"); |
||
17 | } |
||
18 | |||
19 | $path = PathUtils::getAbsolutePath($path); |
||
20 | |||
21 | if (!is_dir($path) || !is_writable($path)) |
||
22 | { |
||
23 | throw new ConfigurationException(sprintf('Path "%s" does not exist or is not writable.', $path)); |
||
24 | } |
||
25 | |||
26 | $adapter = new \League\Flysystem\Adapter\Local($path); |
||
27 | $filesystem = new Filesystem($adapter); |
||
28 | |||
29 | parent::__construct($filesystem); |
||
30 | } |
||
31 | |||
40 |