@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | parent::__construct(); |
162 | 162 | $this->webRoot = $webRoot; |
163 | 163 | |
164 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
164 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
165 | 165 | return $c; |
166 | 166 | }); |
167 | 167 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
175 | 175 | |
176 | 176 | |
177 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
177 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
178 | 178 | return new PreviewManager( |
179 | 179 | $c->getConfig(), |
180 | 180 | $c->getRootFolder(), |
@@ -185,13 +185,13 @@ discard block |
||
185 | 185 | }); |
186 | 186 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
187 | 187 | |
188 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
188 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
189 | 189 | return new \OC\Preview\Watcher( |
190 | 190 | $c->getAppDataDir('preview') |
191 | 191 | ); |
192 | 192 | }); |
193 | 193 | |
194 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
194 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
195 | 195 | $view = new View(); |
196 | 196 | $util = new Encryption\Util( |
197 | 197 | $view, |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | ); |
210 | 210 | }); |
211 | 211 | |
212 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
212 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
213 | 213 | $util = new Encryption\Util( |
214 | 214 | new View(), |
215 | 215 | $c->getUserManager(), |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | ); |
224 | 224 | }); |
225 | 225 | |
226 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
226 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
227 | 227 | $view = new View(); |
228 | 228 | $util = new Encryption\Util( |
229 | 229 | $view, |
@@ -234,30 +234,30 @@ discard block |
||
234 | 234 | |
235 | 235 | return new Encryption\Keys\Storage($view, $util); |
236 | 236 | }); |
237 | - $this->registerService('TagMapper', function (Server $c) { |
|
237 | + $this->registerService('TagMapper', function(Server $c) { |
|
238 | 238 | return new TagMapper($c->getDatabaseConnection()); |
239 | 239 | }); |
240 | 240 | |
241 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
241 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
242 | 242 | $tagMapper = $c->query('TagMapper'); |
243 | 243 | return new TagManager($tagMapper, $c->getUserSession()); |
244 | 244 | }); |
245 | 245 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
246 | 246 | |
247 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
247 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
248 | 248 | $config = $c->getConfig(); |
249 | 249 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
250 | 250 | return new $factoryClass($this); |
251 | 251 | }); |
252 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
252 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
253 | 253 | return $c->query('SystemTagManagerFactory')->getManager(); |
254 | 254 | }); |
255 | 255 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
256 | 256 | |
257 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
257 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
258 | 258 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
259 | 259 | }); |
260 | - $this->registerService('RootFolder', function (Server $c) { |
|
260 | + $this->registerService('RootFolder', function(Server $c) { |
|
261 | 261 | $manager = \OC\Files\Filesystem::getMountManager(null); |
262 | 262 | $view = new View(); |
263 | 263 | $root = new Root( |
@@ -278,38 +278,38 @@ discard block |
||
278 | 278 | }); |
279 | 279 | $this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class); |
280 | 280 | |
281 | - $this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) { |
|
282 | - return new LazyRoot(function () use ($c) { |
|
281 | + $this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) { |
|
282 | + return new LazyRoot(function() use ($c) { |
|
283 | 283 | return $c->query('RootFolder'); |
284 | 284 | }); |
285 | 285 | }); |
286 | 286 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
287 | 287 | |
288 | - $this->registerService(\OC\User\Manager::class, function (Server $c) { |
|
288 | + $this->registerService(\OC\User\Manager::class, function(Server $c) { |
|
289 | 289 | $config = $c->getConfig(); |
290 | 290 | return new \OC\User\Manager($config); |
291 | 291 | }); |
292 | 292 | $this->registerAlias('UserManager', \OC\User\Manager::class); |
293 | 293 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
294 | 294 | |
295 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
295 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
296 | 296 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
297 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
297 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
298 | 298 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
299 | 299 | }); |
300 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
300 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
301 | 301 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
302 | 302 | }); |
303 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
303 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
304 | 304 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
305 | 305 | }); |
306 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
306 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
307 | 307 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
308 | 308 | }); |
309 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
309 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
310 | 310 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
311 | 311 | }); |
312 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
312 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
313 | 313 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
314 | 314 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
315 | 315 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | }); |
319 | 319 | $this->registerAlias('GroupManager', \OCP\IGroupManager::class); |
320 | 320 | |
321 | - $this->registerService(Store::class, function (Server $c) { |
|
321 | + $this->registerService(Store::class, function(Server $c) { |
|
322 | 322 | $session = $c->getSession(); |
323 | 323 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
324 | 324 | $tokenProvider = $c->query(IProvider::class); |
@@ -329,11 +329,11 @@ discard block |
||
329 | 329 | return new Store($session, $logger, $tokenProvider); |
330 | 330 | }); |
331 | 331 | $this->registerAlias(IStore::class, Store::class); |
332 | - $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { |
|
332 | + $this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) { |
|
333 | 333 | $dbConnection = $c->getDatabaseConnection(); |
334 | 334 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
335 | 335 | }); |
336 | - $this->registerService(Authentication\Token\DefaultTokenProvider::class, function (Server $c) { |
|
336 | + $this->registerService(Authentication\Token\DefaultTokenProvider::class, function(Server $c) { |
|
337 | 337 | $mapper = $c->query(Authentication\Token\DefaultTokenMapper::class); |
338 | 338 | $crypto = $c->getCrypto(); |
339 | 339 | $config = $c->getConfig(); |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | }); |
344 | 344 | $this->registerAlias(IProvider::class, Authentication\Token\DefaultTokenProvider::class); |
345 | 345 | |
346 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
346 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
347 | 347 | $manager = $c->getUserManager(); |
348 | 348 | $session = new \OC\Session\Memory(''); |
349 | 349 | $timeFactory = new TimeFactory(); |
@@ -367,45 +367,45 @@ discard block |
||
367 | 367 | $c->getLockdownManager(), |
368 | 368 | $c->getLogger() |
369 | 369 | ); |
370 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
370 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
371 | 371 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
372 | 372 | }); |
373 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
373 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
374 | 374 | /** @var $user \OC\User\User */ |
375 | 375 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
376 | 376 | }); |
377 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) { |
|
377 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) { |
|
378 | 378 | /** @var $user \OC\User\User */ |
379 | 379 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
380 | 380 | $dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
381 | 381 | }); |
382 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
382 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
383 | 383 | /** @var $user \OC\User\User */ |
384 | 384 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
385 | 385 | }); |
386 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
386 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
387 | 387 | /** @var $user \OC\User\User */ |
388 | 388 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
389 | 389 | }); |
390 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
390 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
391 | 391 | /** @var $user \OC\User\User */ |
392 | 392 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
393 | 393 | }); |
394 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
394 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
395 | 395 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
396 | 396 | }); |
397 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
397 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
398 | 398 | /** @var $user \OC\User\User */ |
399 | 399 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
400 | 400 | }); |
401 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
401 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
402 | 402 | /** @var $user \OC\User\User */ |
403 | 403 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
404 | 404 | }); |
405 | - $userSession->listen('\OC\User', 'logout', function () { |
|
405 | + $userSession->listen('\OC\User', 'logout', function() { |
|
406 | 406 | \OC_Hook::emit('OC_User', 'logout', array()); |
407 | 407 | }); |
408 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
408 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
409 | 409 | /** @var $user \OC\User\User */ |
410 | 410 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
411 | 411 | $dispatcher->dispatch('OCP\IUser::changeUser', new GenericEvent($user, ['feature' => $feature, 'oldValue' => $oldValue, 'value' => $value])); |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | }); |
415 | 415 | $this->registerAlias('UserSession', \OCP\IUserSession::class); |
416 | 416 | |
417 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
417 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
418 | 418 | return new \OC\Authentication\TwoFactorAuth\Manager( |
419 | 419 | $c->getAppManager(), |
420 | 420 | $c->getSession(), |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
431 | 431 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
432 | 432 | |
433 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
433 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
434 | 434 | return new \OC\AllConfig( |
435 | 435 | $c->getSystemConfig() |
436 | 436 | ); |
@@ -438,17 +438,17 @@ discard block |
||
438 | 438 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
439 | 439 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
440 | 440 | |
441 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
441 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
442 | 442 | return new \OC\SystemConfig($config); |
443 | 443 | }); |
444 | 444 | |
445 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
445 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
446 | 446 | return new \OC\AppConfig($c->getDatabaseConnection()); |
447 | 447 | }); |
448 | 448 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
449 | 449 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
450 | 450 | |
451 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
451 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
452 | 452 | return new \OC\L10N\Factory( |
453 | 453 | $c->getConfig(), |
454 | 454 | $c->getRequest(), |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | }); |
459 | 459 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
460 | 460 | |
461 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
461 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
462 | 462 | $config = $c->getConfig(); |
463 | 463 | $cacheFactory = $c->getMemCacheFactory(); |
464 | 464 | $request = $c->getRequest(); |
@@ -470,18 +470,18 @@ discard block |
||
470 | 470 | }); |
471 | 471 | $this->registerAlias('URLGenerator', \OCP\IURLGenerator::class); |
472 | 472 | |
473 | - $this->registerService('AppHelper', function ($c) { |
|
473 | + $this->registerService('AppHelper', function($c) { |
|
474 | 474 | return new \OC\AppHelper(); |
475 | 475 | }); |
476 | 476 | $this->registerAlias('AppFetcher', AppFetcher::class); |
477 | 477 | $this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
478 | 478 | |
479 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
479 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
480 | 480 | return new Cache\File(); |
481 | 481 | }); |
482 | 482 | $this->registerAlias('UserCache', \OCP\ICache::class); |
483 | 483 | |
484 | - $this->registerService(Factory::class, function (Server $c) { |
|
484 | + $this->registerService(Factory::class, function(Server $c) { |
|
485 | 485 | |
486 | 486 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
487 | 487 | ArrayCache::class, |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | $version = implode(',', $v); |
499 | 499 | $instanceId = \OC_Util::getInstanceId(); |
500 | 500 | $path = \OC::$SERVERROOT; |
501 | - $prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . $urlGenerator->getBaseUrl()); |
|
501 | + $prefix = md5($instanceId.'-'.$version.'-'.$path.'-'.$urlGenerator->getBaseUrl()); |
|
502 | 502 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
503 | 503 | $config->getSystemValue('memcache.local', null), |
504 | 504 | $config->getSystemValue('memcache.distributed', null), |
@@ -511,12 +511,12 @@ discard block |
||
511 | 511 | $this->registerAlias('MemCacheFactory', Factory::class); |
512 | 512 | $this->registerAlias(ICacheFactory::class, Factory::class); |
513 | 513 | |
514 | - $this->registerService('RedisFactory', function (Server $c) { |
|
514 | + $this->registerService('RedisFactory', function(Server $c) { |
|
515 | 515 | $systemConfig = $c->getSystemConfig(); |
516 | 516 | return new RedisFactory($systemConfig); |
517 | 517 | }); |
518 | 518 | |
519 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
519 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
520 | 520 | return new \OC\Activity\Manager( |
521 | 521 | $c->getRequest(), |
522 | 522 | $c->getUserSession(), |
@@ -526,14 +526,14 @@ discard block |
||
526 | 526 | }); |
527 | 527 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
528 | 528 | |
529 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
529 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
530 | 530 | return new \OC\Activity\EventMerger( |
531 | 531 | $c->getL10N('lib') |
532 | 532 | ); |
533 | 533 | }); |
534 | 534 | $this->registerAlias(IValidator::class, Validator::class); |
535 | 535 | |
536 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
536 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
537 | 537 | return new AvatarManager( |
538 | 538 | $c->query(\OC\User\Manager::class), |
539 | 539 | $c->getAppDataDir('avatar'), |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | |
547 | 547 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
548 | 548 | |
549 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
549 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
550 | 550 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
551 | 551 | $logger = Log::getLogClass($logType); |
552 | 552 | call_user_func(array($logger, 'init')); |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | }); |
558 | 558 | $this->registerAlias('Logger', \OCP\ILogger::class); |
559 | 559 | |
560 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
560 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
561 | 561 | $config = $c->getConfig(); |
562 | 562 | return new \OC\BackgroundJob\JobList( |
563 | 563 | $c->getDatabaseConnection(), |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | }); |
568 | 568 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
569 | 569 | |
570 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
570 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
571 | 571 | $cacheFactory = $c->getMemCacheFactory(); |
572 | 572 | $logger = $c->getLogger(); |
573 | 573 | if ($cacheFactory->isAvailableLowLatency()) { |
@@ -579,12 +579,12 @@ discard block |
||
579 | 579 | }); |
580 | 580 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
581 | 581 | |
582 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
582 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
583 | 583 | return new Search(); |
584 | 584 | }); |
585 | 585 | $this->registerAlias('Search', \OCP\ISearch::class); |
586 | 586 | |
587 | - $this->registerService(\OC\Security\RateLimiting\Limiter::class, function ($c) { |
|
587 | + $this->registerService(\OC\Security\RateLimiting\Limiter::class, function($c) { |
|
588 | 588 | return new \OC\Security\RateLimiting\Limiter( |
589 | 589 | $this->getUserSession(), |
590 | 590 | $this->getRequest(), |
@@ -592,34 +592,34 @@ discard block |
||
592 | 592 | $c->query(\OC\Security\RateLimiting\Backend\IBackend::class) |
593 | 593 | ); |
594 | 594 | }); |
595 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
595 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
596 | 596 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
597 | 597 | $this->getMemCacheFactory(), |
598 | 598 | new \OC\AppFramework\Utility\TimeFactory() |
599 | 599 | ); |
600 | 600 | }); |
601 | 601 | |
602 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
602 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
603 | 603 | return new SecureRandom(); |
604 | 604 | }); |
605 | 605 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
606 | 606 | |
607 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
607 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
608 | 608 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
609 | 609 | }); |
610 | 610 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
611 | 611 | |
612 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
612 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
613 | 613 | return new Hasher($c->getConfig()); |
614 | 614 | }); |
615 | 615 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
616 | 616 | |
617 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
617 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
618 | 618 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
619 | 619 | }); |
620 | 620 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
621 | 621 | |
622 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
622 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
623 | 623 | $systemConfig = $c->getSystemConfig(); |
624 | 624 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
625 | 625 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | }); |
634 | 634 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
635 | 635 | |
636 | - $this->registerService('HTTPHelper', function (Server $c) { |
|
636 | + $this->registerService('HTTPHelper', function(Server $c) { |
|
637 | 637 | $config = $c->getConfig(); |
638 | 638 | return new HTTPHelper( |
639 | 639 | $config, |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | ); |
642 | 642 | }); |
643 | 643 | |
644 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
644 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
645 | 645 | $user = \OC_User::getUser(); |
646 | 646 | $uid = $user ? $user : null; |
647 | 647 | return new ClientService( |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | ); |
657 | 657 | }); |
658 | 658 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
659 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
659 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
660 | 660 | $eventLogger = new EventLogger(); |
661 | 661 | if ($c->getSystemConfig()->getValue('debug', false)) { |
662 | 662 | // In debug mode, module is being activated by default |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | }); |
667 | 667 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
668 | 668 | |
669 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
669 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
670 | 670 | $queryLogger = new QueryLogger(); |
671 | 671 | if ($c->getSystemConfig()->getValue('debug', false)) { |
672 | 672 | // In debug mode, module is being activated by default |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | }); |
677 | 677 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
678 | 678 | |
679 | - $this->registerService(TempManager::class, function (Server $c) { |
|
679 | + $this->registerService(TempManager::class, function(Server $c) { |
|
680 | 680 | return new TempManager( |
681 | 681 | $c->getLogger(), |
682 | 682 | $c->getConfig() |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | $this->registerAlias('TempManager', TempManager::class); |
686 | 686 | $this->registerAlias(ITempManager::class, TempManager::class); |
687 | 687 | |
688 | - $this->registerService(AppManager::class, function (Server $c) { |
|
688 | + $this->registerService(AppManager::class, function(Server $c) { |
|
689 | 689 | return new \OC\App\AppManager( |
690 | 690 | $c->getUserSession(), |
691 | 691 | $c->query(\OC\AppConfig::class), |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | $this->registerAlias('AppManager', AppManager::class); |
698 | 698 | $this->registerAlias(IAppManager::class, AppManager::class); |
699 | 699 | |
700 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
700 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
701 | 701 | return new DateTimeZone( |
702 | 702 | $c->getConfig(), |
703 | 703 | $c->getSession() |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | }); |
706 | 706 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
707 | 707 | |
708 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
708 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
709 | 709 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
710 | 710 | |
711 | 711 | return new DateTimeFormatter( |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | }); |
716 | 716 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
717 | 717 | |
718 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
718 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
719 | 719 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
720 | 720 | $listener = new UserMountCacheListener($mountCache); |
721 | 721 | $listener->listen($c->getUserManager()); |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | }); |
724 | 724 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
725 | 725 | |
726 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
726 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
727 | 727 | $loader = \OC\Files\Filesystem::getLoader(); |
728 | 728 | $mountCache = $c->query('UserMountCache'); |
729 | 729 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -739,10 +739,10 @@ discard block |
||
739 | 739 | }); |
740 | 740 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
741 | 741 | |
742 | - $this->registerService('IniWrapper', function ($c) { |
|
742 | + $this->registerService('IniWrapper', function($c) { |
|
743 | 743 | return new IniGetWrapper(); |
744 | 744 | }); |
745 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
745 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
746 | 746 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
747 | 747 | if ($busClass) { |
748 | 748 | list($app, $class) = explode('::', $busClass, 2); |
@@ -757,10 +757,10 @@ discard block |
||
757 | 757 | return new CronBus($jobList); |
758 | 758 | } |
759 | 759 | }); |
760 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
760 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
761 | 761 | return new TrustedDomainHelper($this->getConfig()); |
762 | 762 | }); |
763 | - $this->registerService('Throttler', function (Server $c) { |
|
763 | + $this->registerService('Throttler', function(Server $c) { |
|
764 | 764 | return new Throttler( |
765 | 765 | $c->getDatabaseConnection(), |
766 | 766 | new TimeFactory(), |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | $c->getConfig() |
769 | 769 | ); |
770 | 770 | }); |
771 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
771 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
772 | 772 | // IConfig and IAppManager requires a working database. This code |
773 | 773 | // might however be called when ownCloud is not yet setup. |
774 | 774 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | $c->getTempManager() |
790 | 790 | ); |
791 | 791 | }); |
792 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
792 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
793 | 793 | if (isset($this['urlParams'])) { |
794 | 794 | $urlParams = $this['urlParams']; |
795 | 795 | } else { |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | }); |
826 | 826 | $this->registerAlias('Request', \OCP\IRequest::class); |
827 | 827 | |
828 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
828 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
829 | 829 | return new Mailer( |
830 | 830 | $c->getConfig(), |
831 | 831 | $c->getLogger(), |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | }); |
837 | 837 | $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
838 | 838 | |
839 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
839 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
840 | 840 | $config = $c->getConfig(); |
841 | 841 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
842 | 842 | if (is_null($factoryClass)) { |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | $factory = new $factoryClass($this); |
847 | 847 | return $factory->getLDAPProvider(); |
848 | 848 | }); |
849 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
849 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
850 | 850 | $ini = $c->getIniWrapper(); |
851 | 851 | $config = $c->getConfig(); |
852 | 852 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -863,49 +863,49 @@ discard block |
||
863 | 863 | }); |
864 | 864 | $this->registerAlias('LockingProvider', ILockingProvider::class); |
865 | 865 | |
866 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
866 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
867 | 867 | return new \OC\Files\Mount\Manager(); |
868 | 868 | }); |
869 | 869 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
870 | 870 | |
871 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
871 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
872 | 872 | return new \OC\Files\Type\Detection( |
873 | 873 | $c->getURLGenerator(), |
874 | 874 | \OC::$configDir, |
875 | - \OC::$SERVERROOT . '/resources/config/' |
|
875 | + \OC::$SERVERROOT.'/resources/config/' |
|
876 | 876 | ); |
877 | 877 | }); |
878 | 878 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
879 | 879 | |
880 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
880 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
881 | 881 | return new \OC\Files\Type\Loader( |
882 | 882 | $c->getDatabaseConnection() |
883 | 883 | ); |
884 | 884 | }); |
885 | 885 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
886 | - $this->registerService(BundleFetcher::class, function () { |
|
886 | + $this->registerService(BundleFetcher::class, function() { |
|
887 | 887 | return new BundleFetcher($this->getL10N('lib')); |
888 | 888 | }); |
889 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
889 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
890 | 890 | return new Manager( |
891 | 891 | $c->query(IValidator::class) |
892 | 892 | ); |
893 | 893 | }); |
894 | 894 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
895 | 895 | |
896 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
896 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
897 | 897 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
898 | - $manager->registerCapability(function () use ($c) { |
|
898 | + $manager->registerCapability(function() use ($c) { |
|
899 | 899 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
900 | 900 | }); |
901 | - $manager->registerCapability(function () use ($c) { |
|
901 | + $manager->registerCapability(function() use ($c) { |
|
902 | 902 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
903 | 903 | }); |
904 | 904 | return $manager; |
905 | 905 | }); |
906 | 906 | $this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
907 | 907 | |
908 | - $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
908 | + $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
909 | 909 | $config = $c->getConfig(); |
910 | 910 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
911 | 911 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
916 | 916 | $manager = $c->getUserManager(); |
917 | 917 | $user = $manager->get($id); |
918 | - if(is_null($user)) { |
|
918 | + if (is_null($user)) { |
|
919 | 919 | $l = $c->getL10N('core'); |
920 | 920 | $displayName = $l->t('Unknown user'); |
921 | 921 | } else { |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | }); |
929 | 929 | $this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
930 | 930 | |
931 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
931 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
932 | 932 | /* |
933 | 933 | * Dark magic for autoloader. |
934 | 934 | * If we do a class_exists it will try to load the class which will |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | } |
956 | 956 | return new \OC_Defaults(); |
957 | 957 | }); |
958 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
958 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
959 | 959 | /** @var Factory $cacheFactory */ |
960 | 960 | $cacheFactory = $c->query(Factory::class); |
961 | 961 | return new SCSSCacher( |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | $cacheFactory->createDistributed('SCSS') |
969 | 969 | ); |
970 | 970 | }); |
971 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
971 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
972 | 972 | /** @var Factory $cacheFactory */ |
973 | 973 | $cacheFactory = $c->query(Factory::class); |
974 | 974 | return new JSCombiner( |
@@ -979,13 +979,13 @@ discard block |
||
979 | 979 | $c->getLogger() |
980 | 980 | ); |
981 | 981 | }); |
982 | - $this->registerService(EventDispatcher::class, function () { |
|
982 | + $this->registerService(EventDispatcher::class, function() { |
|
983 | 983 | return new EventDispatcher(); |
984 | 984 | }); |
985 | 985 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
986 | 986 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
987 | 987 | |
988 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
988 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
989 | 989 | // FIXME: Instantiiated here due to cyclic dependency |
990 | 990 | $request = new Request( |
991 | 991 | [ |
@@ -1010,7 +1010,7 @@ discard block |
||
1010 | 1010 | $request |
1011 | 1011 | ); |
1012 | 1012 | }); |
1013 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
1013 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
1014 | 1014 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
1015 | 1015 | |
1016 | 1016 | return new CsrfTokenManager( |
@@ -1018,22 +1018,22 @@ discard block |
||
1018 | 1018 | $c->query(SessionStorage::class) |
1019 | 1019 | ); |
1020 | 1020 | }); |
1021 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
1021 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
1022 | 1022 | return new SessionStorage($c->getSession()); |
1023 | 1023 | }); |
1024 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
1024 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
1025 | 1025 | return new ContentSecurityPolicyManager(); |
1026 | 1026 | }); |
1027 | 1027 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
1028 | 1028 | |
1029 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
1029 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
1030 | 1030 | return new ContentSecurityPolicyNonceManager( |
1031 | 1031 | $c->getCsrfTokenManager(), |
1032 | 1032 | $c->getRequest() |
1033 | 1033 | ); |
1034 | 1034 | }); |
1035 | 1035 | |
1036 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
1036 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
1037 | 1037 | $config = $c->getConfig(); |
1038 | 1038 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
1039 | 1039 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1076,7 +1076,7 @@ discard block |
||
1076 | 1076 | |
1077 | 1077 | $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class); |
1078 | 1078 | |
1079 | - $this->registerService('SettingsManager', function (Server $c) { |
|
1079 | + $this->registerService('SettingsManager', function(Server $c) { |
|
1080 | 1080 | $manager = new \OC\Settings\Manager( |
1081 | 1081 | $c->getLogger(), |
1082 | 1082 | $c->getDatabaseConnection(), |
@@ -1094,24 +1094,24 @@ discard block |
||
1094 | 1094 | ); |
1095 | 1095 | return $manager; |
1096 | 1096 | }); |
1097 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
1097 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1098 | 1098 | return new \OC\Files\AppData\Factory( |
1099 | 1099 | $c->getRootFolder(), |
1100 | 1100 | $c->getSystemConfig() |
1101 | 1101 | ); |
1102 | 1102 | }); |
1103 | 1103 | |
1104 | - $this->registerService('LockdownManager', function (Server $c) { |
|
1105 | - return new LockdownManager(function () use ($c) { |
|
1104 | + $this->registerService('LockdownManager', function(Server $c) { |
|
1105 | + return new LockdownManager(function() use ($c) { |
|
1106 | 1106 | return $c->getSession(); |
1107 | 1107 | }); |
1108 | 1108 | }); |
1109 | 1109 | |
1110 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
1110 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1111 | 1111 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
1112 | 1112 | }); |
1113 | 1113 | |
1114 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
1114 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1115 | 1115 | return new CloudIdManager(); |
1116 | 1116 | }); |
1117 | 1117 | |
@@ -1121,18 +1121,18 @@ discard block |
||
1121 | 1121 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
1122 | 1122 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1123 | 1123 | |
1124 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1124 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1125 | 1125 | return new Defaults( |
1126 | 1126 | $c->getThemingDefaults() |
1127 | 1127 | ); |
1128 | 1128 | }); |
1129 | 1129 | $this->registerAlias('Defaults', \OCP\Defaults::class); |
1130 | 1130 | |
1131 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
1131 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1132 | 1132 | return $c->query(\OCP\IUserSession::class)->getSession(); |
1133 | 1133 | }); |
1134 | 1134 | |
1135 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
1135 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
1136 | 1136 | return new ShareHelper( |
1137 | 1137 | $c->query(\OCP\Share\IManager::class) |
1138 | 1138 | ); |
@@ -1194,11 +1194,11 @@ discard block |
||
1194 | 1194 | // no avatar to remove |
1195 | 1195 | } catch (\Exception $e) { |
1196 | 1196 | // Ignore exceptions |
1197 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
1197 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1198 | 1198 | } |
1199 | 1199 | }); |
1200 | 1200 | |
1201 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
1201 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1202 | 1202 | $manager = $this->getAvatarManager(); |
1203 | 1203 | /** @var IUser $user */ |
1204 | 1204 | $user = $e->getSubject(); |
@@ -1349,7 +1349,7 @@ discard block |
||
1349 | 1349 | * @deprecated since 9.2.0 use IAppData |
1350 | 1350 | */ |
1351 | 1351 | public function getAppFolder() { |
1352 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
1352 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
1353 | 1353 | $root = $this->getRootFolder(); |
1354 | 1354 | if (!$root->nodeExists($dir)) { |
1355 | 1355 | $folder = $root->newFolder($dir); |
@@ -1933,7 +1933,7 @@ discard block |
||
1933 | 1933 | /** |
1934 | 1934 | * @return \OCP\Collaboration\AutoComplete\IManager |
1935 | 1935 | */ |
1936 | - public function getAutoCompleteManager(){ |
|
1936 | + public function getAutoCompleteManager() { |
|
1937 | 1937 | return $this->query(IManager::class); |
1938 | 1938 | } |
1939 | 1939 |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | return false; |
81 | 81 | } |
82 | 82 | |
83 | - $path = explode('/', $root . '/' . $file); |
|
83 | + $path = explode('/', $root.'/'.$file); |
|
84 | 84 | |
85 | 85 | $fileName = array_pop($path); |
86 | 86 | $path = implode('/', $path); |
87 | 87 | |
88 | 88 | try { |
89 | 89 | $folder = $this->appData->getFolder($app); |
90 | - } catch(NotFoundException $e) { |
|
90 | + } catch (NotFoundException $e) { |
|
91 | 91 | // creating css appdata folder |
92 | 92 | $folder = $this->appData->newFolder($app); |
93 | 93 | } |
94 | 94 | |
95 | - if($this->isCached($fileName, $folder)) { |
|
95 | + if ($this->isCached($fileName, $folder)) { |
|
96 | 96 | return true; |
97 | 97 | } |
98 | 98 | return $this->cache($path, $fileName, $folder); |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | * @return bool |
105 | 105 | */ |
106 | 106 | protected function isCached($fileName, ISimpleFolder $folder) { |
107 | - $fileName = str_replace('.json', '.js', $fileName) . '.deps'; |
|
107 | + $fileName = str_replace('.json', '.js', $fileName).'.deps'; |
|
108 | 108 | try { |
109 | - $deps = $this->depsCache->get($folder->getName() . '-' . $fileName); |
|
109 | + $deps = $this->depsCache->get($folder->getName().'-'.$fileName); |
|
110 | 110 | if ($deps === null || $deps === '') { |
111 | 111 | $depFile = $folder->getFile($fileName); |
112 | 112 | $deps = $depFile->getContent(); |
113 | 113 | } |
114 | 114 | // check again |
115 | 115 | if ($deps === null || $deps === '') { |
116 | - $this->logger->info('JSCombiner: deps file empty: ' . $fileName); |
|
116 | + $this->logger->info('JSCombiner: deps file empty: '.$fileName); |
|
117 | 117 | return false; |
118 | 118 | } |
119 | 119 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | return true; |
133 | - } catch(NotFoundException $e) { |
|
133 | + } catch (NotFoundException $e) { |
|
134 | 134 | return false; |
135 | 135 | } |
136 | 136 | } |
@@ -143,17 +143,17 @@ discard block |
||
143 | 143 | */ |
144 | 144 | protected function cache($path, $fileName, ISimpleFolder $folder) { |
145 | 145 | $deps = []; |
146 | - $fullPath = $path . '/' . $fileName; |
|
146 | + $fullPath = $path.'/'.$fileName; |
|
147 | 147 | $data = json_decode(file_get_contents($fullPath)); |
148 | 148 | $deps[$fullPath] = filemtime($fullPath); |
149 | 149 | |
150 | 150 | $res = ''; |
151 | 151 | foreach ($data as $file) { |
152 | - $filePath = $path . '/' . $file; |
|
152 | + $filePath = $path.'/'.$file; |
|
153 | 153 | |
154 | 154 | if (is_file($filePath)) { |
155 | 155 | $res .= file_get_contents($filePath); |
156 | - $res .= PHP_EOL . PHP_EOL; |
|
156 | + $res .= PHP_EOL.PHP_EOL; |
|
157 | 157 | $deps[$filePath] = filemtime($filePath); |
158 | 158 | } |
159 | 159 | } |
@@ -161,11 +161,11 @@ discard block |
||
161 | 161 | $fileName = str_replace('.json', '.js', $fileName); |
162 | 162 | try { |
163 | 163 | $cachedfile = $folder->getFile($fileName); |
164 | - } catch(NotFoundException $e) { |
|
164 | + } catch (NotFoundException $e) { |
|
165 | 165 | $cachedfile = $folder->newFile($fileName); |
166 | 166 | } |
167 | 167 | |
168 | - $depFileName = $fileName . '.deps'; |
|
168 | + $depFileName = $fileName.'.deps'; |
|
169 | 169 | try { |
170 | 170 | $depFile = $folder->getFile($depFileName); |
171 | 171 | } catch (NotFoundException $e) { |
@@ -173,21 +173,21 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | try { |
176 | - $gzipFile = $folder->getFile($fileName . '.gzip'); # Safari doesn't like .gz |
|
176 | + $gzipFile = $folder->getFile($fileName.'.gzip'); # Safari doesn't like .gz |
|
177 | 177 | } catch (NotFoundException $e) { |
178 | - $gzipFile = $folder->newFile($fileName . '.gzip'); # Safari doesn't like .gz |
|
178 | + $gzipFile = $folder->newFile($fileName.'.gzip'); # Safari doesn't like .gz |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | try { |
182 | 182 | $cachedfile->putContent($res); |
183 | 183 | $deps = json_encode($deps); |
184 | 184 | $depFile->putContent($deps); |
185 | - $this->depsCache->set($folder->getName() . '-' . $depFileName, $deps); |
|
185 | + $this->depsCache->set($folder->getName().'-'.$depFileName, $deps); |
|
186 | 186 | $gzipFile->putContent(gzencode($res, 9)); |
187 | - $this->logger->debug('JSCombiner: successfully cached: ' . $fileName); |
|
187 | + $this->logger->debug('JSCombiner: successfully cached: '.$fileName); |
|
188 | 188 | return true; |
189 | 189 | } catch (NotPermittedException $e) { |
190 | - $this->logger->error('JSCombiner: unable to cache: ' . $fileName); |
|
190 | + $this->logger->error('JSCombiner: unable to cache: '.$fileName); |
|
191 | 191 | return false; |
192 | 192 | } |
193 | 193 | } |
@@ -212,8 +212,8 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function getContent($root, $file) { |
214 | 214 | /** @var array $data */ |
215 | - $data = json_decode(file_get_contents($root . '/' . $file)); |
|
216 | - if(!is_array($data)) { |
|
215 | + $data = json_decode(file_get_contents($root.'/'.$file)); |
|
216 | + if (!is_array($data)) { |
|
217 | 217 | return []; |
218 | 218 | } |
219 | 219 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | |
224 | 224 | $result = []; |
225 | 225 | foreach ($data as $f) { |
226 | - $result[] = $path . '/' . $f; |
|
226 | + $result[] = $path.'/'.$f; |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | return $result; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @throws NotPermittedException |
105 | 105 | */ |
106 | 106 | public function process(string $root, string $file, string $app): bool { |
107 | - $path = explode('/', $root . '/' . $file); |
|
107 | + $path = explode('/', $root.'/'.$file); |
|
108 | 108 | |
109 | 109 | $fileNameSCSS = array_pop($path); |
110 | 110 | $fileNameCSS = $this->prependBaseurlPrefix(str_replace('.scss', '.css', $fileNameSCSS)); |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | |
115 | 115 | try { |
116 | 116 | $folder = $this->appData->getFolder($app); |
117 | - } catch(NotFoundException $e) { |
|
117 | + } catch (NotFoundException $e) { |
|
118 | 118 | // creating css appdata folder |
119 | 119 | $folder = $this->appData->newFolder($app); |
120 | 120 | } |
121 | 121 | |
122 | 122 | |
123 | - if(!$this->variablesChanged() && $this->isCached($fileNameCSS, $folder)) { |
|
123 | + if (!$this->variablesChanged() && $this->isCached($fileNameCSS, $folder)) { |
|
124 | 124 | return true; |
125 | 125 | } |
126 | 126 | return $this->cache($path, $fileNameCSS, $fileNameSCSS, $folder, $webDir); |
@@ -146,17 +146,17 @@ discard block |
||
146 | 146 | try { |
147 | 147 | $cachedFile = $folder->getFile($fileNameCSS); |
148 | 148 | if ($cachedFile->getSize() > 0) { |
149 | - $depFileName = $fileNameCSS . '.deps'; |
|
150 | - $deps = $this->depsCache->get($folder->getName() . '-' . $depFileName); |
|
149 | + $depFileName = $fileNameCSS.'.deps'; |
|
150 | + $deps = $this->depsCache->get($folder->getName().'-'.$depFileName); |
|
151 | 151 | if ($deps === null) { |
152 | 152 | $depFile = $folder->getFile($depFileName); |
153 | 153 | $deps = $depFile->getContent(); |
154 | 154 | //Set to memcache for next run |
155 | - $this->depsCache->set($folder->getName() . '-' . $depFileName, $deps); |
|
155 | + $this->depsCache->set($folder->getName().'-'.$depFileName, $deps); |
|
156 | 156 | } |
157 | 157 | $deps = json_decode($deps, true); |
158 | 158 | |
159 | - foreach ((array)$deps as $file=>$mtime) { |
|
159 | + foreach ((array) $deps as $file=>$mtime) { |
|
160 | 160 | if (!file_exists($file) || filemtime($file) > $mtime) { |
161 | 161 | return false; |
162 | 162 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | return true; |
165 | 165 | } |
166 | 166 | return false; |
167 | - } catch(NotFoundException $e) { |
|
167 | + } catch (NotFoundException $e) { |
|
168 | 168 | return false; |
169 | 169 | } |
170 | 170 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | private function variablesChanged(): bool { |
177 | 177 | $injectedVariables = $this->getInjectedVariables(); |
178 | - if($this->config->getAppValue('core', 'scss.variables') !== md5($injectedVariables)) { |
|
178 | + if ($this->config->getAppValue('core', 'scss.variables') !== md5($injectedVariables)) { |
|
179 | 179 | $this->resetCache(); |
180 | 180 | $this->config->setAppValue('core', 'scss.variables', md5($injectedVariables)); |
181 | 181 | return true; |
@@ -198,11 +198,11 @@ discard block |
||
198 | 198 | $scss = new Compiler(); |
199 | 199 | $scss->setImportPaths([ |
200 | 200 | $path, |
201 | - $this->serverRoot . '/core/css/', |
|
201 | + $this->serverRoot.'/core/css/', |
|
202 | 202 | ]); |
203 | 203 | // Continue after throw |
204 | 204 | $scss->setIgnoreErrors(true); |
205 | - if($this->config->getSystemValue('debug')) { |
|
205 | + if ($this->config->getSystemValue('debug')) { |
|
206 | 206 | // Debug mode |
207 | 207 | $scss->setFormatter(Expanded::class); |
208 | 208 | $scss->setLineNumberStyle(Compiler::LINE_COMMENTS); |
@@ -213,11 +213,11 @@ discard block |
||
213 | 213 | |
214 | 214 | try { |
215 | 215 | $cachedfile = $folder->getFile($fileNameCSS); |
216 | - } catch(NotFoundException $e) { |
|
216 | + } catch (NotFoundException $e) { |
|
217 | 217 | $cachedfile = $folder->newFile($fileNameCSS); |
218 | 218 | } |
219 | 219 | |
220 | - $depFileName = $fileNameCSS . '.deps'; |
|
220 | + $depFileName = $fileNameCSS.'.deps'; |
|
221 | 221 | try { |
222 | 222 | $depFile = $folder->getFile($depFileName); |
223 | 223 | } catch (NotFoundException $e) { |
@@ -227,19 +227,19 @@ discard block |
||
227 | 227 | // Compile |
228 | 228 | try { |
229 | 229 | $compiledScss = $scss->compile( |
230 | - '@import "variables.scss";' . |
|
231 | - $this->getInjectedVariables() . |
|
230 | + '@import "variables.scss";'. |
|
231 | + $this->getInjectedVariables(). |
|
232 | 232 | '@import "'.$fileNameSCSS.'";'); |
233 | - } catch(ParserException $e) { |
|
233 | + } catch (ParserException $e) { |
|
234 | 234 | $this->logger->error($e, ['app' => 'core']); |
235 | 235 | return false; |
236 | 236 | } |
237 | 237 | |
238 | 238 | // Gzip file |
239 | 239 | try { |
240 | - $gzipFile = $folder->getFile($fileNameCSS . '.gzip'); # Safari doesn't like .gz |
|
240 | + $gzipFile = $folder->getFile($fileNameCSS.'.gzip'); # Safari doesn't like .gz |
|
241 | 241 | } catch (NotFoundException $e) { |
242 | - $gzipFile = $folder->newFile($fileNameCSS . '.gzip'); # Safari doesn't like .gz |
|
242 | + $gzipFile = $folder->newFile($fileNameCSS.'.gzip'); # Safari doesn't like .gz |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | try { |
@@ -247,12 +247,12 @@ discard block |
||
247 | 247 | $cachedfile->putContent($data); |
248 | 248 | $deps = json_encode($scss->getParsedFiles()); |
249 | 249 | $depFile->putContent($deps); |
250 | - $this->depsCache->set($folder->getName() . '-' . $depFileName, $deps); |
|
250 | + $this->depsCache->set($folder->getName().'-'.$depFileName, $deps); |
|
251 | 251 | $gzipFile->putContent(gzencode($data, 9)); |
252 | 252 | $this->logger->debug('SCSSCacher: '.$webDir.'/'.$fileNameSCSS.' compiled and successfully cached', ['app' => 'core']); |
253 | 253 | return true; |
254 | - } catch(NotPermittedException $e) { |
|
255 | - $this->logger->error('SCSSCacher: unable to cache: ' . $fileNameSCSS); |
|
254 | + } catch (NotPermittedException $e) { |
|
255 | + $this->logger->error('SCSSCacher: unable to cache: '.$fileNameSCSS); |
|
256 | 256 | return false; |
257 | 257 | } |
258 | 258 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | } |
282 | 282 | $variables = ''; |
283 | 283 | foreach ($this->defaults->getScssVariables() as $key => $value) { |
284 | - $variables .= '$' . $key . ': ' . $value . ';'; |
|
284 | + $variables .= '$'.$key.': '.$value.';'; |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | // check for valid variables / otherwise fall back to defaults |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | */ |
330 | 330 | private function prependBaseurlPrefix(string $cssFile): string { |
331 | 331 | $frontendController = ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'); |
332 | - return substr(md5($this->urlGenerator->getBaseUrl() . $frontendController), 0, 8) . '-' . $cssFile; |
|
332 | + return substr(md5($this->urlGenerator->getBaseUrl().$frontendController), 0, 8).'-'.$cssFile; |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | /** |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | */ |
343 | 343 | private function getWebDir(string $path, string $appName, string $serverRoot, string $webRoot): string { |
344 | 344 | // Detect if path is within server root AND if path is within an app path |
345 | - if ( strpos($path, $serverRoot) === false && $appWebPath = \OC_App::getAppWebPath($appName)) { |
|
345 | + if (strpos($path, $serverRoot) === false && $appWebPath = \OC_App::getAppWebPath($appName)) { |
|
346 | 346 | // Get the file path within the app directory |
347 | 347 | $appDirectoryPath = explode($appName, $path)[1]; |
348 | 348 | // Remove the webroot |