| 1 | <?php |
||
| 13 | class ReplicateAdapterFactory extends AbstractAdapterFactory |
||
| 14 | { |
||
| 15 | public function doCreateService(ContainerInterface $container): AdapterInterface |
||
| 16 | { |
||
| 17 | if (! class_exists(\League\Flysystem\Replicate\ReplicateAdapter::class)) { |
||
| 18 | throw new RequirementsException( |
||
| 19 | ['league/flysystem-replicate-adapter'], |
||
| 20 | 'Replicate' |
||
| 21 | ); |
||
| 22 | } |
||
| 23 | |||
| 24 | $connectionManager = $container->get('BsbFlysystemAdapterManager'); |
||
| 25 | |||
| 26 | $adapter = new Adapter( |
||
| 27 | $connectionManager->get($this->options['source']), |
||
| 28 | $connectionManager->get($this->options['replicate']) |
||
| 29 | ); |
||
| 30 | |||
| 31 | return $adapter; |
||
| 32 | } |
||
| 33 | |||
| 34 | 3 | protected function validateConfig() |
|
| 44 | } |
||
| 45 |