@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | parent::__construct(); |
| 157 | 157 | $this->webRoot = $webRoot; |
| 158 | 158 | |
| 159 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
| 159 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
| 160 | 160 | return $c; |
| 161 | 161 | }); |
| 162 | 162 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
| 170 | 170 | |
| 171 | 171 | |
| 172 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
| 172 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
| 173 | 173 | return new PreviewManager( |
| 174 | 174 | $c->getConfig(), |
| 175 | 175 | $c->getRootFolder(), |
@@ -180,13 +180,13 @@ discard block |
||
| 180 | 180 | }); |
| 181 | 181 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
| 182 | 182 | |
| 183 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
| 183 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
| 184 | 184 | return new \OC\Preview\Watcher( |
| 185 | 185 | $c->getAppDataDir('preview') |
| 186 | 186 | ); |
| 187 | 187 | }); |
| 188 | 188 | |
| 189 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
| 189 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
| 190 | 190 | $view = new View(); |
| 191 | 191 | $util = new Encryption\Util( |
| 192 | 192 | $view, |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | ); |
| 205 | 205 | }); |
| 206 | 206 | |
| 207 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
| 207 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
| 208 | 208 | $util = new Encryption\Util( |
| 209 | 209 | new View(), |
| 210 | 210 | $c->getUserManager(), |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | ); |
| 219 | 219 | }); |
| 220 | 220 | |
| 221 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
| 221 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
| 222 | 222 | $view = new View(); |
| 223 | 223 | $util = new Encryption\Util( |
| 224 | 224 | $view, |
@@ -229,32 +229,32 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | return new Encryption\Keys\Storage($view, $util); |
| 231 | 231 | }); |
| 232 | - $this->registerService('TagMapper', function (Server $c) { |
|
| 232 | + $this->registerService('TagMapper', function(Server $c) { |
|
| 233 | 233 | return new TagMapper($c->getDatabaseConnection()); |
| 234 | 234 | }); |
| 235 | 235 | |
| 236 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
| 236 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
| 237 | 237 | $tagMapper = $c->query('TagMapper'); |
| 238 | 238 | return new TagManager($tagMapper, $c->getUserSession()); |
| 239 | 239 | }); |
| 240 | 240 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
| 241 | 241 | |
| 242 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
| 242 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
| 243 | 243 | $config = $c->getConfig(); |
| 244 | 244 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory'); |
| 245 | 245 | /** @var \OC\SystemTag\ManagerFactory $factory */ |
| 246 | 246 | $factory = new $factoryClass($this); |
| 247 | 247 | return $factory; |
| 248 | 248 | }); |
| 249 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
| 249 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
| 250 | 250 | return $c->query('SystemTagManagerFactory')->getManager(); |
| 251 | 251 | }); |
| 252 | 252 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
| 253 | 253 | |
| 254 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
| 254 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
| 255 | 255 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
| 256 | 256 | }); |
| 257 | - $this->registerService('RootFolder', function (Server $c) { |
|
| 257 | + $this->registerService('RootFolder', function(Server $c) { |
|
| 258 | 258 | $manager = \OC\Files\Filesystem::getMountManager(null); |
| 259 | 259 | $view = new View(); |
| 260 | 260 | $root = new Root( |
@@ -275,37 +275,37 @@ discard block |
||
| 275 | 275 | }); |
| 276 | 276 | $this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class); |
| 277 | 277 | |
| 278 | - $this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) { |
|
| 279 | - return new LazyRoot(function () use ($c) { |
|
| 278 | + $this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) { |
|
| 279 | + return new LazyRoot(function() use ($c) { |
|
| 280 | 280 | return $c->query('RootFolder'); |
| 281 | 281 | }); |
| 282 | 282 | }); |
| 283 | 283 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
| 284 | 284 | |
| 285 | - $this->registerService(\OCP\IUserManager::class, function (Server $c) { |
|
| 285 | + $this->registerService(\OCP\IUserManager::class, function(Server $c) { |
|
| 286 | 286 | $config = $c->getConfig(); |
| 287 | 287 | return new \OC\User\Manager($config); |
| 288 | 288 | }); |
| 289 | 289 | $this->registerAlias('UserManager', \OCP\IUserManager::class); |
| 290 | 290 | |
| 291 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
| 291 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
| 292 | 292 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
| 293 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
| 293 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
| 294 | 294 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
| 295 | 295 | }); |
| 296 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
| 296 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
| 297 | 297 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
| 298 | 298 | }); |
| 299 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
| 299 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
| 300 | 300 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
| 301 | 301 | }); |
| 302 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
| 302 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
| 303 | 303 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
| 304 | 304 | }); |
| 305 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
| 305 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
| 306 | 306 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
| 307 | 307 | }); |
| 308 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
| 308 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
| 309 | 309 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
| 310 | 310 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
| 311 | 311 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | }); |
| 315 | 315 | $this->registerAlias('GroupManager', \OCP\IGroupManager::class); |
| 316 | 316 | |
| 317 | - $this->registerService(Store::class, function (Server $c) { |
|
| 317 | + $this->registerService(Store::class, function(Server $c) { |
|
| 318 | 318 | $session = $c->getSession(); |
| 319 | 319 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
| 320 | 320 | $tokenProvider = $c->query('OC\Authentication\Token\IProvider'); |
@@ -325,11 +325,11 @@ discard block |
||
| 325 | 325 | return new Store($session, $logger, $tokenProvider); |
| 326 | 326 | }); |
| 327 | 327 | $this->registerAlias(IStore::class, Store::class); |
| 328 | - $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) { |
|
| 328 | + $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function(Server $c) { |
|
| 329 | 329 | $dbConnection = $c->getDatabaseConnection(); |
| 330 | 330 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
| 331 | 331 | }); |
| 332 | - $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function (Server $c) { |
|
| 332 | + $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function(Server $c) { |
|
| 333 | 333 | $mapper = $c->query('OC\Authentication\Token\DefaultTokenMapper'); |
| 334 | 334 | $crypto = $c->getCrypto(); |
| 335 | 335 | $config = $c->getConfig(); |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | }); |
| 340 | 340 | $this->registerAlias('OC\Authentication\Token\IProvider', 'OC\Authentication\Token\DefaultTokenProvider'); |
| 341 | 341 | |
| 342 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
| 342 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
| 343 | 343 | $manager = $c->getUserManager(); |
| 344 | 344 | $session = new \OC\Session\Memory(''); |
| 345 | 345 | $timeFactory = new TimeFactory(); |
@@ -354,45 +354,45 @@ discard block |
||
| 354 | 354 | $dispatcher = $c->getEventDispatcher(); |
| 355 | 355 | |
| 356 | 356 | $userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $c->getConfig(), $c->getSecureRandom(), $c->getLockdownManager()); |
| 357 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
| 357 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
| 358 | 358 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 359 | 359 | }); |
| 360 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
| 360 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
| 361 | 361 | /** @var $user \OC\User\User */ |
| 362 | 362 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
| 363 | 363 | }); |
| 364 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) { |
|
| 364 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) { |
|
| 365 | 365 | /** @var $user \OC\User\User */ |
| 366 | 366 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
| 367 | 367 | $dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
| 368 | 368 | }); |
| 369 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
| 369 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
| 370 | 370 | /** @var $user \OC\User\User */ |
| 371 | 371 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
| 372 | 372 | }); |
| 373 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 373 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
| 374 | 374 | /** @var $user \OC\User\User */ |
| 375 | 375 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 376 | 376 | }); |
| 377 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 377 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
| 378 | 378 | /** @var $user \OC\User\User */ |
| 379 | 379 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 380 | 380 | }); |
| 381 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
| 381 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
| 382 | 382 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 383 | 383 | }); |
| 384 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
| 384 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
| 385 | 385 | /** @var $user \OC\User\User */ |
| 386 | 386 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
| 387 | 387 | }); |
| 388 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
| 388 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
| 389 | 389 | /** @var $user \OC\User\User */ |
| 390 | 390 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
| 391 | 391 | }); |
| 392 | - $userSession->listen('\OC\User', 'logout', function () { |
|
| 392 | + $userSession->listen('\OC\User', 'logout', function() { |
|
| 393 | 393 | \OC_Hook::emit('OC_User', 'logout', array()); |
| 394 | 394 | }); |
| 395 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) { |
|
| 395 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) { |
|
| 396 | 396 | /** @var $user \OC\User\User */ |
| 397 | 397 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
| 398 | 398 | }); |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | }); |
| 401 | 401 | $this->registerAlias('UserSession', \OCP\IUserSession::class); |
| 402 | 402 | |
| 403 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
| 403 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
| 404 | 404 | return new \OC\Authentication\TwoFactorAuth\Manager( |
| 405 | 405 | $c->getAppManager(), |
| 406 | 406 | $c->getSession(), |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
| 416 | 416 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
| 417 | 417 | |
| 418 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
| 418 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
| 419 | 419 | return new \OC\AllConfig( |
| 420 | 420 | $c->getSystemConfig() |
| 421 | 421 | ); |
@@ -423,17 +423,17 @@ discard block |
||
| 423 | 423 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
| 424 | 424 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
| 425 | 425 | |
| 426 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
| 426 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
| 427 | 427 | return new \OC\SystemConfig($config); |
| 428 | 428 | }); |
| 429 | 429 | |
| 430 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
| 430 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
| 431 | 431 | return new \OC\AppConfig($c->getDatabaseConnection()); |
| 432 | 432 | }); |
| 433 | 433 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
| 434 | 434 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
| 435 | 435 | |
| 436 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
| 436 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
| 437 | 437 | return new \OC\L10N\Factory( |
| 438 | 438 | $c->getConfig(), |
| 439 | 439 | $c->getRequest(), |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | }); |
| 444 | 444 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
| 445 | 445 | |
| 446 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
| 446 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
| 447 | 447 | $config = $c->getConfig(); |
| 448 | 448 | $cacheFactory = $c->getMemCacheFactory(); |
| 449 | 449 | $request = $c->getRequest(); |
@@ -455,18 +455,18 @@ discard block |
||
| 455 | 455 | }); |
| 456 | 456 | $this->registerAlias('URLGenerator', \OCP\IURLGenerator::class); |
| 457 | 457 | |
| 458 | - $this->registerService('AppHelper', function ($c) { |
|
| 458 | + $this->registerService('AppHelper', function($c) { |
|
| 459 | 459 | return new \OC\AppHelper(); |
| 460 | 460 | }); |
| 461 | 461 | $this->registerAlias('AppFetcher', AppFetcher::class); |
| 462 | 462 | $this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
| 463 | 463 | |
| 464 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
| 464 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
| 465 | 465 | return new Cache\File(); |
| 466 | 466 | }); |
| 467 | 467 | $this->registerAlias('UserCache', \OCP\ICache::class); |
| 468 | 468 | |
| 469 | - $this->registerService(Factory::class, function (Server $c) { |
|
| 469 | + $this->registerService(Factory::class, function(Server $c) { |
|
| 470 | 470 | |
| 471 | 471 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
| 472 | 472 | '\\OC\\Memcache\\ArrayCache', |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | $version = implode(',', $v); |
| 484 | 484 | $instanceId = \OC_Util::getInstanceId(); |
| 485 | 485 | $path = \OC::$SERVERROOT; |
| 486 | - $prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . $urlGenerator->getBaseUrl()); |
|
| 486 | + $prefix = md5($instanceId.'-'.$version.'-'.$path.'-'.$urlGenerator->getBaseUrl()); |
|
| 487 | 487 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
| 488 | 488 | $config->getSystemValue('memcache.local', null), |
| 489 | 489 | $config->getSystemValue('memcache.distributed', null), |
@@ -496,12 +496,12 @@ discard block |
||
| 496 | 496 | $this->registerAlias('MemCacheFactory', Factory::class); |
| 497 | 497 | $this->registerAlias(ICacheFactory::class, Factory::class); |
| 498 | 498 | |
| 499 | - $this->registerService('RedisFactory', function (Server $c) { |
|
| 499 | + $this->registerService('RedisFactory', function(Server $c) { |
|
| 500 | 500 | $systemConfig = $c->getSystemConfig(); |
| 501 | 501 | return new RedisFactory($systemConfig); |
| 502 | 502 | }); |
| 503 | 503 | |
| 504 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
| 504 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
| 505 | 505 | return new \OC\Activity\Manager( |
| 506 | 506 | $c->getRequest(), |
| 507 | 507 | $c->getUserSession(), |
@@ -511,14 +511,14 @@ discard block |
||
| 511 | 511 | }); |
| 512 | 512 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
| 513 | 513 | |
| 514 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
| 514 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
| 515 | 515 | return new \OC\Activity\EventMerger( |
| 516 | 516 | $c->getL10N('lib') |
| 517 | 517 | ); |
| 518 | 518 | }); |
| 519 | 519 | $this->registerAlias(IValidator::class, Validator::class); |
| 520 | 520 | |
| 521 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
| 521 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
| 522 | 522 | return new AvatarManager( |
| 523 | 523 | $c->getUserManager(), |
| 524 | 524 | $c->getAppDataDir('avatar'), |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | |
| 532 | 532 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
| 533 | 533 | |
| 534 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
| 534 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
| 535 | 535 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
| 536 | 536 | $logger = Log::getLogClass($logType); |
| 537 | 537 | call_user_func(array($logger, 'init')); |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | }); |
| 543 | 543 | $this->registerAlias('Logger', \OCP\ILogger::class); |
| 544 | 544 | |
| 545 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
| 545 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
| 546 | 546 | $config = $c->getConfig(); |
| 547 | 547 | return new \OC\BackgroundJob\JobList( |
| 548 | 548 | $c->getDatabaseConnection(), |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | }); |
| 553 | 553 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
| 554 | 554 | |
| 555 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
| 555 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
| 556 | 556 | $cacheFactory = $c->getMemCacheFactory(); |
| 557 | 557 | $logger = $c->getLogger(); |
| 558 | 558 | if ($cacheFactory->isAvailableLowLatency()) { |
@@ -564,12 +564,12 @@ discard block |
||
| 564 | 564 | }); |
| 565 | 565 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
| 566 | 566 | |
| 567 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
| 567 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
| 568 | 568 | return new Search(); |
| 569 | 569 | }); |
| 570 | 570 | $this->registerAlias('Search', \OCP\ISearch::class); |
| 571 | 571 | |
| 572 | - $this->registerService(\OC\Security\RateLimiting\Limiter::class, function ($c) { |
|
| 572 | + $this->registerService(\OC\Security\RateLimiting\Limiter::class, function($c) { |
|
| 573 | 573 | return new \OC\Security\RateLimiting\Limiter( |
| 574 | 574 | $this->getUserSession(), |
| 575 | 575 | $this->getRequest(), |
@@ -577,34 +577,34 @@ discard block |
||
| 577 | 577 | $c->query(\OC\Security\RateLimiting\Backend\IBackend::class) |
| 578 | 578 | ); |
| 579 | 579 | }); |
| 580 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
| 580 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
| 581 | 581 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
| 582 | 582 | $this->getMemCacheFactory(), |
| 583 | 583 | new \OC\AppFramework\Utility\TimeFactory() |
| 584 | 584 | ); |
| 585 | 585 | }); |
| 586 | 586 | |
| 587 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
| 587 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
| 588 | 588 | return new SecureRandom(); |
| 589 | 589 | }); |
| 590 | 590 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
| 591 | 591 | |
| 592 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
| 592 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
| 593 | 593 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
| 594 | 594 | }); |
| 595 | 595 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
| 596 | 596 | |
| 597 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
| 597 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
| 598 | 598 | return new Hasher($c->getConfig()); |
| 599 | 599 | }); |
| 600 | 600 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
| 601 | 601 | |
| 602 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
| 602 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
| 603 | 603 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
| 604 | 604 | }); |
| 605 | 605 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
| 606 | 606 | |
| 607 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
| 607 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
| 608 | 608 | $systemConfig = $c->getSystemConfig(); |
| 609 | 609 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
| 610 | 610 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | }); |
| 619 | 619 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
| 620 | 620 | |
| 621 | - $this->registerService('HTTPHelper', function (Server $c) { |
|
| 621 | + $this->registerService('HTTPHelper', function(Server $c) { |
|
| 622 | 622 | $config = $c->getConfig(); |
| 623 | 623 | return new HTTPHelper( |
| 624 | 624 | $config, |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | ); |
| 627 | 627 | }); |
| 628 | 628 | |
| 629 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
| 629 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
| 630 | 630 | $user = \OC_User::getUser(); |
| 631 | 631 | $uid = $user ? $user : null; |
| 632 | 632 | return new ClientService( |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | ); |
| 642 | 642 | }); |
| 643 | 643 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
| 644 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
| 644 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
| 645 | 645 | $eventLogger = new EventLogger(); |
| 646 | 646 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 647 | 647 | // In debug mode, module is being activated by default |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | }); |
| 652 | 652 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
| 653 | 653 | |
| 654 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
| 654 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
| 655 | 655 | $queryLogger = new QueryLogger(); |
| 656 | 656 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 657 | 657 | // In debug mode, module is being activated by default |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | }); |
| 662 | 662 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
| 663 | 663 | |
| 664 | - $this->registerService(TempManager::class, function (Server $c) { |
|
| 664 | + $this->registerService(TempManager::class, function(Server $c) { |
|
| 665 | 665 | return new TempManager( |
| 666 | 666 | $c->getLogger(), |
| 667 | 667 | $c->getConfig() |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | $this->registerAlias('TempManager', TempManager::class); |
| 671 | 671 | $this->registerAlias(ITempManager::class, TempManager::class); |
| 672 | 672 | |
| 673 | - $this->registerService(AppManager::class, function (Server $c) { |
|
| 673 | + $this->registerService(AppManager::class, function(Server $c) { |
|
| 674 | 674 | return new \OC\App\AppManager( |
| 675 | 675 | $c->getUserSession(), |
| 676 | 676 | $c->getAppConfig(), |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | $this->registerAlias('AppManager', AppManager::class); |
| 683 | 683 | $this->registerAlias(IAppManager::class, AppManager::class); |
| 684 | 684 | |
| 685 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
| 685 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
| 686 | 686 | return new DateTimeZone( |
| 687 | 687 | $c->getConfig(), |
| 688 | 688 | $c->getSession() |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | }); |
| 691 | 691 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
| 692 | 692 | |
| 693 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
| 693 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
| 694 | 694 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
| 695 | 695 | |
| 696 | 696 | return new DateTimeFormatter( |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | }); |
| 701 | 701 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
| 702 | 702 | |
| 703 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
| 703 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
| 704 | 704 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
| 705 | 705 | $listener = new UserMountCacheListener($mountCache); |
| 706 | 706 | $listener->listen($c->getUserManager()); |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | }); |
| 709 | 709 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
| 710 | 710 | |
| 711 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
| 711 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
| 712 | 712 | $loader = \OC\Files\Filesystem::getLoader(); |
| 713 | 713 | $mountCache = $c->query('UserMountCache'); |
| 714 | 714 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -724,10 +724,10 @@ discard block |
||
| 724 | 724 | }); |
| 725 | 725 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
| 726 | 726 | |
| 727 | - $this->registerService('IniWrapper', function ($c) { |
|
| 727 | + $this->registerService('IniWrapper', function($c) { |
|
| 728 | 728 | return new IniGetWrapper(); |
| 729 | 729 | }); |
| 730 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
| 730 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
| 731 | 731 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
| 732 | 732 | if ($busClass) { |
| 733 | 733 | list($app, $class) = explode('::', $busClass, 2); |
@@ -742,10 +742,10 @@ discard block |
||
| 742 | 742 | return new CronBus($jobList); |
| 743 | 743 | } |
| 744 | 744 | }); |
| 745 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
| 745 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
| 746 | 746 | return new TrustedDomainHelper($this->getConfig()); |
| 747 | 747 | }); |
| 748 | - $this->registerService('Throttler', function (Server $c) { |
|
| 748 | + $this->registerService('Throttler', function(Server $c) { |
|
| 749 | 749 | return new Throttler( |
| 750 | 750 | $c->getDatabaseConnection(), |
| 751 | 751 | new TimeFactory(), |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | $c->getConfig() |
| 754 | 754 | ); |
| 755 | 755 | }); |
| 756 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
| 756 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
| 757 | 757 | // IConfig and IAppManager requires a working database. This code |
| 758 | 758 | // might however be called when ownCloud is not yet setup. |
| 759 | 759 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | $c->getTempManager() |
| 775 | 775 | ); |
| 776 | 776 | }); |
| 777 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
| 777 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
| 778 | 778 | if (isset($this['urlParams'])) { |
| 779 | 779 | $urlParams = $this['urlParams']; |
| 780 | 780 | } else { |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | }); |
| 811 | 811 | $this->registerAlias('Request', \OCP\IRequest::class); |
| 812 | 812 | |
| 813 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
| 813 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
| 814 | 814 | return new Mailer( |
| 815 | 815 | $c->getConfig(), |
| 816 | 816 | $c->getLogger(), |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | }); |
| 822 | 822 | $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
| 823 | 823 | |
| 824 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
| 824 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
| 825 | 825 | $config = $c->getConfig(); |
| 826 | 826 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
| 827 | 827 | if (is_null($factoryClass)) { |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | $factory = new $factoryClass($this); |
| 832 | 832 | return $factory->getLDAPProvider(); |
| 833 | 833 | }); |
| 834 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
| 834 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
| 835 | 835 | $ini = $c->getIniWrapper(); |
| 836 | 836 | $config = $c->getConfig(); |
| 837 | 837 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -848,49 +848,49 @@ discard block |
||
| 848 | 848 | }); |
| 849 | 849 | $this->registerAlias('LockingProvider', ILockingProvider::class); |
| 850 | 850 | |
| 851 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
| 851 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
| 852 | 852 | return new \OC\Files\Mount\Manager(); |
| 853 | 853 | }); |
| 854 | 854 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
| 855 | 855 | |
| 856 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
| 856 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
| 857 | 857 | return new \OC\Files\Type\Detection( |
| 858 | 858 | $c->getURLGenerator(), |
| 859 | 859 | \OC::$configDir, |
| 860 | - \OC::$SERVERROOT . '/resources/config/' |
|
| 860 | + \OC::$SERVERROOT.'/resources/config/' |
|
| 861 | 861 | ); |
| 862 | 862 | }); |
| 863 | 863 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
| 864 | 864 | |
| 865 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
| 865 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
| 866 | 866 | return new \OC\Files\Type\Loader( |
| 867 | 867 | $c->getDatabaseConnection() |
| 868 | 868 | ); |
| 869 | 869 | }); |
| 870 | 870 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
| 871 | - $this->registerService(BundleFetcher::class, function () { |
|
| 871 | + $this->registerService(BundleFetcher::class, function() { |
|
| 872 | 872 | return new BundleFetcher($this->getL10N('lib')); |
| 873 | 873 | }); |
| 874 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
| 874 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
| 875 | 875 | return new Manager( |
| 876 | 876 | $c->query(IValidator::class) |
| 877 | 877 | ); |
| 878 | 878 | }); |
| 879 | 879 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
| 880 | 880 | |
| 881 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
| 881 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
| 882 | 882 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
| 883 | - $manager->registerCapability(function () use ($c) { |
|
| 883 | + $manager->registerCapability(function() use ($c) { |
|
| 884 | 884 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
| 885 | 885 | }); |
| 886 | - $manager->registerCapability(function () use ($c) { |
|
| 886 | + $manager->registerCapability(function() use ($c) { |
|
| 887 | 887 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
| 888 | 888 | }); |
| 889 | 889 | return $manager; |
| 890 | 890 | }); |
| 891 | 891 | $this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
| 892 | 892 | |
| 893 | - $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
| 893 | + $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
| 894 | 894 | $config = $c->getConfig(); |
| 895 | 895 | $factoryClass = $config->getSystemValue('comments.managerFactory', '\OC\Comments\ManagerFactory'); |
| 896 | 896 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | }); |
| 900 | 900 | $this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
| 901 | 901 | |
| 902 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
| 902 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
| 903 | 903 | /* |
| 904 | 904 | * Dark magic for autoloader. |
| 905 | 905 | * If we do a class_exists it will try to load the class which will |
@@ -926,7 +926,7 @@ discard block |
||
| 926 | 926 | } |
| 927 | 927 | return new \OC_Defaults(); |
| 928 | 928 | }); |
| 929 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
| 929 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
| 930 | 930 | /** @var Factory $cacheFactory */ |
| 931 | 931 | $cacheFactory = $c->query(Factory::class); |
| 932 | 932 | return new SCSSCacher( |
@@ -939,13 +939,13 @@ discard block |
||
| 939 | 939 | $cacheFactory->create('SCSS') |
| 940 | 940 | ); |
| 941 | 941 | }); |
| 942 | - $this->registerService(EventDispatcher::class, function () { |
|
| 942 | + $this->registerService(EventDispatcher::class, function() { |
|
| 943 | 943 | return new EventDispatcher(); |
| 944 | 944 | }); |
| 945 | 945 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
| 946 | 946 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
| 947 | 947 | |
| 948 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
| 948 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
| 949 | 949 | // FIXME: Instantiiated here due to cyclic dependency |
| 950 | 950 | $request = new Request( |
| 951 | 951 | [ |
@@ -970,7 +970,7 @@ discard block |
||
| 970 | 970 | $request |
| 971 | 971 | ); |
| 972 | 972 | }); |
| 973 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
| 973 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
| 974 | 974 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
| 975 | 975 | |
| 976 | 976 | return new CsrfTokenManager( |
@@ -978,22 +978,22 @@ discard block |
||
| 978 | 978 | $c->query(SessionStorage::class) |
| 979 | 979 | ); |
| 980 | 980 | }); |
| 981 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
| 981 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
| 982 | 982 | return new SessionStorage($c->getSession()); |
| 983 | 983 | }); |
| 984 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
| 984 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
| 985 | 985 | return new ContentSecurityPolicyManager(); |
| 986 | 986 | }); |
| 987 | 987 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
| 988 | 988 | |
| 989 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
| 989 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
| 990 | 990 | return new ContentSecurityPolicyNonceManager( |
| 991 | 991 | $c->getCsrfTokenManager(), |
| 992 | 992 | $c->getRequest() |
| 993 | 993 | ); |
| 994 | 994 | }); |
| 995 | 995 | |
| 996 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
| 996 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
| 997 | 997 | $config = $c->getConfig(); |
| 998 | 998 | $factoryClass = $config->getSystemValue('sharing.managerFactory', '\OC\Share20\ProviderFactory'); |
| 999 | 999 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1036,7 +1036,7 @@ discard block |
||
| 1036 | 1036 | |
| 1037 | 1037 | $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class); |
| 1038 | 1038 | |
| 1039 | - $this->registerService('SettingsManager', function (Server $c) { |
|
| 1039 | + $this->registerService('SettingsManager', function(Server $c) { |
|
| 1040 | 1040 | $manager = new \OC\Settings\Manager( |
| 1041 | 1041 | $c->getLogger(), |
| 1042 | 1042 | $c->getDatabaseConnection(), |
@@ -1056,29 +1056,29 @@ discard block |
||
| 1056 | 1056 | ); |
| 1057 | 1057 | return $manager; |
| 1058 | 1058 | }); |
| 1059 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
| 1059 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
| 1060 | 1060 | return new \OC\Files\AppData\Factory( |
| 1061 | 1061 | $c->getRootFolder(), |
| 1062 | 1062 | $c->getSystemConfig() |
| 1063 | 1063 | ); |
| 1064 | 1064 | }); |
| 1065 | 1065 | |
| 1066 | - $this->registerService('LockdownManager', function (Server $c) { |
|
| 1067 | - return new LockdownManager(function () use ($c) { |
|
| 1066 | + $this->registerService('LockdownManager', function(Server $c) { |
|
| 1067 | + return new LockdownManager(function() use ($c) { |
|
| 1068 | 1068 | return $c->getSession(); |
| 1069 | 1069 | }); |
| 1070 | 1070 | }); |
| 1071 | 1071 | |
| 1072 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
| 1072 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
| 1073 | 1073 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
| 1074 | 1074 | }); |
| 1075 | 1075 | |
| 1076 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
| 1076 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
| 1077 | 1077 | return new CloudIdManager(); |
| 1078 | 1078 | }); |
| 1079 | 1079 | |
| 1080 | 1080 | /* To trick DI since we don't extend the DIContainer here */ |
| 1081 | - $this->registerService(CleanPreviewsBackgroundJob::class, function (Server $c) { |
|
| 1081 | + $this->registerService(CleanPreviewsBackgroundJob::class, function(Server $c) { |
|
| 1082 | 1082 | return new CleanPreviewsBackgroundJob( |
| 1083 | 1083 | $c->getRootFolder(), |
| 1084 | 1084 | $c->getLogger(), |
@@ -1093,18 +1093,18 @@ discard block |
||
| 1093 | 1093 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
| 1094 | 1094 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
| 1095 | 1095 | |
| 1096 | - $this->registerService(Defaults::class, function (Server $c) { |
|
| 1096 | + $this->registerService(Defaults::class, function(Server $c) { |
|
| 1097 | 1097 | return new Defaults( |
| 1098 | 1098 | $c->getThemingDefaults() |
| 1099 | 1099 | ); |
| 1100 | 1100 | }); |
| 1101 | 1101 | $this->registerAlias('Defaults', \OCP\Defaults::class); |
| 1102 | 1102 | |
| 1103 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
| 1103 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
| 1104 | 1104 | return $c->query(\OCP\IUserSession::class)->getSession(); |
| 1105 | 1105 | }); |
| 1106 | 1106 | |
| 1107 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
| 1107 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
| 1108 | 1108 | return new ShareHelper( |
| 1109 | 1109 | $c->query(\OCP\Share\IManager::class) |
| 1110 | 1110 | ); |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | // no avatar to remove |
| 1157 | 1157 | } catch (\Exception $e) { |
| 1158 | 1158 | // Ignore exceptions |
| 1159 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
| 1159 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
| 1160 | 1160 | } |
| 1161 | 1161 | }); |
| 1162 | 1162 | } |
@@ -1295,7 +1295,7 @@ discard block |
||
| 1295 | 1295 | * @deprecated since 9.2.0 use IAppData |
| 1296 | 1296 | */ |
| 1297 | 1297 | public function getAppFolder() { |
| 1298 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
| 1298 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
| 1299 | 1299 | $root = $this->getRootFolder(); |
| 1300 | 1300 | if (!$root->nodeExists($dir)) { |
| 1301 | 1301 | $folder = $root->newFolder($dir); |
@@ -1879,7 +1879,7 @@ discard block |
||
| 1879 | 1879 | /** |
| 1880 | 1880 | * @return \OCP\Collaboration\AutoComplete\IManager |
| 1881 | 1881 | */ |
| 1882 | - public function getAutoCompleteManager(){ |
|
| 1882 | + public function getAutoCompleteManager() { |
|
| 1883 | 1883 | return $this->query(IManager::class); |
| 1884 | 1884 | } |
| 1885 | 1885 | |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | $path = '/'; |
| 127 | 127 | } |
| 128 | 128 | if ($path[0] !== '/') { |
| 129 | - $path = '/' . $path; |
|
| 129 | + $path = '/'.$path; |
|
| 130 | 130 | } |
| 131 | - return $this->fakeRoot . $path; |
|
| 131 | + return $this->fakeRoot.$path; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | /** |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | public function chroot($fakeRoot) { |
| 141 | 141 | if (!$fakeRoot == '') { |
| 142 | 142 | if ($fakeRoot[0] !== '/') { |
| 143 | - $fakeRoot = '/' . $fakeRoot; |
|
| 143 | + $fakeRoot = '/'.$fakeRoot; |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | $this->fakeRoot = $fakeRoot; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | // missing slashes can cause wrong matches! |
| 175 | - $root = rtrim($this->fakeRoot, '/') . '/'; |
|
| 175 | + $root = rtrim($this->fakeRoot, '/').'/'; |
|
| 176 | 176 | |
| 177 | 177 | if (strpos($path, $root) !== 0) { |
| 178 | 178 | return null; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | if ($mount instanceof MoveableMount) { |
| 279 | 279 | // cut of /user/files to get the relative path to data/user/files |
| 280 | 280 | $pathParts = explode('/', $path, 4); |
| 281 | - $relPath = '/' . $pathParts[3]; |
|
| 281 | + $relPath = '/'.$pathParts[3]; |
|
| 282 | 282 | $this->lockFile($relPath, ILockingProvider::LOCK_SHARED, true); |
| 283 | 283 | \OC_Hook::emit( |
| 284 | 284 | Filesystem::CLASSNAME, "umount", |
@@ -700,7 +700,7 @@ discard block |
||
| 700 | 700 | } |
| 701 | 701 | $postFix = (substr($path, -1, 1) === '/') ? '/' : ''; |
| 702 | 702 | $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); |
| 703 | - $mount = Filesystem::getMountManager()->find($absolutePath . $postFix); |
|
| 703 | + $mount = Filesystem::getMountManager()->find($absolutePath.$postFix); |
|
| 704 | 704 | if ($mount and $mount->getInternalPath($absolutePath) === '') { |
| 705 | 705 | return $this->removeMount($mount, $absolutePath); |
| 706 | 706 | } |
@@ -820,7 +820,7 @@ discard block |
||
| 820 | 820 | $this->renameUpdate($storage1, $storage2, $internalPath1, $internalPath2); |
| 821 | 821 | } |
| 822 | 822 | } |
| 823 | - } catch(\Exception $e) { |
|
| 823 | + } catch (\Exception $e) { |
|
| 824 | 824 | throw $e; |
| 825 | 825 | } finally { |
| 826 | 826 | $this->changeLock($path1, ILockingProvider::LOCK_SHARED, true); |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | } |
| 845 | 845 | } |
| 846 | 846 | } |
| 847 | - } catch(\Exception $e) { |
|
| 847 | + } catch (\Exception $e) { |
|
| 848 | 848 | throw $e; |
| 849 | 849 | } finally { |
| 850 | 850 | $this->unlockFile($path1, ILockingProvider::LOCK_SHARED, true); |
@@ -977,7 +977,7 @@ discard block |
||
| 977 | 977 | $hooks[] = 'write'; |
| 978 | 978 | break; |
| 979 | 979 | default: |
| 980 | - \OCP\Util::writeLog('core', 'invalid mode (' . $mode . ') for ' . $path, \OCP\Util::ERROR); |
|
| 980 | + \OCP\Util::writeLog('core', 'invalid mode ('.$mode.') for '.$path, \OCP\Util::ERROR); |
|
| 981 | 981 | } |
| 982 | 982 | |
| 983 | 983 | if ($mode !== 'r' && $mode !== 'w') { |
@@ -1081,7 +1081,7 @@ discard block |
||
| 1081 | 1081 | array(Filesystem::signal_param_path => $this->getHookPath($path)) |
| 1082 | 1082 | ); |
| 1083 | 1083 | } |
| 1084 | - list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); |
|
| 1084 | + list($storage, $internalPath) = Filesystem::resolvePath($absolutePath.$postFix); |
|
| 1085 | 1085 | if ($storage) { |
| 1086 | 1086 | $result = $storage->hash($type, $internalPath, $raw); |
| 1087 | 1087 | return $result; |
@@ -1136,7 +1136,7 @@ discard block |
||
| 1136 | 1136 | |
| 1137 | 1137 | $run = $this->runHooks($hooks, $path); |
| 1138 | 1138 | /** @var \OC\Files\Storage\Storage $storage */ |
| 1139 | - list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); |
|
| 1139 | + list($storage, $internalPath) = Filesystem::resolvePath($absolutePath.$postFix); |
|
| 1140 | 1140 | if ($run and $storage) { |
| 1141 | 1141 | if (in_array('write', $hooks) || in_array('delete', $hooks)) { |
| 1142 | 1142 | $this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE); |
@@ -1175,7 +1175,7 @@ discard block |
||
| 1175 | 1175 | $unlockLater = true; |
| 1176 | 1176 | // make sure our unlocking callback will still be called if connection is aborted |
| 1177 | 1177 | ignore_user_abort(true); |
| 1178 | - $result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) { |
|
| 1178 | + $result = CallbackWrapper::wrap($result, null, null, function() use ($hooks, $path) { |
|
| 1179 | 1179 | if (in_array('write', $hooks)) { |
| 1180 | 1180 | $this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE); |
| 1181 | 1181 | } else if (in_array('read', $hooks)) { |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | return true; |
| 1237 | 1237 | } |
| 1238 | 1238 | |
| 1239 | - return (strlen($fullPath) > strlen($defaultRoot)) && (substr($fullPath, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/'); |
|
| 1239 | + return (strlen($fullPath) > strlen($defaultRoot)) && (substr($fullPath, 0, strlen($defaultRoot) + 1) === $defaultRoot.'/'); |
|
| 1240 | 1240 | } |
| 1241 | 1241 | |
| 1242 | 1242 | /** |
@@ -1255,7 +1255,7 @@ discard block |
||
| 1255 | 1255 | if ($hook != 'read') { |
| 1256 | 1256 | \OC_Hook::emit( |
| 1257 | 1257 | Filesystem::CLASSNAME, |
| 1258 | - $prefix . $hook, |
|
| 1258 | + $prefix.$hook, |
|
| 1259 | 1259 | array( |
| 1260 | 1260 | Filesystem::signal_param_run => &$run, |
| 1261 | 1261 | Filesystem::signal_param_path => $path |
@@ -1264,7 +1264,7 @@ discard block |
||
| 1264 | 1264 | } elseif (!$post) { |
| 1265 | 1265 | \OC_Hook::emit( |
| 1266 | 1266 | Filesystem::CLASSNAME, |
| 1267 | - $prefix . $hook, |
|
| 1267 | + $prefix.$hook, |
|
| 1268 | 1268 | array( |
| 1269 | 1269 | Filesystem::signal_param_path => $path |
| 1270 | 1270 | ) |
@@ -1359,7 +1359,7 @@ discard block |
||
| 1359 | 1359 | return $this->getPartFileInfo($path); |
| 1360 | 1360 | } |
| 1361 | 1361 | $relativePath = $path; |
| 1362 | - $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path); |
|
| 1362 | + $path = Filesystem::normalizePath($this->fakeRoot.'/'.$path); |
|
| 1363 | 1363 | |
| 1364 | 1364 | $mount = Filesystem::getMountManager()->find($path); |
| 1365 | 1365 | if (!$mount) { |
@@ -1386,7 +1386,7 @@ discard block |
||
| 1386 | 1386 | //add the sizes of other mount points to the folder |
| 1387 | 1387 | $extOnly = ($includeMountPoints === 'ext'); |
| 1388 | 1388 | $mounts = Filesystem::getMountManager()->findIn($path); |
| 1389 | - $info->setSubMounts(array_filter($mounts, function (IMountPoint $mount) use ($extOnly) { |
|
| 1389 | + $info->setSubMounts(array_filter($mounts, function(IMountPoint $mount) use ($extOnly) { |
|
| 1390 | 1390 | $subStorage = $mount->getStorage(); |
| 1391 | 1391 | return !($extOnly && $subStorage instanceof \OCA\Files_Sharing\SharedStorage); |
| 1392 | 1392 | })); |
@@ -1436,12 +1436,12 @@ discard block |
||
| 1436 | 1436 | /** |
| 1437 | 1437 | * @var \OC\Files\FileInfo[] $files |
| 1438 | 1438 | */ |
| 1439 | - $files = array_map(function (ICacheEntry $content) use ($path, $storage, $mount, $sharingDisabled) { |
|
| 1439 | + $files = array_map(function(ICacheEntry $content) use ($path, $storage, $mount, $sharingDisabled) { |
|
| 1440 | 1440 | if ($sharingDisabled) { |
| 1441 | 1441 | $content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE; |
| 1442 | 1442 | } |
| 1443 | 1443 | $owner = $this->getUserObjectForOwner($storage->getOwner($content['path'])); |
| 1444 | - return new FileInfo($path . '/' . $content['name'], $storage, $content['path'], $content, $mount, $owner); |
|
| 1444 | + return new FileInfo($path.'/'.$content['name'], $storage, $content['path'], $content, $mount, $owner); |
|
| 1445 | 1445 | }, $contents); |
| 1446 | 1446 | |
| 1447 | 1447 | //add a folder for any mountpoint in this directory and add the sizes of other mountpoints to the folders |
@@ -1466,8 +1466,8 @@ discard block |
||
| 1466 | 1466 | // sometimes when the storage is not available it can be any exception |
| 1467 | 1467 | \OCP\Util::writeLog( |
| 1468 | 1468 | 'core', |
| 1469 | - 'Exception while scanning storage "' . $subStorage->getId() . '": ' . |
|
| 1470 | - get_class($e) . ': ' . $e->getMessage(), |
|
| 1469 | + 'Exception while scanning storage "'.$subStorage->getId().'": '. |
|
| 1470 | + get_class($e).': '.$e->getMessage(), |
|
| 1471 | 1471 | \OCP\Util::ERROR |
| 1472 | 1472 | ); |
| 1473 | 1473 | continue; |
@@ -1504,7 +1504,7 @@ discard block |
||
| 1504 | 1504 | break; |
| 1505 | 1505 | } |
| 1506 | 1506 | } |
| 1507 | - $rootEntry['path'] = substr(Filesystem::normalizePath($path . '/' . $rootEntry['name']), strlen($user) + 2); // full path without /$user/ |
|
| 1507 | + $rootEntry['path'] = substr(Filesystem::normalizePath($path.'/'.$rootEntry['name']), strlen($user) + 2); // full path without /$user/ |
|
| 1508 | 1508 | |
| 1509 | 1509 | // if sharing was disabled for the user we remove the share permissions |
| 1510 | 1510 | if (\OCP\Util::isSharingDisabledForUser()) { |
@@ -1512,14 +1512,14 @@ discard block |
||
| 1512 | 1512 | } |
| 1513 | 1513 | |
| 1514 | 1514 | $owner = $this->getUserObjectForOwner($subStorage->getOwner('')); |
| 1515 | - $files[] = new FileInfo($path . '/' . $rootEntry['name'], $subStorage, '', $rootEntry, $mount, $owner); |
|
| 1515 | + $files[] = new FileInfo($path.'/'.$rootEntry['name'], $subStorage, '', $rootEntry, $mount, $owner); |
|
| 1516 | 1516 | } |
| 1517 | 1517 | } |
| 1518 | 1518 | } |
| 1519 | 1519 | } |
| 1520 | 1520 | |
| 1521 | 1521 | if ($mimetype_filter) { |
| 1522 | - $files = array_filter($files, function (FileInfo $file) use ($mimetype_filter) { |
|
| 1522 | + $files = array_filter($files, function(FileInfo $file) use ($mimetype_filter) { |
|
| 1523 | 1523 | if (strpos($mimetype_filter, '/')) { |
| 1524 | 1524 | return $file->getMimetype() === $mimetype_filter; |
| 1525 | 1525 | } else { |
@@ -1548,7 +1548,7 @@ discard block |
||
| 1548 | 1548 | if ($data instanceof FileInfo) { |
| 1549 | 1549 | $data = $data->getData(); |
| 1550 | 1550 | } |
| 1551 | - $path = Filesystem::normalizePath($this->fakeRoot . '/' . $path); |
|
| 1551 | + $path = Filesystem::normalizePath($this->fakeRoot.'/'.$path); |
|
| 1552 | 1552 | /** |
| 1553 | 1553 | * @var \OC\Files\Storage\Storage $storage |
| 1554 | 1554 | * @var string $internalPath |
@@ -1575,7 +1575,7 @@ discard block |
||
| 1575 | 1575 | * @return FileInfo[] |
| 1576 | 1576 | */ |
| 1577 | 1577 | public function search($query) { |
| 1578 | - return $this->searchCommon('search', array('%' . $query . '%')); |
|
| 1578 | + return $this->searchCommon('search', array('%'.$query.'%')); |
|
| 1579 | 1579 | } |
| 1580 | 1580 | |
| 1581 | 1581 | /** |
@@ -1626,10 +1626,10 @@ discard block |
||
| 1626 | 1626 | |
| 1627 | 1627 | $results = call_user_func_array(array($cache, $method), $args); |
| 1628 | 1628 | foreach ($results as $result) { |
| 1629 | - if (substr($mountPoint . $result['path'], 0, $rootLength + 1) === $this->fakeRoot . '/') { |
|
| 1629 | + if (substr($mountPoint.$result['path'], 0, $rootLength + 1) === $this->fakeRoot.'/') { |
|
| 1630 | 1630 | $internalPath = $result['path']; |
| 1631 | - $path = $mountPoint . $result['path']; |
|
| 1632 | - $result['path'] = substr($mountPoint . $result['path'], $rootLength); |
|
| 1631 | + $path = $mountPoint.$result['path']; |
|
| 1632 | + $result['path'] = substr($mountPoint.$result['path'], $rootLength); |
|
| 1633 | 1633 | $owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath)); |
| 1634 | 1634 | $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner); |
| 1635 | 1635 | } |
@@ -1647,8 +1647,8 @@ discard block |
||
| 1647 | 1647 | if ($results) { |
| 1648 | 1648 | foreach ($results as $result) { |
| 1649 | 1649 | $internalPath = $result['path']; |
| 1650 | - $result['path'] = rtrim($relativeMountPoint . $result['path'], '/'); |
|
| 1651 | - $path = rtrim($mountPoint . $internalPath, '/'); |
|
| 1650 | + $result['path'] = rtrim($relativeMountPoint.$result['path'], '/'); |
|
| 1651 | + $path = rtrim($mountPoint.$internalPath, '/'); |
|
| 1652 | 1652 | $owner = \OC::$server->getUserManager()->get($storage->getOwner($internalPath)); |
| 1653 | 1653 | $files[] = new FileInfo($path, $storage, $internalPath, $result, $mount, $owner); |
| 1654 | 1654 | } |
@@ -1669,7 +1669,7 @@ discard block |
||
| 1669 | 1669 | public function getOwner($path) { |
| 1670 | 1670 | $info = $this->getFileInfo($path); |
| 1671 | 1671 | if (!$info) { |
| 1672 | - throw new NotFoundException($path . ' not found while trying to get owner'); |
|
| 1672 | + throw new NotFoundException($path.' not found while trying to get owner'); |
|
| 1673 | 1673 | } |
| 1674 | 1674 | return $info->getOwner()->getUID(); |
| 1675 | 1675 | } |
@@ -1703,7 +1703,7 @@ discard block |
||
| 1703 | 1703 | * @return string |
| 1704 | 1704 | */ |
| 1705 | 1705 | public function getPath($id) { |
| 1706 | - $id = (int)$id; |
|
| 1706 | + $id = (int) $id; |
|
| 1707 | 1707 | $manager = Filesystem::getMountManager(); |
| 1708 | 1708 | $mounts = $manager->findIn($this->fakeRoot); |
| 1709 | 1709 | $mounts[] = $manager->find($this->fakeRoot); |
@@ -1718,7 +1718,7 @@ discard block |
||
| 1718 | 1718 | $cache = $mount->getStorage()->getCache(); |
| 1719 | 1719 | $internalPath = $cache->getPathById($id); |
| 1720 | 1720 | if (is_string($internalPath)) { |
| 1721 | - $fullPath = $mount->getMountPoint() . $internalPath; |
|
| 1721 | + $fullPath = $mount->getMountPoint().$internalPath; |
|
| 1722 | 1722 | if (!is_null($path = $this->getRelativePath($fullPath))) { |
| 1723 | 1723 | return $path; |
| 1724 | 1724 | } |
@@ -1761,10 +1761,10 @@ discard block |
||
| 1761 | 1761 | } |
| 1762 | 1762 | |
| 1763 | 1763 | // note: cannot use the view because the target is already locked |
| 1764 | - $fileId = (int)$targetStorage->getCache()->getId($targetInternalPath); |
|
| 1764 | + $fileId = (int) $targetStorage->getCache()->getId($targetInternalPath); |
|
| 1765 | 1765 | if ($fileId === -1) { |
| 1766 | 1766 | // target might not exist, need to check parent instead |
| 1767 | - $fileId = (int)$targetStorage->getCache()->getId(dirname($targetInternalPath)); |
|
| 1767 | + $fileId = (int) $targetStorage->getCache()->getId(dirname($targetInternalPath)); |
|
| 1768 | 1768 | } |
| 1769 | 1769 | |
| 1770 | 1770 | // check if any of the parents were shared by the current owner (include collections) |
@@ -1864,7 +1864,7 @@ discard block |
||
| 1864 | 1864 | $resultPath = ''; |
| 1865 | 1865 | foreach ($parts as $part) { |
| 1866 | 1866 | if ($part) { |
| 1867 | - $resultPath .= '/' . $part; |
|
| 1867 | + $resultPath .= '/'.$part; |
|
| 1868 | 1868 | $result[] = $resultPath; |
| 1869 | 1869 | } |
| 1870 | 1870 | } |
@@ -2127,16 +2127,16 @@ discard block |
||
| 2127 | 2127 | public function getUidAndFilename($filename) { |
| 2128 | 2128 | $info = $this->getFileInfo($filename); |
| 2129 | 2129 | if (!$info instanceof \OCP\Files\FileInfo) { |
| 2130 | - throw new NotFoundException($this->getAbsolutePath($filename) . ' not found'); |
|
| 2130 | + throw new NotFoundException($this->getAbsolutePath($filename).' not found'); |
|
| 2131 | 2131 | } |
| 2132 | 2132 | $uid = $info->getOwner()->getUID(); |
| 2133 | 2133 | if ($uid != \OCP\User::getUser()) { |
| 2134 | 2134 | Filesystem::initMountPoints($uid); |
| 2135 | - $ownerView = new View('/' . $uid . '/files'); |
|
| 2135 | + $ownerView = new View('/'.$uid.'/files'); |
|
| 2136 | 2136 | try { |
| 2137 | 2137 | $filename = $ownerView->getPath($info['fileid']); |
| 2138 | 2138 | } catch (NotFoundException $e) { |
| 2139 | - throw new NotFoundException('File with id ' . $info['fileid'] . ' not found for user ' . $uid); |
|
| 2139 | + throw new NotFoundException('File with id '.$info['fileid'].' not found for user '.$uid); |
|
| 2140 | 2140 | } |
| 2141 | 2141 | } |
| 2142 | 2142 | return [$uid, $filename]; |
@@ -2153,7 +2153,7 @@ discard block |
||
| 2153 | 2153 | $directoryParts = array_filter($directoryParts); |
| 2154 | 2154 | foreach ($directoryParts as $key => $part) { |
| 2155 | 2155 | $currentPathElements = array_slice($directoryParts, 0, $key); |
| 2156 | - $currentPath = '/' . implode('/', $currentPathElements); |
|
| 2156 | + $currentPath = '/'.implode('/', $currentPathElements); |
|
| 2157 | 2157 | if ($this->is_file($currentPath)) { |
| 2158 | 2158 | return false; |
| 2159 | 2159 | } |