@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | throw new \Exception('missing IObjectStore instance'); |
56 | 56 | } |
57 | 57 | if (isset($params['storageid'])) { |
58 | - $this->id = 'object::store:' . $params['storageid']; |
|
58 | + $this->id = 'object::store:'.$params['storageid']; |
|
59 | 59 | } else { |
60 | - $this->id = 'object::store:' . $this->objectStore->getStorageId(); |
|
60 | + $this->id = 'object::store:'.$this->objectStore->getStorageId(); |
|
61 | 61 | } |
62 | 62 | if (isset($params['objectPrefix'])) { |
63 | 63 | $this->objectPrefix = $params['objectPrefix']; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | if ($ex->getCode() !== 404) { |
192 | 192 | $this->logger->logException($ex, [ |
193 | 193 | 'app' => 'objectstore', |
194 | - 'message' => 'Could not delete object ' . $this->getURN($stat['fileid']) . ' for ' . $path, |
|
194 | + 'message' => 'Could not delete object '.$this->getURN($stat['fileid']).' for '.$path, |
|
195 | 195 | ]); |
196 | 196 | return false; |
197 | 197 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | */ |
224 | 224 | protected function getURN($fileId) { |
225 | 225 | if (is_numeric($fileId)) { |
226 | - return $this->objectPrefix . $fileId; |
|
226 | + return $this->objectPrefix.$fileId; |
|
227 | 227 | } |
228 | 228 | return null; |
229 | 229 | } |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } catch (\Exception $ex) { |
272 | 272 | $this->logger->logException($ex, [ |
273 | 273 | 'app' => 'objectstore', |
274 | - 'message' => 'Count not get object ' . $this->getURN($stat['fileid']) . ' for file ' . $path, |
|
274 | + 'message' => 'Count not get object '.$this->getURN($stat['fileid']).' for file '.$path, |
|
275 | 275 | ]); |
276 | 276 | return false; |
277 | 277 | } |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | file_put_contents($tmpFile, $source); |
302 | 302 | } |
303 | 303 | $handle = fopen($tmpFile, $mode); |
304 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
304 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
305 | 305 | $this->writeBack($tmpFile, $path); |
306 | 306 | }); |
307 | 307 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | |
311 | 311 | public function file_exists($path) { |
312 | 312 | $path = $this->normalizePath($path); |
313 | - return (bool)$this->stat($path); |
|
313 | + return (bool) $this->stat($path); |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | public function rename($source, $target) { |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | } catch (\Exception $ex) { |
368 | 368 | $this->logger->logException($ex, [ |
369 | 369 | 'app' => 'objectstore', |
370 | - 'message' => 'Could not create object for ' . $path, |
|
370 | + 'message' => 'Could not create object for '.$path, |
|
371 | 371 | ]); |
372 | 372 | throw $ex; |
373 | 373 | } |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | $this->getCache()->remove($path); |
408 | 408 | $this->logger->logException($ex, [ |
409 | 409 | 'app' => 'objectstore', |
410 | - 'message' => 'Could not create object ' . $this->getURN($fileId) . ' for ' . $path, |
|
410 | + 'message' => 'Could not create object '.$this->getURN($fileId).' for '.$path, |
|
411 | 411 | ]); |
412 | 412 | throw $ex; // make this bubble up |
413 | 413 | } |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | |
77 | 77 | if (isset($params['apiKey'])) { |
78 | 78 | $this->client = new Rackspace($params['url'], $params); |
79 | - $cacheKey = $params['username'] . '@' . $params['url'] . '/' . $params['bucket']; |
|
79 | + $cacheKey = $params['username'].'@'.$params['url'].'/'.$params['bucket']; |
|
80 | 80 | } else { |
81 | 81 | $this->client = new OpenStack($params['url'], $params); |
82 | - $cacheKey = $params['username'] . '@' . $params['url'] . '/' . $params['bucket']; |
|
82 | + $cacheKey = $params['username'].'@'.$params['url'].'/'.$params['bucket']; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | $cacheFactory = \OC::$server->getMemCacheFactory(); |
86 | - $this->memcache = $cacheFactory->createDistributed('swift::' . $cacheKey); |
|
86 | + $this->memcache = $cacheFactory->createDistributed('swift::'.$cacheKey); |
|
87 | 87 | |
88 | 88 | $this->params = $params; |
89 | 89 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | } catch (CurlException $e) { |
162 | 162 | if ($e->getErrorNo() === 7) { |
163 | - $host = $e->getCurlHandle()->getUrl()->getHost() . ':' . $e->getCurlHandle()->getUrl()->getPort(); |
|
163 | + $host = $e->getCurlHandle()->getUrl()->getHost().':'.$e->getCurlHandle()->getUrl()->getPort(); |
|
164 | 164 | \OC::$server->getLogger()->error("Can't connect to object storage server at $host"); |
165 | 165 | throw new StorageNotAvailableException("Can't connect to object storage server at $host", StorageNotAvailableException::STATUS_ERROR, $e); |
166 | 166 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | private function exportToken() { |
172 | 172 | $export = $this->client->exportCredentials(); |
173 | - $export['catalog'] = array_map(function (CatalogItem $item) { |
|
173 | + $export['catalog'] = array_map(function(CatalogItem $item) { |
|
174 | 174 | return [ |
175 | 175 | 'name' => $item->getName(), |
176 | 176 | 'endpoints' => $item->getEndpoints(), |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | $cachedTokenString = $this->memcache->get('token'); |
185 | 185 | if ($cachedTokenString) { |
186 | 186 | $cachedToken = json_decode($cachedTokenString, true); |
187 | - $cachedToken['catalog'] = array_map(function (array $item) { |
|
187 | + $cachedToken['catalog'] = array_map(function(array $item) { |
|
188 | 188 | $itemClass = new \stdClass(); |
189 | 189 | $itemClass->name = $item['name']; |
190 | - $itemClass->endpoints = array_map(function (array $endpoint) { |
|
191 | - return (object)$endpoint; |
|
190 | + $itemClass->endpoints = array_map(function(array $endpoint) { |
|
191 | + return (object) $endpoint; |
|
192 | 192 | }, $item['endpoints']); |
193 | 193 | $itemClass->type = $item['type']; |
194 | 194 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | } |
227 | 227 | } |
228 | 228 | |
229 | - $availableRegions = implode(', ', array_map(function ($endpoint) { |
|
229 | + $availableRegions = implode(', ', array_map(function($endpoint) { |
|
230 | 230 | return $endpoint->region; |
231 | 231 | }, $endPoints)); |
232 | 232 | |
@@ -234,9 +234,9 @@ discard block |
||
234 | 234 | } |
235 | 235 | |
236 | 236 | private function getAvailableServiceNames(Catalog $catalog) { |
237 | - return array_map(function (CatalogItem $item) { |
|
237 | + return array_map(function(CatalogItem $item) { |
|
238 | 238 | return $item->getName(); |
239 | - }, array_filter($catalog->getItems(), function (CatalogItem $item) { |
|
239 | + }, array_filter($catalog->getItems(), function(CatalogItem $item) { |
|
240 | 240 | return $item->hasType(Service::DEFAULT_TYPE); |
241 | 241 | })); |
242 | 242 | } |