@@ -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 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | |
149 | 149 | |
150 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
150 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
151 | 151 | return new PreviewManager( |
152 | 152 | $c->getConfig(), |
153 | 153 | $c->getRootFolder(), |
@@ -158,13 +158,13 @@ discard block |
||
158 | 158 | }); |
159 | 159 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
160 | 160 | |
161 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
161 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
162 | 162 | return new \OC\Preview\Watcher( |
163 | 163 | $c->getAppDataDir('preview') |
164 | 164 | ); |
165 | 165 | }); |
166 | 166 | |
167 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
167 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
168 | 168 | $view = new View(); |
169 | 169 | $util = new Encryption\Util( |
170 | 170 | $view, |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | ); |
183 | 183 | }); |
184 | 184 | |
185 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
185 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
186 | 186 | $util = new Encryption\Util( |
187 | 187 | new View(), |
188 | 188 | $c->getUserManager(), |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | ); |
197 | 197 | }); |
198 | 198 | |
199 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
199 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
200 | 200 | $view = new View(); |
201 | 201 | $util = new Encryption\Util( |
202 | 202 | $view, |
@@ -207,32 +207,32 @@ discard block |
||
207 | 207 | |
208 | 208 | return new Encryption\Keys\Storage($view, $util); |
209 | 209 | }); |
210 | - $this->registerService('TagMapper', function (Server $c) { |
|
210 | + $this->registerService('TagMapper', function(Server $c) { |
|
211 | 211 | return new TagMapper($c->getDatabaseConnection()); |
212 | 212 | }); |
213 | 213 | |
214 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
214 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
215 | 215 | $tagMapper = $c->query('TagMapper'); |
216 | 216 | return new TagManager($tagMapper, $c->getUserSession()); |
217 | 217 | }); |
218 | 218 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
219 | 219 | |
220 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
220 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
221 | 221 | $config = $c->getConfig(); |
222 | 222 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory'); |
223 | 223 | /** @var \OC\SystemTag\ManagerFactory $factory */ |
224 | 224 | $factory = new $factoryClass($this); |
225 | 225 | return $factory; |
226 | 226 | }); |
227 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
227 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
228 | 228 | return $c->query('SystemTagManagerFactory')->getManager(); |
229 | 229 | }); |
230 | 230 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
231 | 231 | |
232 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
232 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
233 | 233 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
234 | 234 | }); |
235 | - $this->registerService('RootFolder', function (Server $c) { |
|
235 | + $this->registerService('RootFolder', function(Server $c) { |
|
236 | 236 | $manager = \OC\Files\Filesystem::getMountManager(null); |
237 | 237 | $view = new View(); |
238 | 238 | $root = new Root( |
@@ -260,30 +260,30 @@ discard block |
||
260 | 260 | }); |
261 | 261 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
262 | 262 | |
263 | - $this->registerService(\OCP\IUserManager::class, function (Server $c) { |
|
263 | + $this->registerService(\OCP\IUserManager::class, function(Server $c) { |
|
264 | 264 | $config = $c->getConfig(); |
265 | 265 | return new \OC\User\Manager($config); |
266 | 266 | }); |
267 | 267 | $this->registerAlias('UserManager', \OCP\IUserManager::class); |
268 | 268 | |
269 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
269 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
270 | 270 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
271 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
271 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
272 | 272 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
273 | 273 | }); |
274 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
274 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
275 | 275 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
276 | 276 | }); |
277 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
277 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
278 | 278 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
279 | 279 | }); |
280 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
280 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
281 | 281 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
282 | 282 | }); |
283 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
283 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
284 | 284 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
285 | 285 | }); |
286 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
286 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
287 | 287 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
288 | 288 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
289 | 289 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -303,11 +303,11 @@ discard block |
||
303 | 303 | return new Store($session, $logger, $tokenProvider); |
304 | 304 | }); |
305 | 305 | $this->registerAlias(IStore::class, Store::class); |
306 | - $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) { |
|
306 | + $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function(Server $c) { |
|
307 | 307 | $dbConnection = $c->getDatabaseConnection(); |
308 | 308 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
309 | 309 | }); |
310 | - $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function (Server $c) { |
|
310 | + $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function(Server $c) { |
|
311 | 311 | $mapper = $c->query('OC\Authentication\Token\DefaultTokenMapper'); |
312 | 312 | $crypto = $c->getCrypto(); |
313 | 313 | $config = $c->getConfig(); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | }); |
318 | 318 | $this->registerAlias('OC\Authentication\Token\IProvider', 'OC\Authentication\Token\DefaultTokenProvider'); |
319 | 319 | |
320 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
320 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
321 | 321 | $manager = $c->getUserManager(); |
322 | 322 | $session = new \OC\Session\Memory(''); |
323 | 323 | $timeFactory = new TimeFactory(); |
@@ -330,40 +330,40 @@ discard block |
||
330 | 330 | } |
331 | 331 | |
332 | 332 | $userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $c->getConfig(), $c->getSecureRandom(), $c->getLockdownManager()); |
333 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
333 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
334 | 334 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
335 | 335 | }); |
336 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
336 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
337 | 337 | /** @var $user \OC\User\User */ |
338 | 338 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
339 | 339 | }); |
340 | - $userSession->listen('\OC\User', 'preDelete', function ($user) { |
|
340 | + $userSession->listen('\OC\User', 'preDelete', function($user) { |
|
341 | 341 | /** @var $user \OC\User\User */ |
342 | 342 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
343 | 343 | }); |
344 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
344 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
345 | 345 | /** @var $user \OC\User\User */ |
346 | 346 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
347 | 347 | }); |
348 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
348 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
349 | 349 | /** @var $user \OC\User\User */ |
350 | 350 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
351 | 351 | }); |
352 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
352 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
353 | 353 | /** @var $user \OC\User\User */ |
354 | 354 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
355 | 355 | }); |
356 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
356 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
357 | 357 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
358 | 358 | }); |
359 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
359 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
360 | 360 | /** @var $user \OC\User\User */ |
361 | 361 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
362 | 362 | }); |
363 | - $userSession->listen('\OC\User', 'logout', function () { |
|
363 | + $userSession->listen('\OC\User', 'logout', function() { |
|
364 | 364 | \OC_Hook::emit('OC_User', 'logout', array()); |
365 | 365 | }); |
366 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
366 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
367 | 367 | /** @var $user \OC\User\User */ |
368 | 368 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
369 | 369 | }); |
@@ -371,14 +371,14 @@ discard block |
||
371 | 371 | }); |
372 | 372 | $this->registerAlias('UserSession', \OCP\IUserSession::class); |
373 | 373 | |
374 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
374 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
375 | 375 | return new \OC\Authentication\TwoFactorAuth\Manager($c->getAppManager(), $c->getSession(), $c->getConfig(), $c->getActivityManager(), $c->getLogger()); |
376 | 376 | }); |
377 | 377 | |
378 | 378 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
379 | 379 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
380 | 380 | |
381 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
381 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
382 | 382 | return new \OC\AllConfig( |
383 | 383 | $c->getSystemConfig() |
384 | 384 | ); |
@@ -386,17 +386,17 @@ discard block |
||
386 | 386 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
387 | 387 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
388 | 388 | |
389 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
389 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
390 | 390 | return new \OC\SystemConfig($config); |
391 | 391 | }); |
392 | 392 | |
393 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
393 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
394 | 394 | return new \OC\AppConfig($c->getDatabaseConnection()); |
395 | 395 | }); |
396 | 396 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
397 | 397 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
398 | 398 | |
399 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
399 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
400 | 400 | return new \OC\L10N\Factory( |
401 | 401 | $c->getConfig(), |
402 | 402 | $c->getRequest(), |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | }); |
407 | 407 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
408 | 408 | |
409 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
409 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
410 | 410 | $config = $c->getConfig(); |
411 | 411 | $cacheFactory = $c->getMemCacheFactory(); |
412 | 412 | return new \OC\URLGenerator( |
@@ -416,10 +416,10 @@ discard block |
||
416 | 416 | }); |
417 | 417 | $this->registerAlias('URLGenerator', \OCP\IURLGenerator::class); |
418 | 418 | |
419 | - $this->registerService('AppHelper', function ($c) { |
|
419 | + $this->registerService('AppHelper', function($c) { |
|
420 | 420 | return new \OC\AppHelper(); |
421 | 421 | }); |
422 | - $this->registerService('AppFetcher', function ($c) { |
|
422 | + $this->registerService('AppFetcher', function($c) { |
|
423 | 423 | return new AppFetcher( |
424 | 424 | $this->getAppDataDir('appstore'), |
425 | 425 | $this->getHTTPClientService(), |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | $this->getConfig() |
428 | 428 | ); |
429 | 429 | }); |
430 | - $this->registerService('CategoryFetcher', function ($c) { |
|
430 | + $this->registerService('CategoryFetcher', function($c) { |
|
431 | 431 | return new CategoryFetcher( |
432 | 432 | $this->getAppDataDir('appstore'), |
433 | 433 | $this->getHTTPClientService(), |
@@ -436,21 +436,21 @@ discard block |
||
436 | 436 | ); |
437 | 437 | }); |
438 | 438 | |
439 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
439 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
440 | 440 | return new Cache\File(); |
441 | 441 | }); |
442 | 442 | $this->registerAlias('UserCache', \OCP\ICache::class); |
443 | 443 | |
444 | - $this->registerService(Factory::class, function (Server $c) { |
|
444 | + $this->registerService(Factory::class, function(Server $c) { |
|
445 | 445 | $config = $c->getConfig(); |
446 | 446 | |
447 | 447 | if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) { |
448 | 448 | $v = \OC_App::getAppVersions(); |
449 | - $v['core'] = md5(file_get_contents(\OC::$SERVERROOT . '/version.php')); |
|
449 | + $v['core'] = md5(file_get_contents(\OC::$SERVERROOT.'/version.php')); |
|
450 | 450 | $version = implode(',', $v); |
451 | 451 | $instanceId = \OC_Util::getInstanceId(); |
452 | 452 | $path = \OC::$SERVERROOT; |
453 | - $prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . \OC::$WEBROOT); |
|
453 | + $prefix = md5($instanceId.'-'.$version.'-'.$path.'-'.\OC::$WEBROOT); |
|
454 | 454 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
455 | 455 | $config->getSystemValue('memcache.local', null), |
456 | 456 | $config->getSystemValue('memcache.distributed', null), |
@@ -467,12 +467,12 @@ discard block |
||
467 | 467 | $this->registerAlias('MemCacheFactory', Factory::class); |
468 | 468 | $this->registerAlias(ICacheFactory::class, Factory::class); |
469 | 469 | |
470 | - $this->registerService('RedisFactory', function (Server $c) { |
|
470 | + $this->registerService('RedisFactory', function(Server $c) { |
|
471 | 471 | $systemConfig = $c->getSystemConfig(); |
472 | 472 | return new RedisFactory($systemConfig); |
473 | 473 | }); |
474 | 474 | |
475 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
475 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
476 | 476 | return new \OC\Activity\Manager( |
477 | 477 | $c->getRequest(), |
478 | 478 | $c->getUserSession(), |
@@ -482,14 +482,14 @@ discard block |
||
482 | 482 | }); |
483 | 483 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
484 | 484 | |
485 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
485 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
486 | 486 | return new \OC\Activity\EventMerger( |
487 | 487 | $c->getL10N('lib') |
488 | 488 | ); |
489 | 489 | }); |
490 | 490 | $this->registerAlias(IValidator::class, Validator::class); |
491 | 491 | |
492 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
492 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
493 | 493 | return new AvatarManager( |
494 | 494 | $c->getUserManager(), |
495 | 495 | $c->getAppDataDir('avatar'), |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | }); |
501 | 501 | $this->registerAlias('AvatarManager', \OCP\IAvatarManager::class); |
502 | 502 | |
503 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
503 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
504 | 504 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
505 | 505 | $logger = Log::getLogClass($logType); |
506 | 506 | call_user_func(array($logger, 'init')); |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | }); |
510 | 510 | $this->registerAlias('Logger', \OCP\ILogger::class); |
511 | 511 | |
512 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
512 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
513 | 513 | $config = $c->getConfig(); |
514 | 514 | return new \OC\BackgroundJob\JobList( |
515 | 515 | $c->getDatabaseConnection(), |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | }); |
520 | 520 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
521 | 521 | |
522 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
522 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
523 | 523 | $cacheFactory = $c->getMemCacheFactory(); |
524 | 524 | $logger = $c->getLogger(); |
525 | 525 | if ($cacheFactory->isAvailable()) { |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | }); |
532 | 532 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
533 | 533 | |
534 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
534 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
535 | 535 | return new Search(); |
536 | 536 | }); |
537 | 537 | $this->registerAlias('Search', \OCP\ISearch::class); |
@@ -551,27 +551,27 @@ discard block |
||
551 | 551 | ); |
552 | 552 | }); |
553 | 553 | |
554 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
554 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
555 | 555 | return new SecureRandom(); |
556 | 556 | }); |
557 | 557 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
558 | 558 | |
559 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
559 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
560 | 560 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
561 | 561 | }); |
562 | 562 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
563 | 563 | |
564 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
564 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
565 | 565 | return new Hasher($c->getConfig()); |
566 | 566 | }); |
567 | 567 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
568 | 568 | |
569 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
569 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
570 | 570 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
571 | 571 | }); |
572 | 572 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
573 | 573 | |
574 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
574 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
575 | 575 | $systemConfig = $c->getSystemConfig(); |
576 | 576 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
577 | 577 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | }); |
586 | 586 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
587 | 587 | |
588 | - $this->registerService('HTTPHelper', function (Server $c) { |
|
588 | + $this->registerService('HTTPHelper', function(Server $c) { |
|
589 | 589 | $config = $c->getConfig(); |
590 | 590 | return new HTTPHelper( |
591 | 591 | $config, |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | ); |
594 | 594 | }); |
595 | 595 | |
596 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
596 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
597 | 597 | $user = \OC_User::getUser(); |
598 | 598 | $uid = $user ? $user : null; |
599 | 599 | return new ClientService( |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | }); |
604 | 604 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
605 | 605 | |
606 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
606 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
607 | 607 | if ($c->getSystemConfig()->getValue('debug', false)) { |
608 | 608 | return new EventLogger(); |
609 | 609 | } else { |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | }); |
613 | 613 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
614 | 614 | |
615 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
615 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
616 | 616 | if ($c->getSystemConfig()->getValue('debug', false)) { |
617 | 617 | return new QueryLogger(); |
618 | 618 | } else { |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | }); |
622 | 622 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
623 | 623 | |
624 | - $this->registerService(TempManager::class, function (Server $c) { |
|
624 | + $this->registerService(TempManager::class, function(Server $c) { |
|
625 | 625 | return new TempManager( |
626 | 626 | $c->getLogger(), |
627 | 627 | $c->getConfig() |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | $this->registerAlias('TempManager', TempManager::class); |
631 | 631 | $this->registerAlias(ITempManager::class, TempManager::class); |
632 | 632 | |
633 | - $this->registerService(AppManager::class, function (Server $c) { |
|
633 | + $this->registerService(AppManager::class, function(Server $c) { |
|
634 | 634 | return new \OC\App\AppManager( |
635 | 635 | $c->getUserSession(), |
636 | 636 | $c->getAppConfig(), |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | $this->registerAlias('AppManager', AppManager::class); |
643 | 643 | $this->registerAlias(IAppManager::class, AppManager::class); |
644 | 644 | |
645 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
645 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
646 | 646 | return new DateTimeZone( |
647 | 647 | $c->getConfig(), |
648 | 648 | $c->getSession() |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | }); |
651 | 651 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
652 | 652 | |
653 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
653 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
654 | 654 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
655 | 655 | |
656 | 656 | return new DateTimeFormatter( |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | }); |
661 | 661 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
662 | 662 | |
663 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
663 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
664 | 664 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
665 | 665 | $listener = new UserMountCacheListener($mountCache); |
666 | 666 | $listener->listen($c->getUserManager()); |
@@ -668,10 +668,10 @@ discard block |
||
668 | 668 | }); |
669 | 669 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
670 | 670 | |
671 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
671 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
672 | 672 | $loader = \OC\Files\Filesystem::getLoader(); |
673 | 673 | $mountCache = $c->query('UserMountCache'); |
674 | - $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
674 | + $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
675 | 675 | |
676 | 676 | // builtin providers |
677 | 677 | |
@@ -684,14 +684,14 @@ discard block |
||
684 | 684 | }); |
685 | 685 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
686 | 686 | |
687 | - $this->registerService('IniWrapper', function ($c) { |
|
687 | + $this->registerService('IniWrapper', function($c) { |
|
688 | 688 | return new IniGetWrapper(); |
689 | 689 | }); |
690 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
690 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
691 | 691 | $jobList = $c->getJobList(); |
692 | 692 | return new AsyncBus($jobList); |
693 | 693 | }); |
694 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
694 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
695 | 695 | return new TrustedDomainHelper($this->getConfig()); |
696 | 696 | }); |
697 | 697 | $this->registerService('Throttler', function(Server $c) { |
@@ -702,10 +702,10 @@ discard block |
||
702 | 702 | $c->getConfig() |
703 | 703 | ); |
704 | 704 | }); |
705 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
705 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
706 | 706 | // IConfig and IAppManager requires a working database. This code |
707 | 707 | // might however be called when ownCloud is not yet setup. |
708 | - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
708 | + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
709 | 709 | $config = $c->getConfig(); |
710 | 710 | $appManager = $c->getAppManager(); |
711 | 711 | } else { |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | $c->getTempManager() |
724 | 724 | ); |
725 | 725 | }); |
726 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
726 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
727 | 727 | if (isset($this['urlParams'])) { |
728 | 728 | $urlParams = $this['urlParams']; |
729 | 729 | } else { |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | }); |
760 | 760 | $this->registerAlias('Request', \OCP\IRequest::class); |
761 | 761 | |
762 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
762 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
763 | 763 | return new Mailer( |
764 | 764 | $c->getConfig(), |
765 | 765 | $c->getLogger(), |
@@ -773,14 +773,14 @@ discard block |
||
773 | 773 | $this->registerService('LDAPProvider', function(Server $c) { |
774 | 774 | $config = $c->getConfig(); |
775 | 775 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
776 | - if(is_null($factoryClass)) { |
|
776 | + if (is_null($factoryClass)) { |
|
777 | 777 | throw new \Exception('ldapProviderFactory not set'); |
778 | 778 | } |
779 | 779 | /** @var \OCP\LDAP\ILDAPProviderFactory $factory */ |
780 | 780 | $factory = new $factoryClass($this); |
781 | 781 | return $factory->getLDAPProvider(); |
782 | 782 | }); |
783 | - $this->registerService('LockingProvider', function (Server $c) { |
|
783 | + $this->registerService('LockingProvider', function(Server $c) { |
|
784 | 784 | $ini = $c->getIniWrapper(); |
785 | 785 | $config = $c->getConfig(); |
786 | 786 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -796,37 +796,37 @@ discard block |
||
796 | 796 | return new NoopLockingProvider(); |
797 | 797 | }); |
798 | 798 | |
799 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
799 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
800 | 800 | return new \OC\Files\Mount\Manager(); |
801 | 801 | }); |
802 | 802 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
803 | 803 | |
804 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
804 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
805 | 805 | return new \OC\Files\Type\Detection( |
806 | 806 | $c->getURLGenerator(), |
807 | 807 | \OC::$configDir, |
808 | - \OC::$SERVERROOT . '/resources/config/' |
|
808 | + \OC::$SERVERROOT.'/resources/config/' |
|
809 | 809 | ); |
810 | 810 | }); |
811 | 811 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
812 | 812 | |
813 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
813 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
814 | 814 | return new \OC\Files\Type\Loader( |
815 | 815 | $c->getDatabaseConnection() |
816 | 816 | ); |
817 | 817 | }); |
818 | 818 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
819 | 819 | |
820 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
820 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
821 | 821 | return new Manager( |
822 | 822 | $c->query(IValidator::class) |
823 | 823 | ); |
824 | 824 | }); |
825 | 825 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
826 | 826 | |
827 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
827 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
828 | 828 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
829 | - $manager->registerCapability(function () use ($c) { |
|
829 | + $manager->registerCapability(function() use ($c) { |
|
830 | 830 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
831 | 831 | }); |
832 | 832 | return $manager; |
@@ -882,13 +882,13 @@ discard block |
||
882 | 882 | $cacheFactory->createLocal('SCSS') |
883 | 883 | ); |
884 | 884 | }); |
885 | - $this->registerService(EventDispatcher::class, function () { |
|
885 | + $this->registerService(EventDispatcher::class, function() { |
|
886 | 886 | return new EventDispatcher(); |
887 | 887 | }); |
888 | 888 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
889 | 889 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
890 | 890 | |
891 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
891 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
892 | 892 | // FIXME: Instantiiated here due to cyclic dependency |
893 | 893 | $request = new Request( |
894 | 894 | [ |
@@ -913,7 +913,7 @@ discard block |
||
913 | 913 | $request |
914 | 914 | ); |
915 | 915 | }); |
916 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
916 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
917 | 917 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
918 | 918 | |
919 | 919 | return new CsrfTokenManager( |
@@ -921,10 +921,10 @@ discard block |
||
921 | 921 | $c->query(SessionStorage::class) |
922 | 922 | ); |
923 | 923 | }); |
924 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
924 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
925 | 925 | return new SessionStorage($c->getSession()); |
926 | 926 | }); |
927 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
927 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
928 | 928 | return new ContentSecurityPolicyManager(); |
929 | 929 | }); |
930 | 930 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
@@ -975,29 +975,29 @@ discard block |
||
975 | 975 | ); |
976 | 976 | return $manager; |
977 | 977 | }); |
978 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
978 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
979 | 979 | return new \OC\Files\AppData\Factory( |
980 | 980 | $c->getRootFolder(), |
981 | 981 | $c->getSystemConfig() |
982 | 982 | ); |
983 | 983 | }); |
984 | 984 | |
985 | - $this->registerService('LockdownManager', function (Server $c) { |
|
985 | + $this->registerService('LockdownManager', function(Server $c) { |
|
986 | 986 | return new LockdownManager(function() use ($c) { |
987 | 987 | return $c->getSession(); |
988 | 988 | }); |
989 | 989 | }); |
990 | 990 | |
991 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
991 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
992 | 992 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
993 | 993 | }); |
994 | 994 | |
995 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
995 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
996 | 996 | return new CloudIdManager(); |
997 | 997 | }); |
998 | 998 | |
999 | 999 | /* To trick DI since we don't extend the DIContainer here */ |
1000 | - $this->registerService(CleanPreviewsBackgroundJob::class, function (Server $c) { |
|
1000 | + $this->registerService(CleanPreviewsBackgroundJob::class, function(Server $c) { |
|
1001 | 1001 | return new CleanPreviewsBackgroundJob( |
1002 | 1002 | $c->getRootFolder(), |
1003 | 1003 | $c->getLogger(), |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
1013 | 1013 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1014 | 1014 | |
1015 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1015 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1016 | 1016 | return new Defaults( |
1017 | 1017 | $c->getThemingDefaults() |
1018 | 1018 | ); |
@@ -1164,7 +1164,7 @@ discard block |
||
1164 | 1164 | * @deprecated since 9.2.0 use IAppData |
1165 | 1165 | */ |
1166 | 1166 | public function getAppFolder() { |
1167 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
1167 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
1168 | 1168 | $root = $this->getRootFolder(); |
1169 | 1169 | if (!$root->nodeExists($dir)) { |
1170 | 1170 | $folder = $root->newFolder($dir); |