|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace AnyCloud\Service\File\Store; |
|
4
|
|
|
|
|
5
|
|
|
use AnyCloud\File\Store; |
|
6
|
|
|
use AnyCloud\File\Store\AnyCloud; |
|
|
|
|
|
|
7
|
|
|
use AnyCloud\Service\File\Adapter; |
|
|
|
|
|
|
8
|
|
|
use Interop\Container\ContainerInterface; |
|
9
|
|
|
use Laminas\ServiceManager\Factory\FactoryInterface; |
|
|
|
|
|
|
10
|
|
|
use League\Flysystem\Filesystem; |
|
11
|
|
|
|
|
12
|
|
|
class AnyCloudFactory implements FactoryInterface |
|
13
|
|
|
{ |
|
14
|
|
|
const SERVICE_NAMES = [ |
|
15
|
|
|
'aws' => Store\Aws::class, |
|
|
|
|
|
|
16
|
|
|
'azure' => Store\Azure::class, |
|
|
|
|
|
|
17
|
|
|
'digital_ocean' => Store\DigitalOcean::class, |
|
|
|
|
|
|
18
|
|
|
'dropbox' => Store\Dropbox::class, |
|
19
|
|
|
'google' => Store\Google::class, |
|
|
|
|
|
|
20
|
|
|
'scaleway' => Store\Scaleway::class, |
|
|
|
|
|
|
21
|
|
|
'wasabi' => Store\Wasabi::class, |
|
|
|
|
|
|
22
|
|
|
]; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* @param ContainerInterface $serviceLocator |
|
26
|
|
|
* @param string $requestedName |
|
27
|
|
|
* @param array|null $options |
|
28
|
|
|
* |
|
29
|
|
|
* @return AnyCloud|object |
|
30
|
|
|
*/ |
|
31
|
|
|
public function __invoke(ContainerInterface $serviceLocator, $requestedName, array $options = null) |
|
32
|
|
|
{ |
|
33
|
|
|
$settings = $serviceLocator->get('Omeka\Settings'); |
|
34
|
|
|
$anycloud_adapter = $settings->get('anycloud_adapter', []); |
|
35
|
|
|
$adapter = $anycloud_adapter['adapter']; |
|
36
|
|
|
|
|
37
|
|
|
if (array_key_exists($adapter, self::SERVICE_NAMES)) { |
|
38
|
|
|
return $serviceLocator->get(self::SERVICE_NAMES[$adapter]); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
throw new \Omeka\Service\Exception\ConfigException('Bad value for anycloud_adapter: ' . $adapter); |
|
|
|
|
|
|
42
|
|
|
} |
|
43
|
|
|
} |
|
44
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths