Issues (38)

lib/custom/src/MW/Filesystem/FlyRackspace.php (3 issues)

Labels
Severity
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2018
6
 * @package MW
7
 * @subpackage Filesystem
8
 */
9
10
11
namespace Aimeos\MW\Filesystem;
12
13
use OpenCloud\OpenStack;
0 ignored issues
show
The type OpenCloud\OpenStack was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use OpenCloud\Rackspace;
0 ignored issues
show
The type OpenCloud\Rackspace was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
use League\Flysystem\Filesystem;
16
use League\Flysystem\Rackspace\RackspaceAdapter;
0 ignored issues
show
The type League\Flysystem\Rackspace\RackspaceAdapter was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
18
19
/**
20
 * Implementation of Flysystem Rackspace file system adapter
21
 *
22
 * @package MW
23
 * @subpackage Filesystem
24
 */
25
class FlyRackspace extends FlyBase implements Iface, DirIface, MetaIface
26
{
27
	private $fs;
28
29
30
	/**
31
	 * Returns the file system provider
32
	 *
33
	 * @return \League\Flysystem\FilesystemInterface File system provider
34
	 */
35
	protected function getProvider()
36
	{
37
		if( !isset( $this->fs ) )
38
		{
39
			$config = $this->getConfig();
40
41
			if( !isset( $config['container'] ) ) {
42
				throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'container' ) );
43
			}
44
45
			$client = new OpenStack( Rackspace::UK_IDENTITY_ENDPOINT, $config );
46
			$container = $client->objectStoreService( 'cloudFiles', 'LON' )->getContainer( $config['container'] );
47
			$this->fs = new Filesystem( new RackspaceAdapter( $container ) );
48
		}
49
50
		return $this->fs;
51
	}
52
}
53