@@ -51,7 +51,7 @@ |
||
51 | 51 | * @return ILinkAction |
52 | 52 | */ |
53 | 53 | public function newEMailAction($icon, $name, $email) { |
54 | - return $this->newLinkAction($icon, $name, 'mailto:' . urlencode($email)); |
|
54 | + return $this->newLinkAction($icon, $name, 'mailto:'.urlencode($email)); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | } |
@@ -122,12 +122,12 @@ discard block |
||
122 | 122 | parent::__construct(); |
123 | 123 | $this->webRoot = $webRoot; |
124 | 124 | |
125 | - $this->registerService('ContactsManager', function ($c) { |
|
125 | + $this->registerService('ContactsManager', function($c) { |
|
126 | 126 | return new ContactsManager(); |
127 | 127 | }); |
128 | 128 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
129 | 129 | |
130 | - $this->registerService('PreviewManager', function (Server $c) { |
|
130 | + $this->registerService('PreviewManager', function(Server $c) { |
|
131 | 131 | return new PreviewManager( |
132 | 132 | $c->getConfig(), |
133 | 133 | $c->getRootFolder(), |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | ); |
138 | 138 | }); |
139 | 139 | |
140 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
140 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
141 | 141 | return new \OC\Preview\Watcher( |
142 | 142 | $c->getAppDataDir('preview') |
143 | 143 | ); |
144 | 144 | }); |
145 | 145 | |
146 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
146 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
147 | 147 | $view = new View(); |
148 | 148 | $util = new Encryption\Util( |
149 | 149 | $view, |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | ); |
162 | 162 | }); |
163 | 163 | |
164 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
164 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
165 | 165 | $util = new Encryption\Util( |
166 | 166 | new View(), |
167 | 167 | $c->getUserManager(), |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | return new Encryption\File($util); |
172 | 172 | }); |
173 | 173 | |
174 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
174 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
175 | 175 | $view = new View(); |
176 | 176 | $util = new Encryption\Util( |
177 | 177 | $view, |
@@ -182,27 +182,27 @@ discard block |
||
182 | 182 | |
183 | 183 | return new Encryption\Keys\Storage($view, $util); |
184 | 184 | }); |
185 | - $this->registerService('TagMapper', function (Server $c) { |
|
185 | + $this->registerService('TagMapper', function(Server $c) { |
|
186 | 186 | return new TagMapper($c->getDatabaseConnection()); |
187 | 187 | }); |
188 | - $this->registerService('TagManager', function (Server $c) { |
|
188 | + $this->registerService('TagManager', function(Server $c) { |
|
189 | 189 | $tagMapper = $c->query('TagMapper'); |
190 | 190 | return new TagManager($tagMapper, $c->getUserSession()); |
191 | 191 | }); |
192 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
192 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
193 | 193 | $config = $c->getConfig(); |
194 | 194 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory'); |
195 | 195 | /** @var \OC\SystemTag\ManagerFactory $factory */ |
196 | 196 | $factory = new $factoryClass($this); |
197 | 197 | return $factory; |
198 | 198 | }); |
199 | - $this->registerService('SystemTagManager', function (Server $c) { |
|
199 | + $this->registerService('SystemTagManager', function(Server $c) { |
|
200 | 200 | return $c->query('SystemTagManagerFactory')->getManager(); |
201 | 201 | }); |
202 | - $this->registerService('SystemTagObjectMapper', function (Server $c) { |
|
202 | + $this->registerService('SystemTagObjectMapper', function(Server $c) { |
|
203 | 203 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
204 | 204 | }); |
205 | - $this->registerService('RootFolder', function (Server $c) { |
|
205 | + $this->registerService('RootFolder', function(Server $c) { |
|
206 | 206 | $manager = \OC\Files\Filesystem::getMountManager(null); |
207 | 207 | $view = new View(); |
208 | 208 | $root = new Root( |
@@ -226,28 +226,28 @@ discard block |
||
226 | 226 | return $c->query('RootFolder'); |
227 | 227 | }); |
228 | 228 | }); |
229 | - $this->registerService('UserManager', function (Server $c) { |
|
229 | + $this->registerService('UserManager', function(Server $c) { |
|
230 | 230 | $config = $c->getConfig(); |
231 | 231 | return new \OC\User\Manager($config); |
232 | 232 | }); |
233 | - $this->registerService('GroupManager', function (Server $c) { |
|
233 | + $this->registerService('GroupManager', function(Server $c) { |
|
234 | 234 | $groupManager = new \OC\Group\Manager($this->getUserManager()); |
235 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
235 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
236 | 236 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
237 | 237 | }); |
238 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
238 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
239 | 239 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
240 | 240 | }); |
241 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
241 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
242 | 242 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
243 | 243 | }); |
244 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
244 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
245 | 245 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
246 | 246 | }); |
247 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
247 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
248 | 248 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
249 | 249 | }); |
250 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
250 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
251 | 251 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
252 | 252 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
253 | 253 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -265,11 +265,11 @@ discard block |
||
265 | 265 | return new Store($session, $logger, $tokenProvider); |
266 | 266 | }); |
267 | 267 | $this->registerAlias(IStore::class, Store::class); |
268 | - $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) { |
|
268 | + $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function(Server $c) { |
|
269 | 269 | $dbConnection = $c->getDatabaseConnection(); |
270 | 270 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
271 | 271 | }); |
272 | - $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function (Server $c) { |
|
272 | + $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function(Server $c) { |
|
273 | 273 | $mapper = $c->query('OC\Authentication\Token\DefaultTokenMapper'); |
274 | 274 | $crypto = $c->getCrypto(); |
275 | 275 | $config = $c->getConfig(); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | return new \OC\Authentication\Token\DefaultTokenProvider($mapper, $crypto, $config, $logger, $timeFactory); |
279 | 279 | }); |
280 | 280 | $this->registerAlias('OC\Authentication\Token\IProvider', 'OC\Authentication\Token\DefaultTokenProvider'); |
281 | - $this->registerService('UserSession', function (Server $c) { |
|
281 | + $this->registerService('UserSession', function(Server $c) { |
|
282 | 282 | $manager = $c->getUserManager(); |
283 | 283 | $session = new \OC\Session\Memory(''); |
284 | 284 | $timeFactory = new TimeFactory(); |
@@ -291,70 +291,70 @@ discard block |
||
291 | 291 | } |
292 | 292 | |
293 | 293 | $userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $c->getConfig(), $c->getSecureRandom()); |
294 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
294 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
295 | 295 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
296 | 296 | }); |
297 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
297 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
298 | 298 | /** @var $user \OC\User\User */ |
299 | 299 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
300 | 300 | }); |
301 | - $userSession->listen('\OC\User', 'preDelete', function ($user) { |
|
301 | + $userSession->listen('\OC\User', 'preDelete', function($user) { |
|
302 | 302 | /** @var $user \OC\User\User */ |
303 | 303 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
304 | 304 | }); |
305 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
305 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
306 | 306 | /** @var $user \OC\User\User */ |
307 | 307 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
308 | 308 | }); |
309 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
309 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
310 | 310 | /** @var $user \OC\User\User */ |
311 | 311 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
312 | 312 | }); |
313 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
313 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
314 | 314 | /** @var $user \OC\User\User */ |
315 | 315 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
316 | 316 | }); |
317 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
317 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
318 | 318 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
319 | 319 | }); |
320 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
320 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
321 | 321 | /** @var $user \OC\User\User */ |
322 | 322 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
323 | 323 | }); |
324 | - $userSession->listen('\OC\User', 'logout', function () { |
|
324 | + $userSession->listen('\OC\User', 'logout', function() { |
|
325 | 325 | \OC_Hook::emit('OC_User', 'logout', array()); |
326 | 326 | }); |
327 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value) { |
|
327 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value) { |
|
328 | 328 | /** @var $user \OC\User\User */ |
329 | 329 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value)); |
330 | 330 | }); |
331 | 331 | return $userSession; |
332 | 332 | }); |
333 | 333 | |
334 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
334 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
335 | 335 | return new \OC\Authentication\TwoFactorAuth\Manager($c->getAppManager(), $c->getSession(), $c->getConfig(), $c->getActivityManager(), $c->getLogger()); |
336 | 336 | }); |
337 | 337 | |
338 | - $this->registerService('NavigationManager', function (Server $c) { |
|
338 | + $this->registerService('NavigationManager', function(Server $c) { |
|
339 | 339 | return new \OC\NavigationManager($c->getAppManager(), |
340 | 340 | $c->getURLGenerator(), |
341 | 341 | $c->getL10NFactory(), |
342 | 342 | $c->getUserSession(), |
343 | 343 | $c->getGroupManager()); |
344 | 344 | }); |
345 | - $this->registerService('AllConfig', function (Server $c) { |
|
345 | + $this->registerService('AllConfig', function(Server $c) { |
|
346 | 346 | return new \OC\AllConfig( |
347 | 347 | $c->getSystemConfig() |
348 | 348 | ); |
349 | 349 | }); |
350 | 350 | $this->registerAlias(\OCP\IConfig::class, 'AllConfig'); |
351 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
351 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
352 | 352 | return new \OC\SystemConfig($config); |
353 | 353 | }); |
354 | - $this->registerService('AppConfig', function (Server $c) { |
|
354 | + $this->registerService('AppConfig', function(Server $c) { |
|
355 | 355 | return new \OC\AppConfig($c->getDatabaseConnection()); |
356 | 356 | }); |
357 | - $this->registerService('L10NFactory', function (Server $c) { |
|
357 | + $this->registerService('L10NFactory', function(Server $c) { |
|
358 | 358 | return new \OC\L10N\Factory( |
359 | 359 | $c->getConfig(), |
360 | 360 | $c->getRequest(), |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | \OC::$SERVERROOT |
363 | 363 | ); |
364 | 364 | }); |
365 | - $this->registerService('URLGenerator', function (Server $c) { |
|
365 | + $this->registerService('URLGenerator', function(Server $c) { |
|
366 | 366 | $config = $c->getConfig(); |
367 | 367 | $cacheFactory = $c->getMemCacheFactory(); |
368 | 368 | return new \OC\URLGenerator( |
@@ -371,10 +371,10 @@ discard block |
||
371 | 371 | ); |
372 | 372 | }); |
373 | 373 | $this->registerAlias(IURLGenerator::class, 'URLGenerator'); |
374 | - $this->registerService('AppHelper', function ($c) { |
|
374 | + $this->registerService('AppHelper', function($c) { |
|
375 | 375 | return new \OC\AppHelper(); |
376 | 376 | }); |
377 | - $this->registerService('AppFetcher', function ($c) { |
|
377 | + $this->registerService('AppFetcher', function($c) { |
|
378 | 378 | return new AppFetcher( |
379 | 379 | $this->getAppDataDir('appstore'), |
380 | 380 | $this->getHTTPClientService(), |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | $this->getConfig() |
383 | 383 | ); |
384 | 384 | }); |
385 | - $this->registerService('CategoryFetcher', function ($c) { |
|
385 | + $this->registerService('CategoryFetcher', function($c) { |
|
386 | 386 | return new CategoryFetcher( |
387 | 387 | $this->getAppDataDir('appstore'), |
388 | 388 | $this->getHTTPClientService(), |
@@ -390,19 +390,19 @@ discard block |
||
390 | 390 | $this->getConfig() |
391 | 391 | ); |
392 | 392 | }); |
393 | - $this->registerService('UserCache', function ($c) { |
|
393 | + $this->registerService('UserCache', function($c) { |
|
394 | 394 | return new Cache\File(); |
395 | 395 | }); |
396 | - $this->registerService('MemCacheFactory', function (Server $c) { |
|
396 | + $this->registerService('MemCacheFactory', function(Server $c) { |
|
397 | 397 | $config = $c->getConfig(); |
398 | 398 | |
399 | 399 | if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) { |
400 | 400 | $v = \OC_App::getAppVersions(); |
401 | - $v['core'] = md5(file_get_contents(\OC::$SERVERROOT . '/version.php')); |
|
401 | + $v['core'] = md5(file_get_contents(\OC::$SERVERROOT.'/version.php')); |
|
402 | 402 | $version = implode(',', $v); |
403 | 403 | $instanceId = \OC_Util::getInstanceId(); |
404 | 404 | $path = \OC::$SERVERROOT; |
405 | - $prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . \OC::$WEBROOT); |
|
405 | + $prefix = md5($instanceId.'-'.$version.'-'.$path.'-'.\OC::$WEBROOT); |
|
406 | 406 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
407 | 407 | $config->getSystemValue('memcache.local', null), |
408 | 408 | $config->getSystemValue('memcache.distributed', null), |
@@ -416,11 +416,11 @@ discard block |
||
416 | 416 | '\\OC\\Memcache\\ArrayCache' |
417 | 417 | ); |
418 | 418 | }); |
419 | - $this->registerService('RedisFactory', function (Server $c) { |
|
419 | + $this->registerService('RedisFactory', function(Server $c) { |
|
420 | 420 | $systemConfig = $c->getSystemConfig(); |
421 | 421 | return new RedisFactory($systemConfig); |
422 | 422 | }); |
423 | - $this->registerService('ActivityManager', function (Server $c) { |
|
423 | + $this->registerService('ActivityManager', function(Server $c) { |
|
424 | 424 | return new \OC\Activity\Manager( |
425 | 425 | $c->getRequest(), |
426 | 426 | $c->getUserSession(), |
@@ -428,13 +428,13 @@ discard block |
||
428 | 428 | $c->query(IValidator::class) |
429 | 429 | ); |
430 | 430 | }); |
431 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
431 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
432 | 432 | return new \OC\Activity\EventMerger( |
433 | 433 | $c->getL10N('lib') |
434 | 434 | ); |
435 | 435 | }); |
436 | 436 | $this->registerAlias(IValidator::class, Validator::class); |
437 | - $this->registerService('AvatarManager', function (Server $c) { |
|
437 | + $this->registerService('AvatarManager', function(Server $c) { |
|
438 | 438 | return new AvatarManager( |
439 | 439 | $c->getUserManager(), |
440 | 440 | $c->getAppDataDir('avatar'), |
@@ -443,14 +443,14 @@ discard block |
||
443 | 443 | $c->getConfig() |
444 | 444 | ); |
445 | 445 | }); |
446 | - $this->registerService('Logger', function (Server $c) { |
|
446 | + $this->registerService('Logger', function(Server $c) { |
|
447 | 447 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
448 | 448 | $logger = Log::getLogClass($logType); |
449 | 449 | call_user_func(array($logger, 'init')); |
450 | 450 | |
451 | 451 | return new Log($logger); |
452 | 452 | }); |
453 | - $this->registerService('JobList', function (Server $c) { |
|
453 | + $this->registerService('JobList', function(Server $c) { |
|
454 | 454 | $config = $c->getConfig(); |
455 | 455 | return new \OC\BackgroundJob\JobList( |
456 | 456 | $c->getDatabaseConnection(), |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | new TimeFactory() |
459 | 459 | ); |
460 | 460 | }); |
461 | - $this->registerService('Router', function (Server $c) { |
|
461 | + $this->registerService('Router', function(Server $c) { |
|
462 | 462 | $cacheFactory = $c->getMemCacheFactory(); |
463 | 463 | $logger = $c->getLogger(); |
464 | 464 | if ($cacheFactory->isAvailable()) { |
@@ -468,22 +468,22 @@ discard block |
||
468 | 468 | } |
469 | 469 | return $router; |
470 | 470 | }); |
471 | - $this->registerService('Search', function ($c) { |
|
471 | + $this->registerService('Search', function($c) { |
|
472 | 472 | return new Search(); |
473 | 473 | }); |
474 | - $this->registerService('SecureRandom', function ($c) { |
|
474 | + $this->registerService('SecureRandom', function($c) { |
|
475 | 475 | return new SecureRandom(); |
476 | 476 | }); |
477 | - $this->registerService('Crypto', function (Server $c) { |
|
477 | + $this->registerService('Crypto', function(Server $c) { |
|
478 | 478 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
479 | 479 | }); |
480 | - $this->registerService('Hasher', function (Server $c) { |
|
480 | + $this->registerService('Hasher', function(Server $c) { |
|
481 | 481 | return new Hasher($c->getConfig()); |
482 | 482 | }); |
483 | - $this->registerService('CredentialsManager', function (Server $c) { |
|
483 | + $this->registerService('CredentialsManager', function(Server $c) { |
|
484 | 484 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
485 | 485 | }); |
486 | - $this->registerService('DatabaseConnection', function (Server $c) { |
|
486 | + $this->registerService('DatabaseConnection', function(Server $c) { |
|
487 | 487 | $systemConfig = $c->getSystemConfig(); |
488 | 488 | $factory = new \OC\DB\ConnectionFactory($c->getConfig()); |
489 | 489 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -495,14 +495,14 @@ discard block |
||
495 | 495 | $connection->getConfiguration()->setSQLLogger($c->getQueryLogger()); |
496 | 496 | return $connection; |
497 | 497 | }); |
498 | - $this->registerService('HTTPHelper', function (Server $c) { |
|
498 | + $this->registerService('HTTPHelper', function(Server $c) { |
|
499 | 499 | $config = $c->getConfig(); |
500 | 500 | return new HTTPHelper( |
501 | 501 | $config, |
502 | 502 | $c->getHTTPClientService() |
503 | 503 | ); |
504 | 504 | }); |
505 | - $this->registerService('HttpClientService', function (Server $c) { |
|
505 | + $this->registerService('HttpClientService', function(Server $c) { |
|
506 | 506 | $user = \OC_User::getUser(); |
507 | 507 | $uid = $user ? $user : null; |
508 | 508 | return new ClientService( |
@@ -510,27 +510,27 @@ discard block |
||
510 | 510 | new \OC\Security\CertificateManager($uid, new View(), $c->getConfig(), $c->getLogger()) |
511 | 511 | ); |
512 | 512 | }); |
513 | - $this->registerService('EventLogger', function (Server $c) { |
|
513 | + $this->registerService('EventLogger', function(Server $c) { |
|
514 | 514 | if ($c->getSystemConfig()->getValue('debug', false)) { |
515 | 515 | return new EventLogger(); |
516 | 516 | } else { |
517 | 517 | return new NullEventLogger(); |
518 | 518 | } |
519 | 519 | }); |
520 | - $this->registerService('QueryLogger', function (Server $c) { |
|
520 | + $this->registerService('QueryLogger', function(Server $c) { |
|
521 | 521 | if ($c->getSystemConfig()->getValue('debug', false)) { |
522 | 522 | return new QueryLogger(); |
523 | 523 | } else { |
524 | 524 | return new NullQueryLogger(); |
525 | 525 | } |
526 | 526 | }); |
527 | - $this->registerService('TempManager', function (Server $c) { |
|
527 | + $this->registerService('TempManager', function(Server $c) { |
|
528 | 528 | return new TempManager( |
529 | 529 | $c->getLogger(), |
530 | 530 | $c->getConfig() |
531 | 531 | ); |
532 | 532 | }); |
533 | - $this->registerService('AppManager', function (Server $c) { |
|
533 | + $this->registerService('AppManager', function(Server $c) { |
|
534 | 534 | return new \OC\App\AppManager( |
535 | 535 | $c->getUserSession(), |
536 | 536 | $c->getAppConfig(), |
@@ -539,13 +539,13 @@ discard block |
||
539 | 539 | $c->getEventDispatcher() |
540 | 540 | ); |
541 | 541 | }); |
542 | - $this->registerService('DateTimeZone', function (Server $c) { |
|
542 | + $this->registerService('DateTimeZone', function(Server $c) { |
|
543 | 543 | return new DateTimeZone( |
544 | 544 | $c->getConfig(), |
545 | 545 | $c->getSession() |
546 | 546 | ); |
547 | 547 | }); |
548 | - $this->registerService('DateTimeFormatter', function (Server $c) { |
|
548 | + $this->registerService('DateTimeFormatter', function(Server $c) { |
|
549 | 549 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
550 | 550 | |
551 | 551 | return new DateTimeFormatter( |
@@ -553,16 +553,16 @@ discard block |
||
553 | 553 | $c->getL10N('lib', $language) |
554 | 554 | ); |
555 | 555 | }); |
556 | - $this->registerService('UserMountCache', function (Server $c) { |
|
556 | + $this->registerService('UserMountCache', function(Server $c) { |
|
557 | 557 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
558 | 558 | $listener = new UserMountCacheListener($mountCache); |
559 | 559 | $listener->listen($c->getUserManager()); |
560 | 560 | return $mountCache; |
561 | 561 | }); |
562 | - $this->registerService('MountConfigManager', function (Server $c) { |
|
562 | + $this->registerService('MountConfigManager', function(Server $c) { |
|
563 | 563 | $loader = \OC\Files\Filesystem::getLoader(); |
564 | 564 | $mountCache = $c->query('UserMountCache'); |
565 | - $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
565 | + $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
566 | 566 | |
567 | 567 | // builtin providers |
568 | 568 | |
@@ -573,14 +573,14 @@ discard block |
||
573 | 573 | |
574 | 574 | return $manager; |
575 | 575 | }); |
576 | - $this->registerService('IniWrapper', function ($c) { |
|
576 | + $this->registerService('IniWrapper', function($c) { |
|
577 | 577 | return new IniGetWrapper(); |
578 | 578 | }); |
579 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
579 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
580 | 580 | $jobList = $c->getJobList(); |
581 | 581 | return new AsyncBus($jobList); |
582 | 582 | }); |
583 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
583 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
584 | 584 | return new TrustedDomainHelper($this->getConfig()); |
585 | 585 | }); |
586 | 586 | $this->registerService('Throttler', function(Server $c) { |
@@ -591,10 +591,10 @@ discard block |
||
591 | 591 | $c->getConfig() |
592 | 592 | ); |
593 | 593 | }); |
594 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
594 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
595 | 595 | // IConfig and IAppManager requires a working database. This code |
596 | 596 | // might however be called when ownCloud is not yet setup. |
597 | - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
597 | + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
598 | 598 | $config = $c->getConfig(); |
599 | 599 | $appManager = $c->getAppManager(); |
600 | 600 | } else { |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | $c->getTempManager() |
613 | 613 | ); |
614 | 614 | }); |
615 | - $this->registerService('Request', function ($c) { |
|
615 | + $this->registerService('Request', function($c) { |
|
616 | 616 | if (isset($this['urlParams'])) { |
617 | 617 | $urlParams = $this['urlParams']; |
618 | 618 | } else { |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | $stream |
647 | 647 | ); |
648 | 648 | }); |
649 | - $this->registerService('Mailer', function (Server $c) { |
|
649 | + $this->registerService('Mailer', function(Server $c) { |
|
650 | 650 | return new Mailer( |
651 | 651 | $c->getConfig(), |
652 | 652 | $c->getLogger(), |
@@ -656,14 +656,14 @@ discard block |
||
656 | 656 | $this->registerService('LDAPProvider', function(Server $c) { |
657 | 657 | $config = $c->getConfig(); |
658 | 658 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
659 | - if(is_null($factoryClass)) { |
|
659 | + if (is_null($factoryClass)) { |
|
660 | 660 | throw new \Exception('ldapProviderFactory not set'); |
661 | 661 | } |
662 | 662 | /** @var \OCP\LDAP\ILDAPProviderFactory $factory */ |
663 | 663 | $factory = new $factoryClass($this); |
664 | 664 | return $factory->getLDAPProvider(); |
665 | 665 | }); |
666 | - $this->registerService('LockingProvider', function (Server $c) { |
|
666 | + $this->registerService('LockingProvider', function(Server $c) { |
|
667 | 667 | $ini = $c->getIniWrapper(); |
668 | 668 | $config = $c->getConfig(); |
669 | 669 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -678,29 +678,29 @@ discard block |
||
678 | 678 | } |
679 | 679 | return new NoopLockingProvider(); |
680 | 680 | }); |
681 | - $this->registerService('MountManager', function () { |
|
681 | + $this->registerService('MountManager', function() { |
|
682 | 682 | return new \OC\Files\Mount\Manager(); |
683 | 683 | }); |
684 | - $this->registerService('MimeTypeDetector', function (Server $c) { |
|
684 | + $this->registerService('MimeTypeDetector', function(Server $c) { |
|
685 | 685 | return new \OC\Files\Type\Detection( |
686 | 686 | $c->getURLGenerator(), |
687 | 687 | \OC::$configDir, |
688 | - \OC::$SERVERROOT . '/resources/config/' |
|
688 | + \OC::$SERVERROOT.'/resources/config/' |
|
689 | 689 | ); |
690 | 690 | }); |
691 | - $this->registerService('MimeTypeLoader', function (Server $c) { |
|
691 | + $this->registerService('MimeTypeLoader', function(Server $c) { |
|
692 | 692 | return new \OC\Files\Type\Loader( |
693 | 693 | $c->getDatabaseConnection() |
694 | 694 | ); |
695 | 695 | }); |
696 | - $this->registerService('NotificationManager', function (Server $c) { |
|
696 | + $this->registerService('NotificationManager', function(Server $c) { |
|
697 | 697 | return new Manager( |
698 | 698 | $c->query(IValidator::class) |
699 | 699 | ); |
700 | 700 | }); |
701 | - $this->registerService('CapabilitiesManager', function (Server $c) { |
|
701 | + $this->registerService('CapabilitiesManager', function(Server $c) { |
|
702 | 702 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
703 | - $manager->registerCapability(function () use ($c) { |
|
703 | + $manager->registerCapability(function() use ($c) { |
|
704 | 704 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
705 | 705 | }); |
706 | 706 | return $manager; |
@@ -738,10 +738,10 @@ discard block |
||
738 | 738 | } |
739 | 739 | return new \OC_Defaults(); |
740 | 740 | }); |
741 | - $this->registerService('EventDispatcher', function () { |
|
741 | + $this->registerService('EventDispatcher', function() { |
|
742 | 742 | return new EventDispatcher(); |
743 | 743 | }); |
744 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
744 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
745 | 745 | // FIXME: Instantiiated here due to cyclic dependency |
746 | 746 | $request = new Request( |
747 | 747 | [ |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | $request |
767 | 767 | ); |
768 | 768 | }); |
769 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
769 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
770 | 770 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
771 | 771 | |
772 | 772 | return new CsrfTokenManager( |
@@ -774,10 +774,10 @@ discard block |
||
774 | 774 | $c->query(SessionStorage::class) |
775 | 775 | ); |
776 | 776 | }); |
777 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
777 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
778 | 778 | return new SessionStorage($c->getSession()); |
779 | 779 | }); |
780 | - $this->registerService('ContentSecurityPolicyManager', function (Server $c) { |
|
780 | + $this->registerService('ContentSecurityPolicyManager', function(Server $c) { |
|
781 | 781 | return new ContentSecurityPolicyManager(); |
782 | 782 | }); |
783 | 783 | $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
@@ -822,23 +822,23 @@ discard block |
||
822 | 822 | ); |
823 | 823 | return $manager; |
824 | 824 | }); |
825 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
825 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
826 | 826 | return new \OC\Files\AppData\Factory( |
827 | 827 | $c->getRootFolder(), |
828 | 828 | $c->getSystemConfig() |
829 | 829 | ); |
830 | 830 | }); |
831 | 831 | |
832 | - $this->registerService('LockdownManager', function (Server $c) { |
|
832 | + $this->registerService('LockdownManager', function(Server $c) { |
|
833 | 833 | return new LockdownManager(); |
834 | 834 | }); |
835 | 835 | |
836 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
836 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
837 | 837 | return new CloudIdManager(); |
838 | 838 | }); |
839 | 839 | |
840 | 840 | /* To trick DI since we don't extend the DIContainer here */ |
841 | - $this->registerService(CleanPreviewsBackgroundJob::class, function (Server $c) { |
|
841 | + $this->registerService(CleanPreviewsBackgroundJob::class, function(Server $c) { |
|
842 | 842 | return new CleanPreviewsBackgroundJob( |
843 | 843 | $c->getRootFolder(), |
844 | 844 | $c->getLogger(), |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | * @deprecated since 9.2.0 use IAppData |
983 | 983 | */ |
984 | 984 | public function getAppFolder() { |
985 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
985 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
986 | 986 | $root = $this->getRootFolder(); |
987 | 987 | if (!$root->nodeExists($dir)) { |
988 | 988 | $folder = $root->newFolder($dir); |