@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | $rootView = new View(); |
52 | 52 | $user = \OC::$server->getUserSession()->getUser(); |
53 | 53 | Filesystem::initMountPoints($user->getUID()); |
54 | - if (!$rootView->file_exists('/' . $user->getUID() . '/cache')) { |
|
55 | - $rootView->mkdir('/' . $user->getUID() . '/cache'); |
|
54 | + if (!$rootView->file_exists('/'.$user->getUID().'/cache')) { |
|
55 | + $rootView->mkdir('/'.$user->getUID().'/cache'); |
|
56 | 56 | } |
57 | - $this->storage = new View('/' . $user->getUID() . '/cache'); |
|
57 | + $this->storage = new View('/'.$user->getUID().'/cache'); |
|
58 | 58 | return $this->storage; |
59 | 59 | } else { |
60 | 60 | \OCP\Util::writeLog('core', 'Can\'t get cache storage, user not logged in', \OCP\Util::ERROR); |
@@ -104,12 +104,12 @@ discard block |
||
104 | 104 | // unique id to avoid chunk collision, just in case |
105 | 105 | $uniqueId = \OC::$server->getSecureRandom()->generate( |
106 | 106 | 16, |
107 | - ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER |
|
107 | + ISecureRandom::CHAR_DIGITS.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER |
|
108 | 108 | ); |
109 | 109 | |
110 | 110 | // use part file to prevent hasKey() to find the key |
111 | 111 | // while it is being written |
112 | - $keyPart = $key . '.' . $uniqueId . '.part'; |
|
112 | + $keyPart = $key.'.'.$uniqueId.'.part'; |
|
113 | 113 | if ($storage and $storage->file_put_contents($keyPart, $value)) { |
114 | 114 | if ($ttl === 0) { |
115 | 115 | $ttl = 86400; // 60*60*24 |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | if (is_resource($dh)) { |
159 | 159 | while (($file = readdir($dh)) !== false) { |
160 | 160 | if ($file != '.' and $file != '..' and ($prefix === '' || strpos($file, $prefix) === 0)) { |
161 | - $storage->unlink('/' . $file); |
|
161 | + $storage->unlink('/'.$file); |
|
162 | 162 | } |
163 | 163 | } |
164 | 164 | } |
@@ -183,17 +183,17 @@ discard block |
||
183 | 183 | while (($file = readdir($dh)) !== false) { |
184 | 184 | if ($file != '.' and $file != '..') { |
185 | 185 | try { |
186 | - $mtime = $storage->filemtime('/' . $file); |
|
186 | + $mtime = $storage->filemtime('/'.$file); |
|
187 | 187 | if ($mtime < $now) { |
188 | - $storage->unlink('/' . $file); |
|
188 | + $storage->unlink('/'.$file); |
|
189 | 189 | } |
190 | 190 | } catch (\OCP\Lock\LockedException $e) { |
191 | 191 | // ignore locked chunks |
192 | - \OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', array('app' => 'core')); |
|
192 | + \OC::$server->getLogger()->debug('Could not cleanup locked chunk "'.$file.'"', array('app' => 'core')); |
|
193 | 193 | } catch (\OCP\Files\ForbiddenException $e) { |
194 | - \OC::$server->getLogger()->debug('Could not cleanup forbidden chunk "' . $file . '"', array('app' => 'core')); |
|
194 | + \OC::$server->getLogger()->debug('Could not cleanup forbidden chunk "'.$file.'"', array('app' => 'core')); |
|
195 | 195 | } catch (\OCP\Files\LockNotAcquiredException $e) { |
196 | - \OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', array('app' => 'core')); |
|
196 | + \OC::$server->getLogger()->debug('Could not cleanup locked chunk "'.$file.'"', array('app' => 'core')); |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 | } |
@@ -231,7 +231,7 @@ |
||
231 | 231 | $result->closeCursor(); |
232 | 232 | |
233 | 233 | if ($all) { |
234 | - return ((int)$row[0] === count($objIds)); |
|
234 | + return ((int) $row[0] === count($objIds)); |
|
235 | 235 | } else { |
236 | 236 | return (bool) $row; |
237 | 237 | } |
@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | ->from(self::TAG_TABLE); |
137 | 137 | |
138 | 138 | if (!is_null($visibilityFilter)) { |
139 | - $query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int)$visibilityFilter))); |
|
139 | + $query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int) $visibilityFilter))); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | if (!empty($nameSearchPattern)) { |
143 | 143 | $query->andWhere( |
144 | 144 | $query->expr()->like( |
145 | 145 | 'name', |
146 | - $query->createNamedParameter('%' . $this->connection->escapeLikeParameter($nameSearchPattern). '%') |
|
146 | + $query->createNamedParameter('%'.$this->connection->escapeLikeParameter($nameSearchPattern).'%') |
|
147 | 147 | ) |
148 | 148 | ); |
149 | 149 | } |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | * {@inheritdoc} |
168 | 168 | */ |
169 | 169 | public function getTag($tagName, $userVisible, $userAssignable) { |
170 | - $userVisible = (int)$userVisible; |
|
171 | - $userAssignable = (int)$userAssignable; |
|
170 | + $userVisible = (int) $userVisible; |
|
171 | + $userAssignable = (int) $userAssignable; |
|
172 | 172 | |
173 | 173 | $result = $this->selectTagQuery |
174 | 174 | ->setParameter('name', $tagName) |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $result->closeCursor(); |
181 | 181 | if (!$row) { |
182 | 182 | throw new TagNotFoundException( |
183 | - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') does not exist' |
|
183 | + 'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') does not exist' |
|
184 | 184 | ); |
185 | 185 | } |
186 | 186 | |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | * {@inheritdoc} |
192 | 192 | */ |
193 | 193 | public function createTag($tagName, $userVisible, $userAssignable) { |
194 | - $userVisible = (int)$userVisible; |
|
195 | - $userAssignable = (int)$userAssignable; |
|
194 | + $userVisible = (int) $userVisible; |
|
195 | + $userAssignable = (int) $userAssignable; |
|
196 | 196 | |
197 | 197 | $query = $this->connection->getQueryBuilder(); |
198 | 198 | $query->insert(self::TAG_TABLE) |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $query->execute(); |
207 | 207 | } catch (UniqueConstraintViolationException $e) { |
208 | 208 | throw new TagAlreadyExistsException( |
209 | - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists', |
|
209 | + 'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') already exists', |
|
210 | 210 | 0, |
211 | 211 | $e |
212 | 212 | ); |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | $tagId = $query->getLastInsertId(); |
216 | 216 | |
217 | 217 | $tag = new SystemTag( |
218 | - (int)$tagId, |
|
218 | + (int) $tagId, |
|
219 | 219 | $tagName, |
220 | - (bool)$userVisible, |
|
221 | - (bool)$userAssignable |
|
220 | + (bool) $userVisible, |
|
221 | + (bool) $userAssignable |
|
222 | 222 | ); |
223 | 223 | |
224 | 224 | $this->dispatcher->dispatch(ManagerEvent::EVENT_CREATE, new ManagerEvent( |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | * {@inheritdoc} |
233 | 233 | */ |
234 | 234 | public function updateTag($tagId, $tagName, $userVisible, $userAssignable) { |
235 | - $userVisible = (int)$userVisible; |
|
236 | - $userAssignable = (int)$userAssignable; |
|
235 | + $userVisible = (int) $userVisible; |
|
236 | + $userAssignable = (int) $userAssignable; |
|
237 | 237 | |
238 | 238 | try { |
239 | 239 | $tags = $this->getTagsByIds($tagId); |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | } |
271 | 271 | } catch (UniqueConstraintViolationException $e) { |
272 | 272 | throw new TagAlreadyExistsException( |
273 | - 'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists', |
|
273 | + 'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') already exists', |
|
274 | 274 | 0, |
275 | 275 | $e |
276 | 276 | ); |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | } |
378 | 378 | |
379 | 379 | private function createSystemTagFromRow($row) { |
380 | - return new SystemTag((int)$row['id'], $row['name'], (bool)$row['visibility'], (bool)$row['editable']); |
|
380 | + return new SystemTag((int) $row['id'], $row['name'], (bool) $row['visibility'], (bool) $row['editable']); |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | /** |
@@ -222,8 +222,8 @@ |
||
222 | 222 | public function count($search = '') { |
223 | 223 | $users = false; |
224 | 224 | foreach ($this->backends as $backend) { |
225 | - if($backend->implementsActions(\OC\Group\Backend::COUNT_USERS)) { |
|
226 | - if($users === false) { |
|
225 | + if ($backend->implementsActions(\OC\Group\Backend::COUNT_USERS)) { |
|
226 | + if ($users === false) { |
|
227 | 227 | //we could directly add to a bool variable, but this would |
228 | 228 | //be ugly |
229 | 229 | $users = 0; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | IUserSession $userSession |
61 | 61 | ) { |
62 | 62 | $this->user = $user; |
63 | - $this->isAdmin = (bool)$isAdmin; |
|
63 | + $this->isAdmin = (bool) $isAdmin; |
|
64 | 64 | $this->groupManager = $groupManager; |
65 | 65 | $this->userSession = $userSession; |
66 | 66 | } |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | * @return array |
77 | 77 | */ |
78 | 78 | public function get($groupSearch = '', $userSearch = '') { |
79 | - $key = $groupSearch . '::' . $userSearch; |
|
80 | - if(isset($this->metaData[$key])) { |
|
79 | + $key = $groupSearch.'::'.$userSearch; |
|
80 | + if (isset($this->metaData[$key])) { |
|
81 | 81 | return $this->metaData[$key]; |
82 | 82 | } |
83 | 83 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $sortAdminGroupsIndex = 0; |
89 | 89 | $sortAdminGroupsKeys = array(); |
90 | 90 | |
91 | - foreach($this->getGroups($groupSearch) as $group) { |
|
91 | + foreach ($this->getGroups($groupSearch) as $group) { |
|
92 | 92 | $groupMetaData = $this->generateGroupMetaData($group, $userSearch); |
93 | 93 | if (strtolower($group->getGID()) !== 'admin') { |
94 | 94 | $this->addEntry( |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | * @return \OCP\IGroup[] |
186 | 186 | */ |
187 | 187 | protected function getGroups($search = '') { |
188 | - if($this->isAdmin) { |
|
188 | + if ($this->isAdmin) { |
|
189 | 189 | return $this->groupManager->search($search); |
190 | 190 | } else { |
191 | 191 | $userObject = $this->userSession->getUser(); |
192 | - if($userObject !== null) { |
|
192 | + if ($userObject !== null) { |
|
193 | 193 | $groups = $this->groupManager->getSubAdmin()->getSubAdminsGroups($userObject); |
194 | 194 | } else { |
195 | 195 | $groups = []; |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function getSupportedActions() { |
51 | 51 | $actions = 0; |
52 | - foreach($this->possibleActions AS $action => $methodName) { |
|
53 | - if(method_exists($this, $methodName)) { |
|
52 | + foreach ($this->possibleActions AS $action => $methodName) { |
|
53 | + if (method_exists($this, $methodName)) { |
|
54 | 54 | $actions |= $action; |
55 | 55 | } |
56 | 56 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * compared with \OC\Group\Backend::CREATE_GROUP etc. |
68 | 68 | */ |
69 | 69 | public function implementsActions($actions) { |
70 | - return (bool)($this->getSupportedActions() & $actions); |
|
70 | + return (bool) ($this->getSupportedActions() & $actions); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -20,4 +20,4 @@ |
||
20 | 20 | * |
21 | 21 | */ |
22 | 22 | |
23 | -require_once __DIR__ . '/v1.php'; |
|
23 | +require_once __DIR__.'/v1.php'; |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * |
20 | 20 | */ |
21 | 21 | |
22 | -require_once __DIR__ . '/../lib/base.php'; |
|
22 | +require_once __DIR__.'/../lib/base.php'; |
|
23 | 23 | |
24 | 24 | header('Content-Type: application/json'); |
25 | 25 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | <p id="update-progress-message-error" class="hidden"></p> |
50 | 50 | <ul id="update-progress-message-warnings" class="hidden"></ul> |
51 | 51 | <p id="update-progress-message"></p> |
52 | - <a class="update-show-detailed"><?php p($l->t( 'Detailed logs' )); ?> <img src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a> |
|
52 | + <a class="update-show-detailed"><?php p($l->t('Detailed logs')); ?> <img src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /></a> |
|
53 | 53 | <div id="update-progress-detailed" class="hidden"></div> |
54 | 54 | </div> |
55 | 55 | </div> |