@@ -34,17 +34,17 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | protected function getProvider() |
| 36 | 36 | { |
| 37 | - if( !isset( $this->fs ) ) |
|
| 37 | + if (!isset($this->fs)) |
|
| 38 | 38 | { |
| 39 | 39 | $config = $this->getConfig(); |
| 40 | 40 | |
| 41 | - if( !isset( $config['container'] ) ) { |
|
| 42 | - throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'container' ) ); |
|
| 41 | + if (!isset($config['container'])) { |
|
| 42 | + throw new Exception(sprintf('Configuration option "%1$s" missing', 'container')); |
|
| 43 | 43 | } |
| 44 | 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 ) ); |
|
| 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 | 48 | } |
| 49 | 49 | |
| 50 | 50 | return $this->fs; |
@@ -32,21 +32,21 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | protected function getProvider() |
| 34 | 34 | { |
| 35 | - if( !isset( $this->fs ) ) |
|
| 35 | + if (!isset($this->fs)) |
|
| 36 | 36 | { |
| 37 | 37 | $config = $this->getConfig(); |
| 38 | 38 | |
| 39 | - if( !isset( $config['source'] ) ) { |
|
| 40 | - throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'source' ) ); |
|
| 39 | + if (!isset($config['source'])) { |
|
| 40 | + throw new Exception(sprintf('Configuration option "%1$s" missing', 'source')); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if( !isset( $config['replica'] ) ) { |
|
| 44 | - throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'replica' ) ); |
|
| 43 | + if (!isset($config['replica'])) { |
|
| 44 | + throw new Exception(sprintf('Configuration option "%1$s" missing', 'replica')); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - $source = Factory::create( (array) $config['source'] )->getAdapter(); |
|
| 48 | - $replica = Factory::create( (array) $config['replica'] )->getAdapter(); |
|
| 49 | - $this->fs = new Filesystem( new ReplicateAdapter( $source, $replica ) ); |
|
| 47 | + $source = Factory::create((array) $config['source'])->getAdapter(); |
|
| 48 | + $replica = Factory::create((array) $config['replica'])->getAdapter(); |
|
| 49 | + $this->fs = new Filesystem(new ReplicateAdapter($source, $replica)); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | return $this->fs; |
@@ -32,8 +32,8 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | protected function getProvider() |
| 34 | 34 | { |
| 35 | - if( !isset( $this->fs ) ) { |
|
| 36 | - $this->fs = new Filesystem( new SftpAdapter( $this->getConfig() ) ); |
|
| 35 | + if (!isset($this->fs)) { |
|
| 36 | + $this->fs = new Filesystem(new SftpAdapter($this->getConfig())); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | return $this->fs; |
@@ -32,13 +32,13 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | protected function getProvider() |
| 34 | 34 | { |
| 35 | - if( !isset( $this->fs ) ) |
|
| 35 | + if (!isset($this->fs)) |
|
| 36 | 36 | { |
| 37 | 37 | $config = $this->getConfig(); |
| 38 | - $prefix = ( isset( $config['prefix'] ) ? $config['prefix'] : null ); |
|
| 38 | + $prefix = (isset($config['prefix']) ? $config['prefix'] : null); |
|
| 39 | 39 | |
| 40 | - $client = new \Sabre\DAV\Client( $config ); |
|
| 41 | - $this->fs = new Filesystem( new WebDAVAdapter( $client, $prefix ) ); |
|
| 40 | + $client = new \Sabre\DAV\Client($config); |
|
| 41 | + $this->fs = new Filesystem(new WebDAVAdapter($client, $prefix)); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | return $this->fs; |
@@ -32,15 +32,15 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | protected function getProvider() |
| 34 | 34 | { |
| 35 | - if( !isset( $this->fs ) ) |
|
| 35 | + if (!isset($this->fs)) |
|
| 36 | 36 | { |
| 37 | 37 | $config = $this->getConfig(); |
| 38 | 38 | |
| 39 | - if( !isset( $config['filepath'] ) ) { |
|
| 40 | - throw new Exception( sprintf( 'Configuration option "%1$s" missing', 'filepath' ) ); |
|
| 39 | + if (!isset($config['filepath'])) { |
|
| 40 | + throw new Exception(sprintf('Configuration option "%1$s" missing', 'filepath')); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - $this->fs = new Filesystem( new ZipArchiveAdapter( $config['filepath'] ) ); |
|
| 43 | + $this->fs = new Filesystem(new ZipArchiveAdapter($config['filepath'])); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return $this->fs; |
@@ -7,21 +7,21 @@ |
||
| 7 | 7 | { |
| 8 | 8 | protected function setUp() |
| 9 | 9 | { |
| 10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
| 11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
| 10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
| 11 | + $this->markTestSkipped('Install Flysystem first'); |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | public function testGetProvider() |
| 17 | 17 | { |
| 18 | - if( !class_exists( '\League\Flysystem\Azure\AzureAdapter' ) ) { |
|
| 19 | - $this->markTestSkipped( 'Install Flysystem Azure adapter' ); |
|
| 18 | + if (!class_exists('\League\Flysystem\Azure\AzureAdapter')) { |
|
| 19 | + $this->markTestSkipped('Install Flysystem Azure adapter'); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - $object = new FlyAzure( array() ); |
|
| 23 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
| 22 | + $object = new FlyAzure(array()); |
|
| 23 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
| 24 | 24 | |
| 25 | - $object->has( 'test' ); |
|
| 25 | + $object->has('test'); |
|
| 26 | 26 | } |
| 27 | 27 | } |
@@ -7,21 +7,21 @@ |
||
| 7 | 7 | { |
| 8 | 8 | protected function setUp() |
| 9 | 9 | { |
| 10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
| 11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
| 10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
| 11 | + $this->markTestSkipped('Install Flysystem first'); |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | public function testGetProvider() |
| 17 | 17 | { |
| 18 | - if( !class_exists( '\League\Flysystem\Sftp\SftpAdapter' ) ) { |
|
| 19 | - $this->markTestSkipped( 'Install Flysystem SFTP adapter' ); |
|
| 18 | + if (!class_exists('\League\Flysystem\Sftp\SftpAdapter')) { |
|
| 19 | + $this->markTestSkipped('Install Flysystem SFTP adapter'); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - $object = new FlySftp( array( 'host' => 'test.rebex.net', 'username' => 'demo', 'password' => 'password' ) ); |
|
| 23 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
| 22 | + $object = new FlySftp(array('host' => 'test.rebex.net', 'username' => 'demo', 'password' => 'password')); |
|
| 23 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
| 24 | 24 | |
| 25 | - $object->has( 'test' ); |
|
| 25 | + $object->has('test'); |
|
| 26 | 26 | } |
| 27 | 27 | } |
@@ -7,17 +7,17 @@ |
||
| 7 | 7 | { |
| 8 | 8 | protected function setUp() |
| 9 | 9 | { |
| 10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
| 11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
| 10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
| 11 | + $this->markTestSkipped('Install Flysystem first'); |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | public function testGetProvider() |
| 17 | 17 | { |
| 18 | - $object = new FlyNone( array() ); |
|
| 19 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
| 18 | + $object = new FlyNone(array()); |
|
| 19 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
| 20 | 20 | |
| 21 | - $object->has( 'test' ); |
|
| 21 | + $object->has('test'); |
|
| 22 | 22 | } |
| 23 | 23 | } |
@@ -7,35 +7,35 @@ |
||
| 7 | 7 | { |
| 8 | 8 | protected function setUp() |
| 9 | 9 | { |
| 10 | - if( !interface_exists( '\\League\\Flysystem\\FilesystemInterface' ) ) { |
|
| 11 | - $this->markTestSkipped( 'Install Flysystem first' ); |
|
| 10 | + if (!interface_exists('\\League\\Flysystem\\FilesystemInterface')) { |
|
| 11 | + $this->markTestSkipped('Install Flysystem first'); |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | public function testGetProvider() |
| 17 | 17 | { |
| 18 | - if( !class_exists( '\League\Flysystem\ZipArchive\ZipArchiveAdapter' ) ) { |
|
| 19 | - $this->markTestSkipped( 'Install Flysystem ZipArchive adapter' ); |
|
| 18 | + if (!class_exists('\League\Flysystem\ZipArchive\ZipArchiveAdapter')) { |
|
| 19 | + $this->markTestSkipped('Install Flysystem ZipArchive adapter'); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - $object = new FlyZip( array() ); |
|
| 23 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
| 22 | + $object = new FlyZip(array()); |
|
| 23 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
| 24 | 24 | |
| 25 | - $this->setExpectedException( '\Aimeos\MW\Filesystem\Exception' ); |
|
| 26 | - $object->has( 'test' ); |
|
| 25 | + $this->setExpectedException('\Aimeos\MW\Filesystem\Exception'); |
|
| 26 | + $object->has('test'); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | public function testGetProviderFilepath() |
| 31 | 31 | { |
| 32 | - if( !class_exists( '\League\Flysystem\ZipArchive\ZipArchiveAdapter' ) ) { |
|
| 33 | - $this->markTestSkipped( 'Install Flysystem ZipArchive adapter' ); |
|
| 32 | + if (!class_exists('\League\Flysystem\ZipArchive\ZipArchiveAdapter')) { |
|
| 33 | + $this->markTestSkipped('Install Flysystem ZipArchive adapter'); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $object = new FlyZip( array( 'filepath' => '/tmp/flytest.zip' ) ); |
|
| 37 | - $this->assertInstanceof( '\Aimeos\MW\Filesystem\Iface', $object ); |
|
| 36 | + $object = new FlyZip(array('filepath' => '/tmp/flytest.zip')); |
|
| 37 | + $this->assertInstanceof('\Aimeos\MW\Filesystem\Iface', $object); |
|
| 38 | 38 | |
| 39 | - $object->has( 'test' ); |
|
| 39 | + $object->has('test'); |
|
| 40 | 40 | } |
| 41 | 41 | } |