@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function __construct(ILogger $logger) { |
73 | 73 | $this->logger = $logger; |
74 | 74 | $baseUrl = \OC::$WEBROOT; |
75 | - if(!(\OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) { |
|
75 | + if (!(\OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) { |
|
76 | 76 | $baseUrl = \OC::$server->getURLGenerator()->linkTo('', 'index.php'); |
77 | 77 | } |
78 | 78 | if (!\OC::$CLI && isset($_SERVER['REQUEST_METHOD'])) { |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | $this->routingFiles = []; |
99 | 99 | foreach (\OC_APP::getEnabledApps() as $app) { |
100 | 100 | $appPath = \OC_App::getAppPath($app); |
101 | - if($appPath !== false) { |
|
102 | - $file = $appPath . '/appinfo/routes.php'; |
|
101 | + if ($appPath !== false) { |
|
102 | + $file = $appPath.'/appinfo/routes.php'; |
|
103 | 103 | if (file_exists($file)) { |
104 | 104 | $this->routingFiles[$app] = $file; |
105 | 105 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param null|string $app |
116 | 116 | */ |
117 | 117 | public function loadRoutes($app = null) { |
118 | - if(is_string($app)) { |
|
118 | + if (is_string($app)) { |
|
119 | 119 | $app = \OC_App::cleanAppId($app); |
120 | 120 | } |
121 | 121 | |
@@ -130,14 +130,14 @@ discard block |
||
130 | 130 | if (isset($this->loadedApps[$app])) { |
131 | 131 | return; |
132 | 132 | } |
133 | - $file = \OC_App::getAppPath($app) . '/appinfo/routes.php'; |
|
133 | + $file = \OC_App::getAppPath($app).'/appinfo/routes.php'; |
|
134 | 134 | if ($file !== false && file_exists($file)) { |
135 | 135 | $routingFiles = [$app => $file]; |
136 | 136 | } else { |
137 | 137 | $routingFiles = []; |
138 | 138 | } |
139 | 139 | } |
140 | - \OC::$server->getEventLogger()->start('loadroutes' . $requestedApp, 'Loading Routes'); |
|
140 | + \OC::$server->getEventLogger()->start('loadroutes'.$requestedApp, 'Loading Routes'); |
|
141 | 141 | foreach ($routingFiles as $app => $file) { |
142 | 142 | if (!isset($this->loadedApps[$app])) { |
143 | 143 | if (!\OC_App::isAppLoaded($app)) { |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $this->useCollection($app); |
151 | 151 | $this->requireRouteFile($file, $app); |
152 | 152 | $collection = $this->getCollection($app); |
153 | - $collection->addPrefix('/apps/' . $app); |
|
153 | + $collection->addPrefix('/apps/'.$app); |
|
154 | 154 | $this->root->addCollection($collection); |
155 | 155 | |
156 | 156 | // Also add the OCS collection |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | if (!isset($this->loadedApps['core'])) { |
163 | 163 | $this->loadedApps['core'] = true; |
164 | 164 | $this->useCollection('root'); |
165 | - require_once __DIR__ . '/../../../settings/routes.php'; |
|
166 | - require_once __DIR__ . '/../../../core/routes.php'; |
|
165 | + require_once __DIR__.'/../../../settings/routes.php'; |
|
166 | + require_once __DIR__.'/../../../core/routes.php'; |
|
167 | 167 | |
168 | 168 | // Also add the OCS collection |
169 | 169 | $collection = $this->getCollection('root.ocs'); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $collection->addPrefix('/ocs'); |
176 | 176 | $this->root->addCollection($collection); |
177 | 177 | } |
178 | - \OC::$server->getEventLogger()->end('loadroutes' . $requestedApp); |
|
178 | + \OC::$server->getEventLogger()->end('loadroutes'.$requestedApp); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | public function match($url) { |
247 | 247 | if (substr($url, 0, 6) === '/apps/') { |
248 | 248 | // empty string / 'apps' / $app / rest of the route |
249 | - list(, , $app,) = explode('/', $url, 4); |
|
249 | + list(,, $app,) = explode('/', $url, 4); |
|
250 | 250 | |
251 | 251 | $app = \OC_App::cleanAppId($app); |
252 | 252 | \OC::$REQUESTEDAPP = $app; |
253 | 253 | $this->loadRoutes($app); |
254 | 254 | } else if (substr($url, 0, 13) === '/ocsapp/apps/') { |
255 | 255 | // empty string / 'ocsapp' / 'apps' / $app / rest of the route |
256 | - list(, , , $app,) = explode('/', $url, 5); |
|
256 | + list(,,, $app,) = explode('/', $url, 5); |
|
257 | 257 | |
258 | 258 | $app = \OC_App::cleanAppId($app); |
259 | 259 | \OC::$REQUESTEDAPP = $app; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | // However, since Symfony does not allow empty route names, the route |
278 | 278 | // we need to match is '/', so we need to append the '/' here. |
279 | 279 | try { |
280 | - $parameters = $matcher->match($url . '/'); |
|
280 | + $parameters = $matcher->match($url.'/'); |
|
281 | 281 | } catch (ResourceNotFoundException $newException) { |
282 | 282 | // If we still didn't match a route, we throw the original exception |
283 | 283 | throw $e; |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | if (is_array($routes)) { |
368 | 368 | $appNameSpace = App::buildAppNamespace($appName); |
369 | 369 | |
370 | - $applicationClassName = $appNameSpace . '\\AppInfo\\Application'; |
|
370 | + $applicationClassName = $appNameSpace.'\\AppInfo\\Application'; |
|
371 | 371 | |
372 | 372 | if (class_exists($applicationClassName)) { |
373 | 373 | $application = new $applicationClassName(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | return new DataResponse(); |
85 | 85 | } |
86 | 86 | |
87 | - $this->logger->error('Could not accept federated share with id: ' . $id, |
|
87 | + $this->logger->error('Could not accept federated share with id: '.$id, |
|
88 | 88 | ['app' => 'files_sharing']); |
89 | 89 | |
90 | 90 | throw new OCSNotFoundException('wrong share ID, share doesn\'t exist.'); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @return array enriched share info with data from the filecache |
116 | 116 | */ |
117 | 117 | private static function extendShareInfo($share) { |
118 | - $view = new \OC\Files\View('/' . \OC_User::getUser() . '/files/'); |
|
118 | + $view = new \OC\Files\View('/'.\OC_User::getUser().'/files/'); |
|
119 | 119 | $info = $view->getFileInfo($share['mountpoint']); |
120 | 120 | |
121 | 121 | $share['mimetype'] = $info->getMimetype(); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | throw new OCSNotFoundException('Share does not exist'); |
179 | 179 | } |
180 | 180 | |
181 | - $mountPoint = '/' . \OC_User::getUser() . '/files' . $shareInfo['mountpoint']; |
|
181 | + $mountPoint = '/'.\OC_User::getUser().'/files'.$shareInfo['mountpoint']; |
|
182 | 182 | |
183 | 183 | if ($this->externalManager->removeShare($mountPoint) === true) { |
184 | 184 | return new DataResponse(); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | use OCA\Testing\AlternativeHomeUserBackend; |
26 | 26 | |
27 | 27 | class Application extends App { |
28 | - public function __construct (array $urlParams = array()) { |
|
28 | + public function __construct(array $urlParams = array()) { |
|
29 | 29 | $appName = 'testing'; |
30 | 30 | parent::__construct($appName, $urlParams); |
31 | 31 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | protected function getPath($user, $path) { |
100 | 100 | $node = $this->rootFolder->getUserFolder($user)->get($path); |
101 | - return 'files/' . md5($node->getStorage()->getId() . '::' . trim($node->getInternalPath(), '/')); |
|
101 | + return 'files/'.md5($node->getStorage()->getId().'::'.trim($node->getInternalPath(), '/')); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | try { |
136 | 136 | $lockingProvider->acquireLock($path, $type); |
137 | - $this->config->setAppValue('testing', 'locking_' . $path, $type); |
|
137 | + $this->config->setAppValue('testing', 'locking_'.$path, $type); |
|
138 | 138 | return new DataResponse(); |
139 | 139 | } catch (LockedException $e) { |
140 | 140 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | try { |
163 | 163 | $lockingProvider->changeLock($path, $type); |
164 | - $this->config->setAppValue('testing', 'locking_' . $path, $type); |
|
164 | + $this->config->setAppValue('testing', 'locking_'.$path, $type); |
|
165 | 165 | return new DataResponse(); |
166 | 166 | } catch (LockedException $e) { |
167 | 167 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | try { |
190 | 190 | $lockingProvider->releaseLock($path, $type); |
191 | - $this->config->deleteAppValue('testing', 'locking_' . $path); |
|
191 | + $this->config->deleteAppValue('testing', 'locking_'.$path); |
|
192 | 192 | return new DataResponse(); |
193 | 193 | } catch (LockedException $e) { |
194 | 194 | throw new OCSException('', Http::STATUS_LOCKED, $e); |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | if (strpos($lock, 'locking_') === 0) { |
232 | 232 | $path = substr($lock, strlen('locking_')); |
233 | 233 | |
234 | - if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) { |
|
234 | + if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) { |
|
235 | 235 | $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); |
236 | - } else if ($type === ILockingProvider::LOCK_SHARED && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) { |
|
236 | + } else if ($type === ILockingProvider::LOCK_SHARED && (int) $this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) { |
|
237 | 237 | $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); |
238 | 238 | } else { |
239 | 239 | $lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock)); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param string $source either a local file or string data |
50 | 50 | * @return bool |
51 | 51 | */ |
52 | - public abstract function addFile($path, $source=''); |
|
52 | + public abstract function addFile($path, $source = ''); |
|
53 | 53 | /** |
54 | 54 | * rename a file or folder in the archive |
55 | 55 | * @param string $source |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function addRecursive($path, $source) { |
128 | 128 | $dh = opendir($source); |
129 | - if(is_resource($dh)) { |
|
129 | + if (is_resource($dh)) { |
|
130 | 130 | $this->addFolder($path); |
131 | 131 | while (($file = readdir($dh)) !== false) { |
132 | - if($file === '.' || $file === '..') { |
|
132 | + if ($file === '.' || $file === '..') { |
|
133 | 133 | continue; |
134 | 134 | } |
135 | - if(is_dir($source.'/'.$file)) { |
|
135 | + if (is_dir($source.'/'.$file)) { |
|
136 | 136 | $this->addRecursive($path.'/'.$file, $source.'/'.$file); |
137 | - }else{ |
|
137 | + } else { |
|
138 | 138 | $this->addFile($path.'/'.$file, $source.'/'.$file); |
139 | 139 | } |
140 | 140 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | return true; |
82 | 82 | } |
83 | 83 | // Reject misformed domains in any case |
84 | - if (strpos($domain,'-') === 0 || strpos($domain,'..') !== false) { |
|
84 | + if (strpos($domain, '-') === 0 || strpos($domain, '..') !== false) { |
|
85 | 85 | return false; |
86 | 86 | } |
87 | 87 | // Match, allowing for * wildcards |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | if (gettype($trusted) !== 'string') { |
90 | 90 | break; |
91 | 91 | } |
92 | - $regex = '/^' . implode('[-\.a-zA-Z0-9]*', array_map(function($v) { return preg_quote($v, '/'); }, explode('*', $trusted))) . '$/'; |
|
92 | + $regex = '/^'.implode('[-\.a-zA-Z0-9]*', array_map(function($v) { return preg_quote($v, '/'); }, explode('*', $trusted))).'$/'; |
|
93 | 93 | if (preg_match($regex, $domain) || preg_match($regex, $domainWithPort)) { |
94 | 94 | return true; |
95 | 95 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | public function get($key) { |
100 | - $result = self::$cache->get($this->getNameSpace() . $key); |
|
100 | + $result = self::$cache->get($this->getNameSpace().$key); |
|
101 | 101 | if ($result === false and self::$cache->getResultCode() == \Memcached::RES_NOTFOUND) { |
102 | 102 | return null; |
103 | 103 | } else { |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | |
108 | 108 | public function set($key, $value, $ttl = 0) { |
109 | 109 | if ($ttl > 0) { |
110 | - $result = self::$cache->set($this->getNameSpace() . $key, $value, $ttl); |
|
110 | + $result = self::$cache->set($this->getNameSpace().$key, $value, $ttl); |
|
111 | 111 | } else { |
112 | - $result = self::$cache->set($this->getNameSpace() . $key, $value); |
|
112 | + $result = self::$cache->set($this->getNameSpace().$key, $value); |
|
113 | 113 | } |
114 | 114 | if ($result !== true) { |
115 | 115 | $this->verifyReturnCode(); |
@@ -118,12 +118,12 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | public function hasKey($key) { |
121 | - self::$cache->get($this->getNameSpace() . $key); |
|
121 | + self::$cache->get($this->getNameSpace().$key); |
|
122 | 122 | return self::$cache->getResultCode() === \Memcached::RES_SUCCESS; |
123 | 123 | } |
124 | 124 | |
125 | 125 | public function remove($key) { |
126 | - $result= self::$cache->delete($this->getNameSpace() . $key); |
|
126 | + $result = self::$cache->delete($this->getNameSpace().$key); |
|
127 | 127 | if (self::$cache->getResultCode() !== \Memcached::RES_NOTFOUND) { |
128 | 128 | $this->verifyReturnCode(); |
129 | 129 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | public function clear($prefix = '') { |
134 | - $prefix = $this->getNameSpace() . $prefix; |
|
134 | + $prefix = $this->getNameSpace().$prefix; |
|
135 | 135 | $allKeys = self::$cache->getAllKeys(); |
136 | 136 | if ($allKeys === false) { |
137 | 137 | // newer Memcached doesn't like getAllKeys(), flush everything |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @throws \Exception |
166 | 166 | */ |
167 | 167 | public function add($key, $value, $ttl = 0) { |
168 | - $result = self::$cache->add($this->getPrefix() . $key, $value, $ttl); |
|
168 | + $result = self::$cache->add($this->getPrefix().$key, $value, $ttl); |
|
169 | 169 | if (self::$cache->getResultCode() !== \Memcached::RES_NOTSTORED) { |
170 | 170 | $this->verifyReturnCode(); |
171 | 171 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function inc($key, $step = 1) { |
183 | 183 | $this->add($key, 0); |
184 | - $result = self::$cache->increment($this->getPrefix() . $key, $step); |
|
184 | + $result = self::$cache->increment($this->getPrefix().$key, $step); |
|
185 | 185 | |
186 | 186 | if (self::$cache->getResultCode() !== \Memcached::RES_SUCCESS) { |
187 | 187 | return false; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @return int | bool |
199 | 199 | */ |
200 | 200 | public function dec($key, $step = 1) { |
201 | - $result = self::$cache->decrement($this->getPrefix() . $key, $step); |
|
201 | + $result = self::$cache->decrement($this->getPrefix().$key, $step); |
|
202 | 202 | |
203 | 203 | if (self::$cache->getResultCode() !== \Memcached::RES_SUCCESS) { |
204 | 204 | return false; |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | |
61 | 61 | $remoteStorages = $this->getRemoteStorages(); |
62 | 62 | |
63 | - $output->writeln(count($remoteStorages) . ' remote storage(s) need(s) to be checked'); |
|
63 | + $output->writeln(count($remoteStorages).' remote storage(s) need(s) to be checked'); |
|
64 | 64 | |
65 | 65 | $remoteShareIds = $this->getRemoteShareIds(); |
66 | 66 | |
67 | - $output->writeln(count($remoteShareIds) . ' remote share(s) exist'); |
|
67 | + $output->writeln(count($remoteShareIds).' remote share(s) exist'); |
|
68 | 68 | |
69 | 69 | foreach ($remoteShareIds as $id => $remoteShareId) { |
70 | 70 | if (isset($remoteStorages[$remoteShareId])) { |
@@ -142,13 +142,13 @@ discard block |
||
142 | 142 | ->where($queryBuilder->expr()->like( |
143 | 143 | 'id', |
144 | 144 | // match all 'shared::' + 32 characters storages |
145 | - $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::') . str_repeat('_', 32)), |
|
145 | + $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::').str_repeat('_', 32)), |
|
146 | 146 | IQueryBuilder::PARAM_STR) |
147 | 147 | ) |
148 | 148 | ->andWhere($queryBuilder->expr()->notLike( |
149 | 149 | 'id', |
150 | 150 | // but not the ones starting with a '/', they are for normal shares |
151 | - $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/') . '%'), |
|
151 | + $queryBuilder->createNamedParameter($this->connection->escapeLikeParameter('shared::/').'%'), |
|
152 | 152 | IQueryBuilder::PARAM_STR) |
153 | 153 | )->orderBy('numeric_id'); |
154 | 154 | $query = $queryBuilder->execute(); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $remoteShareIds = []; |
173 | 173 | |
174 | 174 | while ($row = $query->fetch()) { |
175 | - $remoteShareIds[$row['id']] = 'shared::' . md5($row['share_token'] . '@' . $row['remote']); |
|
175 | + $remoteShareIds[$row['id']] = 'shared::'.md5($row['share_token'].'@'.$row['remote']); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | return $remoteShareIds; |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | /** |
55 | 55 | * pass all other function directly to the \Doctrine\DBAL\Driver\Statement |
56 | 56 | */ |
57 | - public function __call($name,$arguments) { |
|
58 | - return call_user_func_array(array($this->statement,$name), $arguments); |
|
57 | + public function __call($name, $arguments) { |
|
58 | + return call_user_func_array(array($this->statement, $name), $arguments); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @param array $input |
65 | 65 | * @return \OC_DB_StatementWrapper|int|bool |
66 | 66 | */ |
67 | - public function execute($input= []) { |
|
67 | + public function execute($input = []) { |
|
68 | 68 | $this->lastArguments = $input; |
69 | 69 | if (count($input) > 0) { |
70 | 70 | $result = $this->statement->execute($input); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * @param integer|null $length max length when using an OUT bind |
114 | 114 | * @return boolean |
115 | 115 | */ |
116 | - public function bindParam($column, &$variable, $type = null, $length = null){ |
|
116 | + public function bindParam($column, &$variable, $type = null, $length = null) { |
|
117 | 117 | return $this->statement->bindParam($column, $variable, $type, $length); |
118 | 118 | } |
119 | 119 | } |