@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | // we catch the exception to prevent breaking the whole list with a 404 |
112 | 112 | // (soft fail) |
113 | 113 | \OC::$server->getLogger()->warning( |
114 | - 'Could not get node for path: \"' . $path . '\" : ' . $e->getMessage(), |
|
114 | + 'Could not get node for path: \"'.$path.'\" : '.$e->getMessage(), |
|
115 | 115 | array('app' => 'files') |
116 | 116 | ); |
117 | 117 | return; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $statement = $this->connection->prepare( |
171 | 171 | 'DELETE FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?' |
172 | 172 | ); |
173 | - $statement->execute(array($this->user, '/' . $path)); |
|
173 | + $statement->execute(array($this->user, '/'.$path)); |
|
174 | 174 | $statement->closeCursor(); |
175 | 175 | |
176 | 176 | unset($this->cache[$path]); |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function move($source, $destination) { |
188 | 188 | $statement = $this->connection->prepare( |
189 | - 'UPDATE `*PREFIX*properties` SET `propertypath` = ?' . |
|
189 | + 'UPDATE `*PREFIX*properties` SET `propertypath` = ?'. |
|
190 | 190 | ' WHERE `userid` = ? AND `propertypath` = ?' |
191 | 191 | ); |
192 | - $statement->execute(array('/' . $destination, $this->user, '/' . $source)); |
|
192 | + $statement->execute(array('/'.$destination, $this->user, '/'.$source)); |
|
193 | 193 | $statement->closeCursor(); |
194 | 194 | } |
195 | 195 | |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | private function updateProperties($node, $properties) { |
251 | 251 | $path = $node->getPath(); |
252 | 252 | |
253 | - $deleteStatement = 'DELETE FROM `*PREFIX*properties`' . |
|
253 | + $deleteStatement = 'DELETE FROM `*PREFIX*properties`'. |
|
254 | 254 | ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?'; |
255 | 255 | |
256 | - $insertStatement = 'INSERT INTO `*PREFIX*properties`' . |
|
256 | + $insertStatement = 'INSERT INTO `*PREFIX*properties`'. |
|
257 | 257 | ' (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)'; |
258 | 258 | |
259 | - $updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?' . |
|
259 | + $updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?'. |
|
260 | 260 | ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?'; |
261 | 261 | |
262 | 262 | // TODO: use "insert or update" strategy ? |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | |
330 | 330 | $result = $this->connection->executeQuery( |
331 | 331 | $sql, |
332 | - array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')) . '/%', $requestedProperties), |
|
332 | + array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')).'/%', $requestedProperties), |
|
333 | 333 | array(null, null, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY) |
334 | 334 | ); |
335 | 335 |
@@ -114,6 +114,6 @@ |
||
114 | 114 | 'Line' => $ex->getLine(), |
115 | 115 | 'User' => $user, |
116 | 116 | ]; |
117 | - $this->logger->log($level, 'Exception: ' . json_encode($exception), ['app' => $this->appName]); |
|
117 | + $this->logger->log($level, 'Exception: '.json_encode($exception), ['app' => $this->appName]); |
|
118 | 118 | } |
119 | 119 | } |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | |
51 | 51 | function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) { |
52 | 52 | $access = parent::checkPrivileges($uri, $privileges, $recursion, false); |
53 | - if($access === false && $throwExceptions) { |
|
53 | + if ($access === false && $throwExceptions) { |
|
54 | 54 | /** @var INode $node */ |
55 | 55 | $node = $this->server->tree->getNodeForPath($uri); |
56 | 56 | |
57 | - switch(get_class($node)) { |
|
57 | + switch (get_class($node)) { |
|
58 | 58 | case 'OCA\DAV\CardDAV\AddressBook': |
59 | 59 | $type = 'Addressbook'; |
60 | 60 | break; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | public function propFind(PropFind $propFind, INode $node) { |
78 | 78 | // If the node is neither readable nor writable then fail unless its of |
79 | 79 | // the standard user-principal |
80 | - if(!($node instanceof User)) { |
|
80 | + if (!($node instanceof User)) { |
|
81 | 81 | $path = $propFind->getPath(); |
82 | 82 | $readPermissions = $this->checkPrivileges($path, '{DAV:}read', self::R_PARENT, false); |
83 | 83 | $writePermissions = $this->checkPrivileges($path, '{DAV:}write', self::R_PARENT, false); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function move($source, $destination) { |
153 | 153 | $statement = $this->connection->prepare( |
154 | - 'UPDATE `*PREFIX*properties` SET `propertypath` = ?' . |
|
154 | + 'UPDATE `*PREFIX*properties` SET `propertypath` = ?'. |
|
155 | 155 | ' WHERE `userid` = ? AND `propertypath` = ?' |
156 | 156 | ); |
157 | 157 | $statement->execute(array($destination, $this->user, $source)); |
@@ -213,13 +213,13 @@ discard block |
||
213 | 213 | */ |
214 | 214 | private function updateProperties($path, $properties) { |
215 | 215 | |
216 | - $deleteStatement = 'DELETE FROM `*PREFIX*properties`' . |
|
216 | + $deleteStatement = 'DELETE FROM `*PREFIX*properties`'. |
|
217 | 217 | ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?'; |
218 | 218 | |
219 | - $insertStatement = 'INSERT INTO `*PREFIX*properties`' . |
|
219 | + $insertStatement = 'INSERT INTO `*PREFIX*properties`'. |
|
220 | 220 | ' (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)'; |
221 | 221 | |
222 | - $updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?' . |
|
222 | + $updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?'. |
|
223 | 223 | ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?'; |
224 | 224 | |
225 | 225 | // TODO: use "insert or update" strategy ? |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $server->on('beforeMethod', [$this, 'beforeMethod']); |
56 | 56 | } |
57 | 57 | |
58 | - public function beforeMethod(RequestInterface $request, ResponseInterface $response){ |
|
58 | + public function beforeMethod(RequestInterface $request, ResponseInterface $response) { |
|
59 | 59 | // verify that the owner didn't have his share permissions revoked |
60 | 60 | if ($this->fileInfo && !$this->fileInfo->isShareable()) { |
61 | 61 | throw new NotFound(); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | function createDirectory($name) { |
43 | - throw new Forbidden('Permission denied to create file (filename ' . $name . ')'); |
|
43 | + throw new Forbidden('Permission denied to create file (filename '.$name.')'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | function getChild($name) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | function createFile($name, $data = null) { |
42 | - throw new Forbidden('Permission denied to create file (filename ' . $name . ')'); |
|
42 | + throw new Forbidden('Permission denied to create file (filename '.$name.')'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | function createDirectory($name) { |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | $rootView = new View(); |
84 | 84 | $user = \OC::$server->getUserSession()->getUser(); |
85 | 85 | Filesystem::initMountPoints($user->getUID()); |
86 | - if (!$rootView->file_exists('/' . $user->getUID() . '/uploads')) { |
|
87 | - $rootView->mkdir('/' . $user->getUID() . '/uploads'); |
|
86 | + if (!$rootView->file_exists('/'.$user->getUID().'/uploads')) { |
|
87 | + $rootView->mkdir('/'.$user->getUID().'/uploads'); |
|
88 | 88 | } |
89 | - $view = new View('/' . $user->getUID() . '/uploads'); |
|
89 | + $view = new View('/'.$user->getUID().'/uploads'); |
|
90 | 90 | $rootInfo = $view->getFileInfo(''); |
91 | 91 | $impl = new Directory($view, $rootInfo); |
92 | 92 | return $impl; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | // build additional information |
75 | 75 | $this->sortedNodes = []; |
76 | 76 | $start = 0; |
77 | - foreach($this->nodes as $node) { |
|
77 | + foreach ($this->nodes as $node) { |
|
78 | 78 | $size = $node->getSize(); |
79 | 79 | $name = $node->getName(); |
80 | 80 | $this->sortedNodes[$name] = ['node' => $node, 'start' => $start, 'end' => $start + $size]; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | if (isset($context[$name])) { |
217 | 217 | $context = $context[$name]; |
218 | 218 | } else { |
219 | - throw new \BadMethodCallException('Invalid context, "' . $name . '" options not set'); |
|
219 | + throw new \BadMethodCallException('Invalid context, "'.$name.'" options not set'); |
|
220 | 220 | } |
221 | 221 | if (isset($context['nodes']) and is_array($context['nodes'])) { |
222 | 222 | $this->nodes = $context['nodes']; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | * @return IFile | null |
254 | 254 | */ |
255 | 255 | private function getNodeForPosition($pos) { |
256 | - foreach($this->sortedNodes as $node) { |
|
256 | + foreach ($this->sortedNodes as $node) { |
|
257 | 257 | if ($pos >= $node['start'] && $pos < $node['end']) { |
258 | 258 | return [$node['node'], $pos - $node['start']]; |
259 | 259 | } |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | return $data; |
272 | 272 | } |
273 | 273 | |
274 | - return fopen('data://text/plain,' . $data,'r'); |
|
274 | + return fopen('data://text/plain,'.$data, 'r'); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | } |
@@ -109,6 +109,6 @@ |
||
109 | 109 | |
110 | 110 | } |
111 | 111 | |
112 | - throw new NotFound('Node with name \'' . $name . '\' could not be found'); |
|
112 | + throw new NotFound('Node with name \''.$name.'\' could not be found'); |
|
113 | 113 | } |
114 | 114 | } |