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