@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Gaufrette\Adapter; |
| 6 | 6 | use Gaufrette\Util; |
| 7 | 7 | use Gaufrette\Adapter\AzureBlobStorage\BlobProxyFactoryInterface; |
| 8 | - |
|
| 9 | 8 | use WindowsAzure\Blob\Models\CreateBlobOptions; |
| 10 | 9 | use WindowsAzure\Blob\Models\CreateContainerOptions; |
| 11 | 10 | use WindowsAzure\Blob\Models\DeleteContainerOptions; |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Gaufrette\Adapter; |
| 4 | 4 | |
| 5 | -use Gaufrette\File; |
|
| 6 | 5 | use Gaufrette\Adapter; |
| 7 | 6 | use Gaufrette\Adapter\InMemory as InMemoryAdapter; |
| 8 | 7 | |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Gaufrette\Adapter; |
| 6 | 6 | use Gaufrette\Util; |
| 7 | - |
|
| 8 | 7 | use Doctrine\DBAL\Connection; |
| 9 | 8 | |
| 10 | 9 | /** |
@@ -186,7 +186,7 @@ |
||
| 186 | 186 | |
| 187 | 187 | return array( |
| 188 | 188 | 'dirs' => array(), |
| 189 | - 'keys' => array_map(function ($value) { |
|
| 189 | + 'keys' => array_map(function($value) { |
|
| 190 | 190 | return $value['_key']; |
| 191 | 191 | }, |
| 192 | 192 | $keys) |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Gaufrette\Adapter; |
| 6 | 6 | use Gaufrette\File; |
| 7 | 7 | use Gaufrette\Filesystem; |
| 8 | -use Gaufrette\Exception; |
|
| 9 | 8 | |
| 10 | 9 | /** |
| 11 | 10 | * Ftp adapter |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $this->ensureDirectoryExists($this->directory, $this->create); |
| 124 | 124 | |
| 125 | 125 | $file = $this->computePath($key); |
| 126 | - $lines = ftp_rawlist($this->getConnection(), '-al ' . str_replace('\\', '/', dirname($file))); |
|
| 126 | + $lines = ftp_rawlist($this->getConnection(), '-al '.str_replace('\\', '/', dirname($file))); |
|
| 127 | 127 | |
| 128 | 128 | if (false === $lines) { |
| 129 | 129 | return false; |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory); |
| 237 | 237 | |
| 238 | 238 | $items = $this->parseRawlist( |
| 239 | - ftp_rawlist($this->getConnection(), '-al ' . $this->directory . $directory ) ? : array() |
|
| 239 | + ftp_rawlist($this->getConnection(), '-al '.$this->directory.$directory) ?: array() |
|
| 240 | 240 | ); |
| 241 | 241 | |
| 242 | 242 | $fileData = $dirs = array(); |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | |
| 249 | 249 | $item = array( |
| 250 | 250 | 'name' => $itemData['name'], |
| 251 | - 'path' => trim(($directory ? $directory . '/' : '') . $itemData['name'], '/'), |
|
| 251 | + 'path' => trim(($directory ? $directory.'/' : '').$itemData['name'], '/'), |
|
| 252 | 252 | 'time' => $itemData['time'], |
| 253 | 253 | 'size' => $itemData['size'], |
| 254 | 254 | ); |
@@ -360,13 +360,13 @@ discard block |
||
| 360 | 360 | { |
| 361 | 361 | $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory); |
| 362 | 362 | |
| 363 | - $lines = ftp_rawlist($this->getConnection(), '-alR '. $this->directory . $directory); |
|
| 363 | + $lines = ftp_rawlist($this->getConnection(), '-alR '.$this->directory.$directory); |
|
| 364 | 364 | |
| 365 | 365 | if (false === $lines) { |
| 366 | 366 | return array('keys' => array(), 'dirs' => array()); |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - $regexDir = '/'.preg_quote($this->directory . $directory, '/').'\/?(.+):$/u'; |
|
| 369 | + $regexDir = '/'.preg_quote($this->directory.$directory, '/').'\/?(.+):$/u'; |
|
| 370 | 370 | $regexItem = '/^(?:([d\-\d])\S+)\s+\S+(?:(?:\s+\S+){5})?\s+(\S+)\s+(.+?)$/'; |
| 371 | 371 | |
| 372 | 372 | $prevLine = null; |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | continue; |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | - $path = ltrim($directory . '/' . $name, '/'); |
|
| 393 | + $path = ltrim($directory.'/'.$name, '/'); |
|
| 394 | 394 | |
| 395 | 395 | if ('d' === $tokens[1] || '<dir>' === $tokens[2]) { |
| 396 | 396 | $keys['dirs'][] = $path; |
@@ -430,13 +430,13 @@ discard block |
||
| 430 | 430 | $infos = preg_split("/[\s]+/", $line, 9); |
| 431 | 431 | |
| 432 | 432 | if ($this->isLinuxListing($infos)) { |
| 433 | - $infos[7] = (strrpos($infos[7], ':') != 2 ) ? ($infos[7] . ' 00:00') : (date('Y') . ' ' . $infos[7]); |
|
| 433 | + $infos[7] = (strrpos($infos[7], ':') != 2) ? ($infos[7].' 00:00') : (date('Y').' '.$infos[7]); |
|
| 434 | 434 | if ('total' !== $infos[0]) { |
| 435 | 435 | $parsed[] = array( |
| 436 | 436 | 'perms' => $infos[0], |
| 437 | 437 | 'num' => $infos[1], |
| 438 | 438 | 'size' => $infos[4], |
| 439 | - 'time' => strtotime($infos[5] . ' ' . $infos[6] . '. ' . $infos[7]), |
|
| 439 | + 'time' => strtotime($infos[5].' '.$infos[6].'. '.$infos[7]), |
|
| 440 | 440 | 'name' => $infos[8] |
| 441 | 441 | ); |
| 442 | 442 | } |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | 'perms' => $isDir ? 'd' : '-', |
| 447 | 447 | 'num' => '', |
| 448 | 448 | 'size' => $isDir ? '' : $infos[2], |
| 449 | - 'time' => strtotime($infos[0] . ' ' . $infos[1]), |
|
| 449 | + 'time' => strtotime($infos[0].' '.$infos[1]), |
|
| 450 | 450 | 'name' => $infos[3] |
| 451 | 451 | ); |
| 452 | 452 | } |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | */ |
| 463 | 463 | private function computePath($key) |
| 464 | 464 | { |
| 465 | - return rtrim($this->directory, '/') . '/' . $key; |
|
| 465 | + return rtrim($this->directory, '/').'/'.$key; |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | /** |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | if (!$this->ssl) { |
| 502 | 502 | $this->connection = ftp_connect($this->host, $this->port); |
| 503 | 503 | } else { |
| 504 | - if(function_exists('ftp_ssl_connect')) { |
|
| 504 | + if (function_exists('ftp_ssl_connect')) { |
|
| 505 | 505 | $this->connection = ftp_ssl_connect($this->host, $this->port); |
| 506 | 506 | } else { |
| 507 | 507 | throw new \RuntimeException('This Server Has No SSL-FTP Available.'); |
@@ -511,8 +511,8 @@ discard block |
||
| 511 | 511 | throw new \RuntimeException(sprintf('Could not connect to \'%s\' (port: %s).', $this->host, $this->port)); |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | - $username = $this->username ? : 'anonymous'; |
|
| 515 | - $password = $this->password ? : ''; |
|
| 514 | + $username = $this->username ?: 'anonymous'; |
|
| 515 | + $password = $this->password ?: ''; |
|
| 516 | 516 | |
| 517 | 517 | // login ftp user |
| 518 | 518 | if (!@ftp_login($this->connection, $username, $password)) { |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | static::streamWrapperUnregister($scheme); |
| 49 | 49 | |
| 50 | - if (! static::streamWrapperRegister($scheme, __CLASS__)) { |
|
| 50 | + if (!static::streamWrapperRegister($scheme, __CLASS__)) { |
|
| 51 | 51 | throw new \RuntimeException(sprintf( |
| 52 | 52 | 'Could not register stream wrapper class %s for scheme %s.', |
| 53 | 53 | __CLASS__, |
@@ -251,11 +251,11 @@ discard block |
||
| 251 | 251 | $key = substr($parts['path'], 1); |
| 252 | 252 | |
| 253 | 253 | if (null !== $parts['query']) { |
| 254 | - $key.= '?' . $parts['query']; |
|
| 254 | + $key .= '?'.$parts['query']; |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | if (null !== $parts['fragment']) { |
| 258 | - $key.= '#' . $parts['fragment']; |
|
| 258 | + $key .= '#'.$parts['fragment']; |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | if (empty($domain) || empty($key)) { |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - return $prefix . implode('/', $tokens); |
|
| 44 | + return $prefix.implode('/', $tokens); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function set($domain, Filesystem $filesystem) |
| 35 | 35 | { |
| 36 | - if (! preg_match('/^[-_a-zA-Z0-9]+$/', $domain)) { |
|
| 36 | + if (!preg_match('/^[-_a-zA-Z0-9]+$/', $domain)) { |
|
| 37 | 37 | throw new \InvalidArgumentException(sprintf( |
| 38 | 38 | 'The specified domain "%s" is not a valid domain.', |
| 39 | 39 | $domain |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function get($domain) |
| 70 | 70 | { |
| 71 | - if (! $this->has($domain)) { |
|
| 71 | + if (!$this->has($domain)) { |
|
| 72 | 72 | throw new \InvalidArgumentException(sprintf( |
| 73 | 73 | 'There is no filesystem defined for the "%s" domain.', |
| 74 | 74 | $domain |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function remove($domain) |
| 89 | 89 | { |
| 90 | - if (! $this->has($domain)) { |
|
| 90 | + if (!$this->has($domain)) { |
|
| 91 | 91 | throw new \InvalidArgumentException(sprintf( |
| 92 | 92 | 'Cannot remove the "%s" filesystem as it is not defined.', |
| 93 | 93 | $domain |
@@ -72,11 +72,11 @@ discard block |
||
| 72 | 72 | throw new Exception\UnexpectedFile($targetKey); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if (! $this->adapter->rename($sourceKey, $targetKey)) { |
|
| 75 | + if (!$this->adapter->rename($sourceKey, $targetKey)) { |
|
| 76 | 76 | throw new \RuntimeException(sprintf('Could not rename the "%s" key to "%s".', $sourceKey, $targetKey)); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - if($this->isFileInRegister($sourceKey)) { |
|
| 79 | + if ($this->isFileInRegister($sourceKey)) { |
|
| 80 | 80 | $this->fileRegister[$targetKey] = $this->fileRegister[$sourceKey]; |
| 81 | 81 | unset($this->fileRegister[$sourceKey]); |
| 82 | 82 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | */ |
| 289 | 289 | public function createFile($key) |
| 290 | 290 | { |
| 291 | - if(false === $this->isFileInRegister($key)) { |
|
| 291 | + if (false === $this->isFileInRegister($key)) { |
|
| 292 | 292 | if ($this->adapter instanceof Adapter\FileFactory) { |
| 293 | 293 | $this->fileRegister[$key] = $this->adapter->createFile($key, $this); |
| 294 | 294 | } else { |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | */ |
| 333 | 333 | private function assertHasFile($key) |
| 334 | 334 | { |
| 335 | - if (! empty($key) && ! $this->has($key)) { |
|
| 335 | + if (!empty($key) && !$this->has($key)) { |
|
| 336 | 336 | throw new Exception\FileNotFound($key); |
| 337 | 337 | } |
| 338 | 338 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | public function __construct(Filesystem $filesystem, $key) |
| 27 | 27 | { |
| 28 | 28 | $this->filesystem = $filesystem; |
| 29 | - $this->key = $key; |
|
| 29 | + $this->key = $key; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $chunk = substr($this->content, $this->position, $count); |
| 69 | - $this->position+= Util\Size::fromContent($chunk); |
|
| 69 | + $this->position += Util\Size::fromContent($chunk); |
|
| 70 | 70 | |
| 71 | 71 | return $chunk; |
| 72 | 72 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } else { |
| 92 | 92 | $before = substr($this->content, 0, $this->position); |
| 93 | 93 | $after = $newNumBytes > $newPosition ? substr($this->content, $newPosition) : ''; |
| 94 | - $this->content = $before . $data . $after; |
|
| 94 | + $this->content = $before.$data.$after; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | $this->position = $newPosition; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | public function close() |
| 105 | 105 | { |
| 106 | - if (! $this->synchronized) { |
|
| 106 | + if (!$this->synchronized) { |
|
| 107 | 107 | $this->flush(); |
| 108 | 108 | } |
| 109 | 109 | } |