@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | // interpolate $message as defined in PSR-3 |
| 211 | 211 | $replace = []; |
| 212 | 212 | foreach ($context as $key => $val) { |
| 213 | - $replace['{' . $key . '}'] = $val; |
|
| 213 | + $replace['{'.$key.'}'] = $val; |
|
| 214 | 214 | } |
| 215 | 215 | $message = strtr($message, $replace); |
| 216 | 216 | |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | public function getLogPath():string { |
| 320 | - if($this->logger instanceof IFileBased) { |
|
| 320 | + if ($this->logger instanceof IFileBased) { |
|
| 321 | 321 | return $this->logger->getLogFilePath(); |
| 322 | 322 | } |
| 323 | 323 | throw new \RuntimeException('Log implementation has no path'); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | * @return StreamResponse |
| 56 | 56 | */ |
| 57 | 57 | public function download() { |
| 58 | - if(!$this->log instanceof Log) { |
|
| 58 | + if (!$this->log instanceof Log) { |
|
| 59 | 59 | throw new \UnexpectedValueException('Log file not available'); |
| 60 | 60 | } |
| 61 | 61 | $resp = new StreamResponse($this->log->getLogPath()); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | parent::__construct(); |
| 164 | 164 | $this->webRoot = $webRoot; |
| 165 | 165 | |
| 166 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
| 166 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
| 167 | 167 | return $c; |
| 168 | 168 | }); |
| 169 | 169 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
| 177 | 177 | |
| 178 | 178 | |
| 179 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
| 179 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
| 180 | 180 | return new PreviewManager( |
| 181 | 181 | $c->getConfig(), |
| 182 | 182 | $c->getRootFolder(), |
@@ -187,13 +187,13 @@ discard block |
||
| 187 | 187 | }); |
| 188 | 188 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
| 189 | 189 | |
| 190 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
| 190 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
| 191 | 191 | return new \OC\Preview\Watcher( |
| 192 | 192 | $c->getAppDataDir('preview') |
| 193 | 193 | ); |
| 194 | 194 | }); |
| 195 | 195 | |
| 196 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
| 196 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
| 197 | 197 | $view = new View(); |
| 198 | 198 | $util = new Encryption\Util( |
| 199 | 199 | $view, |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | ); |
| 212 | 212 | }); |
| 213 | 213 | |
| 214 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
| 214 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
| 215 | 215 | $util = new Encryption\Util( |
| 216 | 216 | new View(), |
| 217 | 217 | $c->getUserManager(), |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | ); |
| 226 | 226 | }); |
| 227 | 227 | |
| 228 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
| 228 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
| 229 | 229 | $view = new View(); |
| 230 | 230 | $util = new Encryption\Util( |
| 231 | 231 | $view, |
@@ -236,30 +236,30 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | return new Encryption\Keys\Storage($view, $util); |
| 238 | 238 | }); |
| 239 | - $this->registerService('TagMapper', function (Server $c) { |
|
| 239 | + $this->registerService('TagMapper', function(Server $c) { |
|
| 240 | 240 | return new TagMapper($c->getDatabaseConnection()); |
| 241 | 241 | }); |
| 242 | 242 | |
| 243 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
| 243 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
| 244 | 244 | $tagMapper = $c->query('TagMapper'); |
| 245 | 245 | return new TagManager($tagMapper, $c->getUserSession()); |
| 246 | 246 | }); |
| 247 | 247 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
| 248 | 248 | |
| 249 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
| 249 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
| 250 | 250 | $config = $c->getConfig(); |
| 251 | 251 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
| 252 | 252 | return new $factoryClass($this); |
| 253 | 253 | }); |
| 254 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
| 254 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
| 255 | 255 | return $c->query('SystemTagManagerFactory')->getManager(); |
| 256 | 256 | }); |
| 257 | 257 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
| 258 | 258 | |
| 259 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
| 259 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
| 260 | 260 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
| 261 | 261 | }); |
| 262 | - $this->registerService('RootFolder', function (Server $c) { |
|
| 262 | + $this->registerService('RootFolder', function(Server $c) { |
|
| 263 | 263 | $manager = \OC\Files\Filesystem::getMountManager(null); |
| 264 | 264 | $view = new View(); |
| 265 | 265 | $root = new Root( |
@@ -280,38 +280,38 @@ discard block |
||
| 280 | 280 | }); |
| 281 | 281 | $this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class); |
| 282 | 282 | |
| 283 | - $this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) { |
|
| 284 | - return new LazyRoot(function () use ($c) { |
|
| 283 | + $this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) { |
|
| 284 | + return new LazyRoot(function() use ($c) { |
|
| 285 | 285 | return $c->query('RootFolder'); |
| 286 | 286 | }); |
| 287 | 287 | }); |
| 288 | 288 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
| 289 | 289 | |
| 290 | - $this->registerService(\OC\User\Manager::class, function (Server $c) { |
|
| 290 | + $this->registerService(\OC\User\Manager::class, function(Server $c) { |
|
| 291 | 291 | $config = $c->getConfig(); |
| 292 | 292 | return new \OC\User\Manager($config); |
| 293 | 293 | }); |
| 294 | 294 | $this->registerAlias('UserManager', \OC\User\Manager::class); |
| 295 | 295 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
| 296 | 296 | |
| 297 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
| 297 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
| 298 | 298 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
| 299 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
| 299 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
| 300 | 300 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
| 301 | 301 | }); |
| 302 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
| 302 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
| 303 | 303 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
| 304 | 304 | }); |
| 305 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
| 305 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
| 306 | 306 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
| 307 | 307 | }); |
| 308 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
| 308 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
| 309 | 309 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
| 310 | 310 | }); |
| 311 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
| 311 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
| 312 | 312 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
| 313 | 313 | }); |
| 314 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
| 314 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
| 315 | 315 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
| 316 | 316 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
| 317 | 317 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | }); |
| 321 | 321 | $this->registerAlias('GroupManager', \OCP\IGroupManager::class); |
| 322 | 322 | |
| 323 | - $this->registerService(Store::class, function (Server $c) { |
|
| 323 | + $this->registerService(Store::class, function(Server $c) { |
|
| 324 | 324 | $session = $c->getSession(); |
| 325 | 325 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
| 326 | 326 | $tokenProvider = $c->query(IProvider::class); |
@@ -331,11 +331,11 @@ discard block |
||
| 331 | 331 | return new Store($session, $logger, $tokenProvider); |
| 332 | 332 | }); |
| 333 | 333 | $this->registerAlias(IStore::class, Store::class); |
| 334 | - $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { |
|
| 334 | + $this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) { |
|
| 335 | 335 | $dbConnection = $c->getDatabaseConnection(); |
| 336 | 336 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
| 337 | 337 | }); |
| 338 | - $this->registerService(Authentication\Token\DefaultTokenProvider::class, function (Server $c) { |
|
| 338 | + $this->registerService(Authentication\Token\DefaultTokenProvider::class, function(Server $c) { |
|
| 339 | 339 | $mapper = $c->query(Authentication\Token\DefaultTokenMapper::class); |
| 340 | 340 | $crypto = $c->getCrypto(); |
| 341 | 341 | $config = $c->getConfig(); |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | }); |
| 346 | 346 | $this->registerAlias(IProvider::class, Authentication\Token\DefaultTokenProvider::class); |
| 347 | 347 | |
| 348 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
| 348 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
| 349 | 349 | $manager = $c->getUserManager(); |
| 350 | 350 | $session = new \OC\Session\Memory(''); |
| 351 | 351 | $timeFactory = new TimeFactory(); |
@@ -369,45 +369,45 @@ discard block |
||
| 369 | 369 | $c->getLockdownManager(), |
| 370 | 370 | $c->getLogger() |
| 371 | 371 | ); |
| 372 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
| 372 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
| 373 | 373 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 374 | 374 | }); |
| 375 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
| 375 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
| 376 | 376 | /** @var $user \OC\User\User */ |
| 377 | 377 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
| 378 | 378 | }); |
| 379 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) { |
|
| 379 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) { |
|
| 380 | 380 | /** @var $user \OC\User\User */ |
| 381 | 381 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
| 382 | 382 | $dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
| 383 | 383 | }); |
| 384 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
| 384 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
| 385 | 385 | /** @var $user \OC\User\User */ |
| 386 | 386 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
| 387 | 387 | }); |
| 388 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 388 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
| 389 | 389 | /** @var $user \OC\User\User */ |
| 390 | 390 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 391 | 391 | }); |
| 392 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
| 392 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
| 393 | 393 | /** @var $user \OC\User\User */ |
| 394 | 394 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
| 395 | 395 | }); |
| 396 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
| 396 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
| 397 | 397 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
| 398 | 398 | }); |
| 399 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
| 399 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
| 400 | 400 | /** @var $user \OC\User\User */ |
| 401 | 401 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
| 402 | 402 | }); |
| 403 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
| 403 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
| 404 | 404 | /** @var $user \OC\User\User */ |
| 405 | 405 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
| 406 | 406 | }); |
| 407 | - $userSession->listen('\OC\User', 'logout', function () { |
|
| 407 | + $userSession->listen('\OC\User', 'logout', function() { |
|
| 408 | 408 | \OC_Hook::emit('OC_User', 'logout', array()); |
| 409 | 409 | }); |
| 410 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
| 410 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
| 411 | 411 | /** @var $user \OC\User\User */ |
| 412 | 412 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
| 413 | 413 | $dispatcher->dispatch('OCP\IUser::changeUser', new GenericEvent($user, ['feature' => $feature, 'oldValue' => $oldValue, 'value' => $value])); |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | }); |
| 417 | 417 | $this->registerAlias('UserSession', \OCP\IUserSession::class); |
| 418 | 418 | |
| 419 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
| 419 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
| 420 | 420 | return new \OC\Authentication\TwoFactorAuth\Manager( |
| 421 | 421 | $c->getAppManager(), |
| 422 | 422 | $c->getSession(), |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
| 433 | 433 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
| 434 | 434 | |
| 435 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
| 435 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
| 436 | 436 | return new \OC\AllConfig( |
| 437 | 437 | $c->getSystemConfig() |
| 438 | 438 | ); |
@@ -440,17 +440,17 @@ discard block |
||
| 440 | 440 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
| 441 | 441 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
| 442 | 442 | |
| 443 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
| 443 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
| 444 | 444 | return new \OC\SystemConfig($config); |
| 445 | 445 | }); |
| 446 | 446 | |
| 447 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
| 447 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
| 448 | 448 | return new \OC\AppConfig($c->getDatabaseConnection()); |
| 449 | 449 | }); |
| 450 | 450 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
| 451 | 451 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
| 452 | 452 | |
| 453 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
| 453 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
| 454 | 454 | return new \OC\L10N\Factory( |
| 455 | 455 | $c->getConfig(), |
| 456 | 456 | $c->getRequest(), |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | }); |
| 461 | 461 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
| 462 | 462 | |
| 463 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
| 463 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
| 464 | 464 | $config = $c->getConfig(); |
| 465 | 465 | $cacheFactory = $c->getMemCacheFactory(); |
| 466 | 466 | $request = $c->getRequest(); |
@@ -475,12 +475,12 @@ discard block |
||
| 475 | 475 | $this->registerAlias('AppFetcher', AppFetcher::class); |
| 476 | 476 | $this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
| 477 | 477 | |
| 478 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
| 478 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
| 479 | 479 | return new Cache\File(); |
| 480 | 480 | }); |
| 481 | 481 | $this->registerAlias('UserCache', \OCP\ICache::class); |
| 482 | 482 | |
| 483 | - $this->registerService(Factory::class, function (Server $c) { |
|
| 483 | + $this->registerService(Factory::class, function(Server $c) { |
|
| 484 | 484 | |
| 485 | 485 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
| 486 | 486 | ArrayCache::class, |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | $version = implode(',', $v); |
| 498 | 498 | $instanceId = \OC_Util::getInstanceId(); |
| 499 | 499 | $path = \OC::$SERVERROOT; |
| 500 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
| 500 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
| 501 | 501 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
| 502 | 502 | $config->getSystemValue('memcache.local', null), |
| 503 | 503 | $config->getSystemValue('memcache.distributed', null), |
@@ -510,12 +510,12 @@ discard block |
||
| 510 | 510 | $this->registerAlias('MemCacheFactory', Factory::class); |
| 511 | 511 | $this->registerAlias(ICacheFactory::class, Factory::class); |
| 512 | 512 | |
| 513 | - $this->registerService('RedisFactory', function (Server $c) { |
|
| 513 | + $this->registerService('RedisFactory', function(Server $c) { |
|
| 514 | 514 | $systemConfig = $c->getSystemConfig(); |
| 515 | 515 | return new RedisFactory($systemConfig); |
| 516 | 516 | }); |
| 517 | 517 | |
| 518 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
| 518 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
| 519 | 519 | return new \OC\Activity\Manager( |
| 520 | 520 | $c->getRequest(), |
| 521 | 521 | $c->getUserSession(), |
@@ -525,14 +525,14 @@ discard block |
||
| 525 | 525 | }); |
| 526 | 526 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
| 527 | 527 | |
| 528 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
| 528 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
| 529 | 529 | return new \OC\Activity\EventMerger( |
| 530 | 530 | $c->getL10N('lib') |
| 531 | 531 | ); |
| 532 | 532 | }); |
| 533 | 533 | $this->registerAlias(IValidator::class, Validator::class); |
| 534 | 534 | |
| 535 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
| 535 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
| 536 | 536 | return new AvatarManager( |
| 537 | 537 | $c->query(\OC\User\Manager::class), |
| 538 | 538 | $c->getAppDataDir('avatar'), |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | |
| 546 | 546 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
| 547 | 547 | |
| 548 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
| 548 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
| 549 | 549 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
| 550 | 550 | $factory = new LogFactory($c); |
| 551 | 551 | $logger = $factory->get($logType); |
@@ -556,12 +556,12 @@ discard block |
||
| 556 | 556 | }); |
| 557 | 557 | $this->registerAlias('Logger', \OCP\ILogger::class); |
| 558 | 558 | |
| 559 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
| 559 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
| 560 | 560 | return new LogFactory($c); |
| 561 | 561 | }); |
| 562 | 562 | $this->registerAlias('LogFactory', ILogFactory::class); |
| 563 | 563 | |
| 564 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
| 564 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
| 565 | 565 | $config = $c->getConfig(); |
| 566 | 566 | return new \OC\BackgroundJob\JobList( |
| 567 | 567 | $c->getDatabaseConnection(), |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | }); |
| 572 | 572 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
| 573 | 573 | |
| 574 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
| 574 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
| 575 | 575 | $cacheFactory = $c->getMemCacheFactory(); |
| 576 | 576 | $logger = $c->getLogger(); |
| 577 | 577 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -583,12 +583,12 @@ discard block |
||
| 583 | 583 | }); |
| 584 | 584 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
| 585 | 585 | |
| 586 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
| 586 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
| 587 | 587 | return new Search(); |
| 588 | 588 | }); |
| 589 | 589 | $this->registerAlias('Search', \OCP\ISearch::class); |
| 590 | 590 | |
| 591 | - $this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) { |
|
| 591 | + $this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) { |
|
| 592 | 592 | return new \OC\Security\RateLimiting\Limiter( |
| 593 | 593 | $this->getUserSession(), |
| 594 | 594 | $this->getRequest(), |
@@ -596,34 +596,34 @@ discard block |
||
| 596 | 596 | $c->query(\OC\Security\RateLimiting\Backend\IBackend::class) |
| 597 | 597 | ); |
| 598 | 598 | }); |
| 599 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
| 599 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
| 600 | 600 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
| 601 | 601 | $this->getMemCacheFactory(), |
| 602 | 602 | new \OC\AppFramework\Utility\TimeFactory() |
| 603 | 603 | ); |
| 604 | 604 | }); |
| 605 | 605 | |
| 606 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
| 606 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
| 607 | 607 | return new SecureRandom(); |
| 608 | 608 | }); |
| 609 | 609 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
| 610 | 610 | |
| 611 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
| 611 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
| 612 | 612 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
| 613 | 613 | }); |
| 614 | 614 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
| 615 | 615 | |
| 616 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
| 616 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
| 617 | 617 | return new Hasher($c->getConfig()); |
| 618 | 618 | }); |
| 619 | 619 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
| 620 | 620 | |
| 621 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
| 621 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
| 622 | 622 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
| 623 | 623 | }); |
| 624 | 624 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
| 625 | 625 | |
| 626 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
| 626 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
| 627 | 627 | $systemConfig = $c->getSystemConfig(); |
| 628 | 628 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
| 629 | 629 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
| 639 | 639 | |
| 640 | 640 | |
| 641 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
| 641 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
| 642 | 642 | $user = \OC_User::getUser(); |
| 643 | 643 | $uid = $user ? $user : null; |
| 644 | 644 | return new ClientService( |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | ); |
| 654 | 654 | }); |
| 655 | 655 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
| 656 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
| 656 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
| 657 | 657 | $eventLogger = new EventLogger(); |
| 658 | 658 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 659 | 659 | // In debug mode, module is being activated by default |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | }); |
| 664 | 664 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
| 665 | 665 | |
| 666 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
| 666 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
| 667 | 667 | $queryLogger = new QueryLogger(); |
| 668 | 668 | if ($c->getSystemConfig()->getValue('debug', false)) { |
| 669 | 669 | // In debug mode, module is being activated by default |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | }); |
| 674 | 674 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
| 675 | 675 | |
| 676 | - $this->registerService(TempManager::class, function (Server $c) { |
|
| 676 | + $this->registerService(TempManager::class, function(Server $c) { |
|
| 677 | 677 | return new TempManager( |
| 678 | 678 | $c->getLogger(), |
| 679 | 679 | $c->getConfig() |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | $this->registerAlias('TempManager', TempManager::class); |
| 683 | 683 | $this->registerAlias(ITempManager::class, TempManager::class); |
| 684 | 684 | |
| 685 | - $this->registerService(AppManager::class, function (Server $c) { |
|
| 685 | + $this->registerService(AppManager::class, function(Server $c) { |
|
| 686 | 686 | return new \OC\App\AppManager( |
| 687 | 687 | $c->getUserSession(), |
| 688 | 688 | $c->query(\OC\AppConfig::class), |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | $this->registerAlias('AppManager', AppManager::class); |
| 695 | 695 | $this->registerAlias(IAppManager::class, AppManager::class); |
| 696 | 696 | |
| 697 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
| 697 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
| 698 | 698 | return new DateTimeZone( |
| 699 | 699 | $c->getConfig(), |
| 700 | 700 | $c->getSession() |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | }); |
| 703 | 703 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
| 704 | 704 | |
| 705 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
| 705 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
| 706 | 706 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
| 707 | 707 | |
| 708 | 708 | return new DateTimeFormatter( |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | }); |
| 713 | 713 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
| 714 | 714 | |
| 715 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
| 715 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
| 716 | 716 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
| 717 | 717 | $listener = new UserMountCacheListener($mountCache); |
| 718 | 718 | $listener->listen($c->getUserManager()); |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | }); |
| 721 | 721 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
| 722 | 722 | |
| 723 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
| 723 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
| 724 | 724 | $loader = \OC\Files\Filesystem::getLoader(); |
| 725 | 725 | $mountCache = $c->query('UserMountCache'); |
| 726 | 726 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -736,10 +736,10 @@ discard block |
||
| 736 | 736 | }); |
| 737 | 737 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
| 738 | 738 | |
| 739 | - $this->registerService('IniWrapper', function ($c) { |
|
| 739 | + $this->registerService('IniWrapper', function($c) { |
|
| 740 | 740 | return new IniGetWrapper(); |
| 741 | 741 | }); |
| 742 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
| 742 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
| 743 | 743 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
| 744 | 744 | if ($busClass) { |
| 745 | 745 | list($app, $class) = explode('::', $busClass, 2); |
@@ -754,10 +754,10 @@ discard block |
||
| 754 | 754 | return new CronBus($jobList); |
| 755 | 755 | } |
| 756 | 756 | }); |
| 757 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
| 757 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
| 758 | 758 | return new TrustedDomainHelper($this->getConfig()); |
| 759 | 759 | }); |
| 760 | - $this->registerService('Throttler', function (Server $c) { |
|
| 760 | + $this->registerService('Throttler', function(Server $c) { |
|
| 761 | 761 | return new Throttler( |
| 762 | 762 | $c->getDatabaseConnection(), |
| 763 | 763 | new TimeFactory(), |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | $c->getConfig() |
| 766 | 766 | ); |
| 767 | 767 | }); |
| 768 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
| 768 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
| 769 | 769 | // IConfig and IAppManager requires a working database. This code |
| 770 | 770 | // might however be called when ownCloud is not yet setup. |
| 771 | 771 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | $c->getTempManager() |
| 787 | 787 | ); |
| 788 | 788 | }); |
| 789 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
| 789 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
| 790 | 790 | if (isset($this['urlParams'])) { |
| 791 | 791 | $urlParams = $this['urlParams']; |
| 792 | 792 | } else { |
@@ -822,7 +822,7 @@ discard block |
||
| 822 | 822 | }); |
| 823 | 823 | $this->registerAlias('Request', \OCP\IRequest::class); |
| 824 | 824 | |
| 825 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
| 825 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
| 826 | 826 | return new Mailer( |
| 827 | 827 | $c->getConfig(), |
| 828 | 828 | $c->getLogger(), |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | }); |
| 834 | 834 | $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
| 835 | 835 | |
| 836 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
| 836 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
| 837 | 837 | $config = $c->getConfig(); |
| 838 | 838 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
| 839 | 839 | if (is_null($factoryClass)) { |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | $factory = new $factoryClass($this); |
| 844 | 844 | return $factory->getLDAPProvider(); |
| 845 | 845 | }); |
| 846 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
| 846 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
| 847 | 847 | $ini = $c->getIniWrapper(); |
| 848 | 848 | $config = $c->getConfig(); |
| 849 | 849 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -866,49 +866,49 @@ discard block |
||
| 866 | 866 | }); |
| 867 | 867 | $this->registerAlias('LockingProvider', ILockingProvider::class); |
| 868 | 868 | |
| 869 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
| 869 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
| 870 | 870 | return new \OC\Files\Mount\Manager(); |
| 871 | 871 | }); |
| 872 | 872 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
| 873 | 873 | |
| 874 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
| 874 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
| 875 | 875 | return new \OC\Files\Type\Detection( |
| 876 | 876 | $c->getURLGenerator(), |
| 877 | 877 | \OC::$configDir, |
| 878 | - \OC::$SERVERROOT . '/resources/config/' |
|
| 878 | + \OC::$SERVERROOT.'/resources/config/' |
|
| 879 | 879 | ); |
| 880 | 880 | }); |
| 881 | 881 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
| 882 | 882 | |
| 883 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
| 883 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
| 884 | 884 | return new \OC\Files\Type\Loader( |
| 885 | 885 | $c->getDatabaseConnection() |
| 886 | 886 | ); |
| 887 | 887 | }); |
| 888 | 888 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
| 889 | - $this->registerService(BundleFetcher::class, function () { |
|
| 889 | + $this->registerService(BundleFetcher::class, function() { |
|
| 890 | 890 | return new BundleFetcher($this->getL10N('lib')); |
| 891 | 891 | }); |
| 892 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
| 892 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
| 893 | 893 | return new Manager( |
| 894 | 894 | $c->query(IValidator::class) |
| 895 | 895 | ); |
| 896 | 896 | }); |
| 897 | 897 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
| 898 | 898 | |
| 899 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
| 899 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
| 900 | 900 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
| 901 | - $manager->registerCapability(function () use ($c) { |
|
| 901 | + $manager->registerCapability(function() use ($c) { |
|
| 902 | 902 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
| 903 | 903 | }); |
| 904 | - $manager->registerCapability(function () use ($c) { |
|
| 904 | + $manager->registerCapability(function() use ($c) { |
|
| 905 | 905 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
| 906 | 906 | }); |
| 907 | 907 | return $manager; |
| 908 | 908 | }); |
| 909 | 909 | $this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
| 910 | 910 | |
| 911 | - $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
| 911 | + $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
| 912 | 912 | $config = $c->getConfig(); |
| 913 | 913 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
| 914 | 914 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -918,7 +918,7 @@ discard block |
||
| 918 | 918 | $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
| 919 | 919 | $manager = $c->getUserManager(); |
| 920 | 920 | $user = $manager->get($id); |
| 921 | - if(is_null($user)) { |
|
| 921 | + if (is_null($user)) { |
|
| 922 | 922 | $l = $c->getL10N('core'); |
| 923 | 923 | $displayName = $l->t('Unknown user'); |
| 924 | 924 | } else { |
@@ -931,7 +931,7 @@ discard block |
||
| 931 | 931 | }); |
| 932 | 932 | $this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
| 933 | 933 | |
| 934 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
| 934 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
| 935 | 935 | /* |
| 936 | 936 | * Dark magic for autoloader. |
| 937 | 937 | * If we do a class_exists it will try to load the class which will |
@@ -958,7 +958,7 @@ discard block |
||
| 958 | 958 | } |
| 959 | 959 | return new \OC_Defaults(); |
| 960 | 960 | }); |
| 961 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
| 961 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
| 962 | 962 | /** @var Factory $cacheFactory */ |
| 963 | 963 | $cacheFactory = $c->query(Factory::class); |
| 964 | 964 | return new SCSSCacher( |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | $this->getMemCacheFactory() |
| 972 | 972 | ); |
| 973 | 973 | }); |
| 974 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
| 974 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
| 975 | 975 | /** @var Factory $cacheFactory */ |
| 976 | 976 | $cacheFactory = $c->query(Factory::class); |
| 977 | 977 | return new JSCombiner( |
@@ -982,13 +982,13 @@ discard block |
||
| 982 | 982 | $c->getLogger() |
| 983 | 983 | ); |
| 984 | 984 | }); |
| 985 | - $this->registerService(EventDispatcher::class, function () { |
|
| 985 | + $this->registerService(EventDispatcher::class, function() { |
|
| 986 | 986 | return new EventDispatcher(); |
| 987 | 987 | }); |
| 988 | 988 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
| 989 | 989 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
| 990 | 990 | |
| 991 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
| 991 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
| 992 | 992 | // FIXME: Instantiiated here due to cyclic dependency |
| 993 | 993 | $request = new Request( |
| 994 | 994 | [ |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | $request |
| 1014 | 1014 | ); |
| 1015 | 1015 | }); |
| 1016 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
| 1016 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
| 1017 | 1017 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
| 1018 | 1018 | |
| 1019 | 1019 | return new CsrfTokenManager( |
@@ -1021,22 +1021,22 @@ discard block |
||
| 1021 | 1021 | $c->query(SessionStorage::class) |
| 1022 | 1022 | ); |
| 1023 | 1023 | }); |
| 1024 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
| 1024 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
| 1025 | 1025 | return new SessionStorage($c->getSession()); |
| 1026 | 1026 | }); |
| 1027 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
| 1027 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
| 1028 | 1028 | return new ContentSecurityPolicyManager(); |
| 1029 | 1029 | }); |
| 1030 | 1030 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
| 1031 | 1031 | |
| 1032 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
| 1032 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
| 1033 | 1033 | return new ContentSecurityPolicyNonceManager( |
| 1034 | 1034 | $c->getCsrfTokenManager(), |
| 1035 | 1035 | $c->getRequest() |
| 1036 | 1036 | ); |
| 1037 | 1037 | }); |
| 1038 | 1038 | |
| 1039 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
| 1039 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
| 1040 | 1040 | $config = $c->getConfig(); |
| 1041 | 1041 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
| 1042 | 1042 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1079,7 +1079,7 @@ discard block |
||
| 1079 | 1079 | |
| 1080 | 1080 | $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class); |
| 1081 | 1081 | |
| 1082 | - $this->registerService('SettingsManager', function (Server $c) { |
|
| 1082 | + $this->registerService('SettingsManager', function(Server $c) { |
|
| 1083 | 1083 | $manager = new \OC\Settings\Manager( |
| 1084 | 1084 | $c->getLogger(), |
| 1085 | 1085 | $c->getDatabaseConnection(), |
@@ -1097,24 +1097,24 @@ discard block |
||
| 1097 | 1097 | ); |
| 1098 | 1098 | return $manager; |
| 1099 | 1099 | }); |
| 1100 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
| 1100 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
| 1101 | 1101 | return new \OC\Files\AppData\Factory( |
| 1102 | 1102 | $c->getRootFolder(), |
| 1103 | 1103 | $c->getSystemConfig() |
| 1104 | 1104 | ); |
| 1105 | 1105 | }); |
| 1106 | 1106 | |
| 1107 | - $this->registerService('LockdownManager', function (Server $c) { |
|
| 1108 | - return new LockdownManager(function () use ($c) { |
|
| 1107 | + $this->registerService('LockdownManager', function(Server $c) { |
|
| 1108 | + return new LockdownManager(function() use ($c) { |
|
| 1109 | 1109 | return $c->getSession(); |
| 1110 | 1110 | }); |
| 1111 | 1111 | }); |
| 1112 | 1112 | |
| 1113 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
| 1113 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
| 1114 | 1114 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
| 1115 | 1115 | }); |
| 1116 | 1116 | |
| 1117 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
| 1117 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
| 1118 | 1118 | return new CloudIdManager(); |
| 1119 | 1119 | }); |
| 1120 | 1120 | |
@@ -1124,18 +1124,18 @@ discard block |
||
| 1124 | 1124 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
| 1125 | 1125 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
| 1126 | 1126 | |
| 1127 | - $this->registerService(Defaults::class, function (Server $c) { |
|
| 1127 | + $this->registerService(Defaults::class, function(Server $c) { |
|
| 1128 | 1128 | return new Defaults( |
| 1129 | 1129 | $c->getThemingDefaults() |
| 1130 | 1130 | ); |
| 1131 | 1131 | }); |
| 1132 | 1132 | $this->registerAlias('Defaults', \OCP\Defaults::class); |
| 1133 | 1133 | |
| 1134 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
| 1134 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
| 1135 | 1135 | return $c->query(\OCP\IUserSession::class)->getSession(); |
| 1136 | 1136 | }); |
| 1137 | 1137 | |
| 1138 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
| 1138 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
| 1139 | 1139 | return new ShareHelper( |
| 1140 | 1140 | $c->query(\OCP\Share\IManager::class) |
| 1141 | 1141 | ); |
@@ -1197,11 +1197,11 @@ discard block |
||
| 1197 | 1197 | // no avatar to remove |
| 1198 | 1198 | } catch (\Exception $e) { |
| 1199 | 1199 | // Ignore exceptions |
| 1200 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
| 1200 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
| 1201 | 1201 | } |
| 1202 | 1202 | }); |
| 1203 | 1203 | |
| 1204 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
| 1204 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
| 1205 | 1205 | $manager = $this->getAvatarManager(); |
| 1206 | 1206 | /** @var IUser $user */ |
| 1207 | 1207 | $user = $e->getSubject(); |
@@ -1352,7 +1352,7 @@ discard block |
||
| 1352 | 1352 | * @deprecated since 9.2.0 use IAppData |
| 1353 | 1353 | */ |
| 1354 | 1354 | public function getAppFolder() { |
| 1355 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
| 1355 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
| 1356 | 1356 | $root = $this->getRootFolder(); |
| 1357 | 1357 | if (!$root->nodeExists($dir)) { |
| 1358 | 1358 | $folder = $root->newFolder($dir); |
@@ -1927,7 +1927,7 @@ discard block |
||
| 1927 | 1927 | /** |
| 1928 | 1928 | * @return \OCP\Collaboration\AutoComplete\IManager |
| 1929 | 1929 | */ |
| 1930 | - public function getAutoCompleteManager(){ |
|
| 1930 | + public function getAutoCompleteManager() { |
|
| 1931 | 1931 | return $this->query(IManager::class); |
| 1932 | 1932 | } |
| 1933 | 1933 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | // need to send an initial message to force-init the event source, |
| 45 | 45 | // which will then trigger its own CSRF check and produces its own CSRF error |
| 46 | 46 | // message |
| 47 | -$eventSource->send('success', (string)$l->t('Preparing update')); |
|
| 47 | +$eventSource->send('success', (string) $l->t('Preparing update')); |
|
| 48 | 48 | |
| 49 | 49 | class FeedBackHandler { |
| 50 | 50 | /** @var integer */ |
@@ -80,21 +80,21 @@ discard block |
||
| 80 | 80 | if (empty($desc)) { |
| 81 | 81 | $desc = $this->currentStep; |
| 82 | 82 | } |
| 83 | - $this->eventSource->send('success', (string)$this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $desc])); |
|
| 83 | + $this->eventSource->send('success', (string) $this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $desc])); |
|
| 84 | 84 | break; |
| 85 | 85 | case '\OC\Repair::finishProgress': |
| 86 | 86 | $this->progressStateMax = $this->progressStateStep; |
| 87 | - $this->eventSource->send('success', (string)$this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $this->currentStep])); |
|
| 87 | + $this->eventSource->send('success', (string) $this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $this->currentStep])); |
|
| 88 | 88 | break; |
| 89 | 89 | case '\OC\Repair::step': |
| 90 | 90 | break; |
| 91 | 91 | case '\OC\Repair::info': |
| 92 | 92 | break; |
| 93 | 93 | case '\OC\Repair::warning': |
| 94 | - $this->eventSource->send('notice', (string)$this->l10n->t('Repair warning: ') . $event->getArgument(0)); |
|
| 94 | + $this->eventSource->send('notice', (string) $this->l10n->t('Repair warning: ').$event->getArgument(0)); |
|
| 95 | 95 | break; |
| 96 | 96 | case '\OC\Repair::error': |
| 97 | - $this->eventSource->send('notice', (string)$this->l10n->t('Repair error: ') . $event->getArgument(0)); |
|
| 97 | + $this->eventSource->send('notice', (string) $this->l10n->t('Repair error: ').$event->getArgument(0)); |
|
| 98 | 98 | break; |
| 99 | 99 | } |
| 100 | 100 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | $config = \OC::$server->getSystemConfig(); |
| 106 | 106 | if ($config->getValue('upgrade.disable-web', false)) { |
| 107 | - $eventSource->send('failure', (string)$l->t('Please use the command line updater because automatic updating is disabled in the config.php.')); |
|
| 107 | + $eventSource->send('failure', (string) $l->t('Please use the command line updater because automatic updating is disabled in the config.php.')); |
|
| 108 | 108 | $eventSource->close(); |
| 109 | 109 | exit(); |
| 110 | 110 | } |
@@ -126,12 +126,12 @@ discard block |
||
| 126 | 126 | $dispatcher = \OC::$server->getEventDispatcher(); |
| 127 | 127 | $dispatcher->addListener('\OC\DB\Migrator::executeSql', function($event) use ($eventSource, $l) { |
| 128 | 128 | if ($event instanceof GenericEvent) { |
| 129 | - $eventSource->send('success', (string)$l->t('[%d / %d]: %s', [$event[0], $event[1], $event->getSubject()])); |
|
| 129 | + $eventSource->send('success', (string) $l->t('[%d / %d]: %s', [$event[0], $event[1], $event->getSubject()])); |
|
| 130 | 130 | } |
| 131 | 131 | }); |
| 132 | 132 | $dispatcher->addListener('\OC\DB\Migrator::checkTable', function($event) use ($eventSource, $l) { |
| 133 | 133 | if ($event instanceof GenericEvent) { |
| 134 | - $eventSource->send('success', (string)$l->t('[%d / %d]: Checking table %s', [$event[0], $event[1], $event->getSubject()])); |
|
| 134 | + $eventSource->send('success', (string) $l->t('[%d / %d]: Checking table %s', [$event[0], $event[1], $event->getSubject()])); |
|
| 135 | 135 | } |
| 136 | 136 | }); |
| 137 | 137 | $feedBack = new FeedBackHandler($eventSource, $l); |
@@ -143,67 +143,67 @@ discard block |
||
| 143 | 143 | $dispatcher->addListener('\OC\Repair::warning', [$feedBack, 'handleRepairFeedback']); |
| 144 | 144 | $dispatcher->addListener('\OC\Repair::error', [$feedBack, 'handleRepairFeedback']); |
| 145 | 145 | |
| 146 | - $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use ($eventSource, $l) { |
|
| 147 | - $eventSource->send('success', (string)$l->t('Turned on maintenance mode')); |
|
| 146 | + $updater->listen('\OC\Updater', 'maintenanceEnabled', function() use ($eventSource, $l) { |
|
| 147 | + $eventSource->send('success', (string) $l->t('Turned on maintenance mode')); |
|
| 148 | 148 | }); |
| 149 | - $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use ($eventSource, $l) { |
|
| 150 | - $eventSource->send('success', (string)$l->t('Turned off maintenance mode')); |
|
| 149 | + $updater->listen('\OC\Updater', 'maintenanceDisabled', function() use ($eventSource, $l) { |
|
| 150 | + $eventSource->send('success', (string) $l->t('Turned off maintenance mode')); |
|
| 151 | 151 | }); |
| 152 | - $updater->listen('\OC\Updater', 'maintenanceActive', function () use ($eventSource, $l) { |
|
| 153 | - $eventSource->send('success', (string)$l->t('Maintenance mode is kept active')); |
|
| 152 | + $updater->listen('\OC\Updater', 'maintenanceActive', function() use ($eventSource, $l) { |
|
| 153 | + $eventSource->send('success', (string) $l->t('Maintenance mode is kept active')); |
|
| 154 | 154 | }); |
| 155 | - $updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use($eventSource, $l) { |
|
| 156 | - $eventSource->send('success', (string)$l->t('Updating database schema')); |
|
| 155 | + $updater->listen('\OC\Updater', 'dbUpgradeBefore', function() use($eventSource, $l) { |
|
| 156 | + $eventSource->send('success', (string) $l->t('Updating database schema')); |
|
| 157 | 157 | }); |
| 158 | - $updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) { |
|
| 159 | - $eventSource->send('success', (string)$l->t('Updated database')); |
|
| 158 | + $updater->listen('\OC\Updater', 'dbUpgrade', function() use ($eventSource, $l) { |
|
| 159 | + $eventSource->send('success', (string) $l->t('Updated database')); |
|
| 160 | 160 | }); |
| 161 | - $updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function () use($eventSource, $l) { |
|
| 162 | - $eventSource->send('success', (string)$l->t('Checking whether the database schema can be updated (this can take a long time depending on the database size)')); |
|
| 161 | + $updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function() use($eventSource, $l) { |
|
| 162 | + $eventSource->send('success', (string) $l->t('Checking whether the database schema can be updated (this can take a long time depending on the database size)')); |
|
| 163 | 163 | }); |
| 164 | - $updater->listen('\OC\Updater', 'dbSimulateUpgrade', function () use ($eventSource, $l) { |
|
| 165 | - $eventSource->send('success', (string)$l->t('Checked database schema update')); |
|
| 164 | + $updater->listen('\OC\Updater', 'dbSimulateUpgrade', function() use ($eventSource, $l) { |
|
| 165 | + $eventSource->send('success', (string) $l->t('Checked database schema update')); |
|
| 166 | 166 | }); |
| 167 | - $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($eventSource, $l) { |
|
| 168 | - $eventSource->send('success', (string)$l->t('Checking updates of apps')); |
|
| 167 | + $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function() use ($eventSource, $l) { |
|
| 168 | + $eventSource->send('success', (string) $l->t('Checking updates of apps')); |
|
| 169 | 169 | }); |
| 170 | - $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($eventSource, $l) { |
|
| 171 | - $eventSource->send('success', (string)$l->t('Checking for update of app "%s" in appstore', [$app])); |
|
| 170 | + $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function($app) use ($eventSource, $l) { |
|
| 171 | + $eventSource->send('success', (string) $l->t('Checking for update of app "%s" in appstore', [$app])); |
|
| 172 | 172 | }); |
| 173 | - $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($eventSource, $l) { |
|
| 174 | - $eventSource->send('success', (string)$l->t('Update app "%s" from appstore', [$app])); |
|
| 173 | + $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function($app) use ($eventSource, $l) { |
|
| 174 | + $eventSource->send('success', (string) $l->t('Update app "%s" from appstore', [$app])); |
|
| 175 | 175 | }); |
| 176 | - $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($eventSource, $l) { |
|
| 177 | - $eventSource->send('success', (string)$l->t('Checked for update of app "%s" in appstore', [$app])); |
|
| 176 | + $updater->listen('\OC\Updater', 'checkAppStoreApp', function($app) use ($eventSource, $l) { |
|
| 177 | + $eventSource->send('success', (string) $l->t('Checked for update of app "%s" in appstore', [$app])); |
|
| 178 | 178 | }); |
| 179 | - $updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($eventSource, $l) { |
|
| 180 | - $eventSource->send('success', (string)$l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app])); |
|
| 179 | + $updater->listen('\OC\Updater', 'appSimulateUpdate', function($app) use ($eventSource, $l) { |
|
| 180 | + $eventSource->send('success', (string) $l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app])); |
|
| 181 | 181 | }); |
| 182 | - $updater->listen('\OC\Updater', 'appUpgradeCheck', function () use ($eventSource, $l) { |
|
| 183 | - $eventSource->send('success', (string)$l->t('Checked database schema update for apps')); |
|
| 182 | + $updater->listen('\OC\Updater', 'appUpgradeCheck', function() use ($eventSource, $l) { |
|
| 183 | + $eventSource->send('success', (string) $l->t('Checked database schema update for apps')); |
|
| 184 | 184 | }); |
| 185 | - $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($eventSource, $l) { |
|
| 186 | - $eventSource->send('success', (string)$l->t('Updated "%s" to %s', array($app, $version))); |
|
| 185 | + $updater->listen('\OC\Updater', 'appUpgrade', function($app, $version) use ($eventSource, $l) { |
|
| 186 | + $eventSource->send('success', (string) $l->t('Updated "%s" to %s', array($app, $version))); |
|
| 187 | 187 | }); |
| 188 | - $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use (&$incompatibleApps) { |
|
| 189 | - $incompatibleApps[]= $app; |
|
| 188 | + $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function($app) use (&$incompatibleApps) { |
|
| 189 | + $incompatibleApps[] = $app; |
|
| 190 | 190 | }); |
| 191 | - $updater->listen('\OC\Updater', 'failure', function ($message) use ($eventSource, $config) { |
|
| 191 | + $updater->listen('\OC\Updater', 'failure', function($message) use ($eventSource, $config) { |
|
| 192 | 192 | $eventSource->send('failure', $message); |
| 193 | 193 | $eventSource->close(); |
| 194 | 194 | $config->setSystemValue('maintenance', false); |
| 195 | 195 | }); |
| 196 | - $updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use($eventSource, $l) { |
|
| 197 | - $eventSource->send('success', (string)$l->t('Set log level to debug')); |
|
| 196 | + $updater->listen('\OC\Updater', 'setDebugLogLevel', function($logLevel, $logLevelName) use($eventSource, $l) { |
|
| 197 | + $eventSource->send('success', (string) $l->t('Set log level to debug')); |
|
| 198 | 198 | }); |
| 199 | - $updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use($eventSource, $l) { |
|
| 200 | - $eventSource->send('success', (string)$l->t('Reset log level')); |
|
| 199 | + $updater->listen('\OC\Updater', 'resetLogLevel', function($logLevel, $logLevelName) use($eventSource, $l) { |
|
| 200 | + $eventSource->send('success', (string) $l->t('Reset log level')); |
|
| 201 | 201 | }); |
| 202 | - $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use($eventSource, $l) { |
|
| 203 | - $eventSource->send('success', (string)$l->t('Starting code integrity check')); |
|
| 202 | + $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function() use($eventSource, $l) { |
|
| 203 | + $eventSource->send('success', (string) $l->t('Starting code integrity check')); |
|
| 204 | 204 | }); |
| 205 | - $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use($eventSource, $l) { |
|
| 206 | - $eventSource->send('success', (string)$l->t('Finished code integrity check')); |
|
| 205 | + $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function() use($eventSource, $l) { |
|
| 206 | + $eventSource->send('success', (string) $l->t('Finished code integrity check')); |
|
| 207 | 207 | }); |
| 208 | 208 | |
| 209 | 209 | try { |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | 'level' => ILogger::ERROR, |
| 214 | 214 | 'app' => 'update', |
| 215 | 215 | ]); |
| 216 | - $eventSource->send('failure', get_class($e) . ': ' . $e->getMessage()); |
|
| 216 | + $eventSource->send('failure', get_class($e).': '.$e->getMessage()); |
|
| 217 | 217 | $eventSource->close(); |
| 218 | 218 | exit(); |
| 219 | 219 | } |
@@ -225,10 +225,10 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | if (!empty($disabledApps)) { |
| 227 | 227 | $eventSource->send('notice', |
| 228 | - (string)$l->t('Following apps have been disabled: %s', [implode(', ', $disabledApps)])); |
|
| 228 | + (string) $l->t('Following apps have been disabled: %s', [implode(', ', $disabledApps)])); |
|
| 229 | 229 | } |
| 230 | 230 | } else { |
| 231 | - $eventSource->send('notice', (string)$l->t('Already up to date')); |
|
| 231 | + $eventSource->send('notice', (string) $l->t('Already up to date')); |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | $eventSource->send('done', ''); |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | $post['dbpass'] = $post['dbpassword']; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if(isset($post['install']) AND $post['install']=='true') { |
|
| 65 | + if (isset($post['install']) AND $post['install'] == 'true') { |
|
| 66 | 66 | // We have to launch the installation process : |
| 67 | 67 | $e = $this->setupHelper->install($post); |
| 68 | 68 | $errors = array('errors' => $e); |
| 69 | 69 | |
| 70 | - if(count($e) > 0) { |
|
| 70 | + if (count($e) > 0) { |
|
| 71 | 71 | $options = array_merge($opts, $post, $errors); |
| 72 | 72 | $this->display($options); |
| 73 | 73 | } else { |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | public function finishSetup() { |
| 102 | - if( file_exists( $this->autoConfigFile )) { |
|
| 102 | + if (file_exists($this->autoConfigFile)) { |
|
| 103 | 103 | unlink($this->autoConfigFile); |
| 104 | 104 | } |
| 105 | 105 | \OC::$server->getIntegrityCodeChecker()->runInstanceVerification(); |
@@ -107,11 +107,11 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | public function loadAutoConfig($post) { |
| 110 | - if( file_exists($this->autoConfigFile)) { |
|
| 110 | + if (file_exists($this->autoConfigFile)) { |
|
| 111 | 111 | \OCP\Util::writeLog('core', 'Autoconfig file found, setting up ownCloud…', ILogger::INFO); |
| 112 | 112 | $AUTOCONFIG = array(); |
| 113 | 113 | include $this->autoConfigFile; |
| 114 | - $post = array_merge ($post, $AUTOCONFIG); |
|
| 114 | + $post = array_merge($post, $AUTOCONFIG); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $dbIsSet = isset($post['dbtype']); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $folder = isset($_POST['dir']) ? $_POST['dir'] : '/'; |
| 35 | 35 | |
| 36 | 36 | // "empty trash" command |
| 37 | -if (isset($_POST['allfiles']) && (string)$_POST['allfiles'] === 'true'){ |
|
| 37 | +if (isset($_POST['allfiles']) && (string) $_POST['allfiles'] === 'true') { |
|
| 38 | 38 | $deleteAll = true; |
| 39 | 39 | if ($folder === '/' || $folder === '') { |
| 40 | 40 | OCA\Files_Trashbin\Trashbin::deleteAll(); |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | else { |
| 48 | 48 | $deleteAll = false; |
| 49 | - $files = (string)$_POST['files']; |
|
| 49 | + $files = (string) $_POST['files']; |
|
| 50 | 50 | $list = json_decode($files); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | -$folder = rtrim($folder, '/') . '/'; |
|
| 53 | +$folder = rtrim($folder, '/').'/'; |
|
| 54 | 54 | $error = array(); |
| 55 | 55 | $success = array(); |
| 56 | 56 | |
@@ -60,16 +60,16 @@ discard block |
||
| 60 | 60 | $file = ltrim($file, '/'); |
| 61 | 61 | $delimiter = strrpos($file, '.d'); |
| 62 | 62 | $filename = substr($file, 0, $delimiter); |
| 63 | - $timestamp = substr($file, $delimiter+2); |
|
| 63 | + $timestamp = substr($file, $delimiter + 2); |
|
| 64 | 64 | } else { |
| 65 | - $filename = $folder . '/' . $file; |
|
| 65 | + $filename = $folder.'/'.$file; |
|
| 66 | 66 | $timestamp = null; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | OCA\Files_Trashbin\Trashbin::delete($filename, \OCP\User::getUser(), $timestamp); |
| 70 | 70 | if (OCA\Files_Trashbin\Trashbin::file_exists($filename, $timestamp)) { |
| 71 | 71 | $error[] = $filename; |
| 72 | - \OCP\Util::writeLog('trashbin','can\'t delete ' . $filename . ' permanently.', ILogger::ERROR); |
|
| 72 | + \OCP\Util::writeLog('trashbin', 'can\'t delete '.$filename.' permanently.', ILogger::ERROR); |
|
| 73 | 73 | } |
| 74 | 74 | // only list deleted files if not deleting everything |
| 75 | 75 | else if (!$deleteAll) { |
@@ -79,9 +79,9 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | -if ( $error ) { |
|
| 82 | +if ($error) { |
|
| 83 | 83 | $filelist = ''; |
| 84 | - foreach ( $error as $e ) { |
|
| 84 | + foreach ($error as $e) { |
|
| 85 | 85 | $filelist .= $e.', '; |
| 86 | 86 | } |
| 87 | 87 | $l = \OC::$server->getL10N('files_trashbin'); |
@@ -35,10 +35,10 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | $dir = '/'; |
| 37 | 37 | if (isset($_POST['dir'])) { |
| 38 | - $dir = rtrim((string)$_POST['dir'], '/'). '/'; |
|
| 38 | + $dir = rtrim((string) $_POST['dir'], '/').'/'; |
|
| 39 | 39 | } |
| 40 | 40 | $allFiles = false; |
| 41 | -if (isset($_POST['allfiles']) && (string)$_POST['allfiles'] === 'true') { |
|
| 41 | +if (isset($_POST['allfiles']) && (string) $_POST['allfiles'] === 'true') { |
|
| 42 | 42 | $allFiles = true; |
| 43 | 43 | $list = array(); |
| 44 | 44 | $dirListing = true; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | foreach (OCA\Files_Trashbin\Helper::getTrashFiles($dir, \OCP\User::getUser()) as $file) { |
| 49 | 49 | $fileName = $file['name']; |
| 50 | 50 | if (!$dirListing) { |
| 51 | - $fileName .= '.d' . $file['mtime']; |
|
| 51 | + $fileName .= '.d'.$file['mtime']; |
|
| 52 | 52 | } |
| 53 | 53 | $list[] = $fileName; |
| 54 | 54 | } |
@@ -61,21 +61,21 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | $i = 0; |
| 63 | 63 | foreach ($list as $file) { |
| 64 | - $path = $dir . '/' . $file; |
|
| 64 | + $path = $dir.'/'.$file; |
|
| 65 | 65 | if ($dir === '/') { |
| 66 | 66 | $file = ltrim($file, '/'); |
| 67 | 67 | $delimiter = strrpos($file, '.d'); |
| 68 | 68 | $filename = substr($file, 0, $delimiter); |
| 69 | - $timestamp = substr($file, $delimiter+2); |
|
| 69 | + $timestamp = substr($file, $delimiter + 2); |
|
| 70 | 70 | } else { |
| 71 | 71 | $path_parts = pathinfo($file); |
| 72 | 72 | $filename = $path_parts['basename']; |
| 73 | 73 | $timestamp = null; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if ( !OCA\Files_Trashbin\Trashbin::restore($path, $filename, $timestamp) ) { |
|
| 76 | + if (!OCA\Files_Trashbin\Trashbin::restore($path, $filename, $timestamp)) { |
|
| 77 | 77 | $error[] = $filename; |
| 78 | - \OCP\Util::writeLog('trashbin', 'can\'t restore ' . $filename, ILogger::ERROR); |
|
| 78 | + \OCP\Util::writeLog('trashbin', 'can\'t restore '.$filename, ILogger::ERROR); |
|
| 79 | 79 | } else { |
| 80 | 80 | $success[$i]['filename'] = $file; |
| 81 | 81 | $success[$i]['timestamp'] = $timestamp; |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | -if ( $error ) { |
|
| 87 | +if ($error) { |
|
| 88 | 88 | $filelist = ''; |
| 89 | - foreach ( $error as $e ) { |
|
| 89 | + foreach ($error as $e) { |
|
| 90 | 90 | $filelist .= $e.', '; |
| 91 | 91 | } |
| 92 | 92 | $l = OC::$server->getL10N('files_trashbin'); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | // Admin? Or SubAdmin? |
| 127 | 127 | $uid = $user->getUID(); |
| 128 | 128 | $subAdminManager = $this->groupManager->getSubAdmin(); |
| 129 | - if ($this->groupManager->isAdmin($uid)){ |
|
| 129 | + if ($this->groupManager->isAdmin($uid)) { |
|
| 130 | 130 | $users = $this->userManager->search($search, $limit, $offset); |
| 131 | 131 | } else if ($subAdminManager->isSubAdmin($user)) { |
| 132 | 132 | $subAdminOfGroups = $subAdminManager->getSubAdminsGroups($user); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | // Admin? Or SubAdmin? |
| 160 | 160 | $uid = $user->getUID(); |
| 161 | 161 | $subAdminManager = $this->groupManager->getSubAdmin(); |
| 162 | - if ($this->groupManager->isAdmin($uid)){ |
|
| 162 | + if ($this->groupManager->isAdmin($uid)) { |
|
| 163 | 163 | $users = $this->userManager->search($search, $limit, $offset); |
| 164 | 164 | } else if ($subAdminManager->isSubAdmin($user)) { |
| 165 | 165 | $subAdminOfGroups = $subAdminManager->getSubAdminsGroups($user); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | throw new OCSException('group '.$group.' does not exist', 104); |
| 225 | 225 | } |
| 226 | 226 | if (!$isAdmin && !$subAdminManager->isSubAdminOfGroup($user, $this->groupManager->get($group))) { |
| 227 | - throw new OCSException('insufficient privileges for group '. $group, 105); |
|
| 227 | + throw new OCSException('insufficient privileges for group '.$group, 105); |
|
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | } else { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | $group = $this->groupManager->get($groupid); |
| 240 | 240 | // Check if group exists |
| 241 | 241 | if ($group === null) { |
| 242 | - throw new OCSException('Subadmin group does not exist', 102); |
|
| 242 | + throw new OCSException('Subadmin group does not exist', 102); |
|
| 243 | 243 | } |
| 244 | 244 | // Check if trying to make subadmin of admin group |
| 245 | 245 | if ($group->getGID() === 'admin') { |
@@ -267,11 +267,11 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | try { |
| 269 | 269 | $newUser = $this->userManager->createUser($userid, $password); |
| 270 | - $this->logger->info('Successful addUser call with userid: ' . $userid, ['app' => 'ocs_api']); |
|
| 270 | + $this->logger->info('Successful addUser call with userid: '.$userid, ['app' => 'ocs_api']); |
|
| 271 | 271 | |
| 272 | 272 | foreach ($groups as $group) { |
| 273 | 273 | $this->groupManager->get($group)->addUser($newUser); |
| 274 | - $this->logger->info('Added userid ' . $userid . ' to group ' . $group, ['app' => 'ocs_api']); |
|
| 274 | + $this->logger->info('Added userid '.$userid.' to group '.$group, ['app' => 'ocs_api']); |
|
| 275 | 275 | } |
| 276 | 276 | foreach ($subadminGroups as $group) { |
| 277 | 277 | $subAdminManager->createSubAdmin($newUser, $group); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | |
| 304 | 304 | return new DataResponse(); |
| 305 | 305 | |
| 306 | - } catch (HintException $e ) { |
|
| 306 | + } catch (HintException $e) { |
|
| 307 | 307 | $this->logger->logException($e, [ |
| 308 | 308 | 'message' => 'Failed addUser attempt with hint exception.', |
| 309 | 309 | 'level' => ILogger::WARN, |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | public function getCurrentUser(): DataResponse { |
| 352 | 352 | $user = $this->userSession->getUser(); |
| 353 | 353 | if ($user) { |
| 354 | - $data = $this->getUserData($user->getUID()); |
|
| 354 | + $data = $this->getUserData($user->getUID()); |
|
| 355 | 355 | // rename "displayname" to "display-name" only for this call to keep |
| 356 | 356 | // the API stable. |
| 357 | 357 | $data['display-name'] = $data['displayname']; |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | throw new OCSException('', \OCP\API::RESPOND_UNAUTHORISED); |
| 468 | 468 | } |
| 469 | 469 | // Process the edit |
| 470 | - switch($key) { |
|
| 470 | + switch ($key) { |
|
| 471 | 471 | case 'display': |
| 472 | 472 | case AccountManager::PROPERTY_DISPLAYNAME: |
| 473 | 473 | $targetUser->setDisplayName($value); |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | } |
| 486 | 486 | if ($quota === 0) { |
| 487 | 487 | $quota = 'default'; |
| 488 | - }else if ($quota === -1) { |
|
| 488 | + } else if ($quota === -1) { |
|
| 489 | 489 | $quota = 'none'; |
| 490 | 490 | } else { |
| 491 | 491 | $quota = \OCP\Util::humanFileSize($quota); |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | } else if (!$this->groupManager->isAdmin($loggedInUser->getUID())) { |
| 735 | 735 | /** @var IGroup[] $subAdminGroups */ |
| 736 | 736 | $subAdminGroups = $subAdminManager->getSubAdminsGroups($loggedInUser); |
| 737 | - $subAdminGroups = array_map(function (IGroup $subAdminGroup) { |
|
| 737 | + $subAdminGroups = array_map(function(IGroup $subAdminGroup) { |
|
| 738 | 738 | return $subAdminGroup->getGID(); |
| 739 | 739 | }, $subAdminGroups); |
| 740 | 740 | $userGroups = $this->groupManager->getUserGroupIds($targetUser); |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | } |
| 772 | 772 | // Check if group exists |
| 773 | 773 | if ($group === null) { |
| 774 | - throw new OCSException('Group does not exist', 102); |
|
| 774 | + throw new OCSException('Group does not exist', 102); |
|
| 775 | 775 | } |
| 776 | 776 | // Check if trying to make subadmin of admin group |
| 777 | 777 | if ($group->getGID() === 'admin') { |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | $this->newUserMailHelper->setL10N($l10n); |
| 883 | 883 | $emailTemplate = $this->newUserMailHelper->generateTemplate($targetUser, false); |
| 884 | 884 | $this->newUserMailHelper->sendMail($targetUser, $emailTemplate); |
| 885 | - } catch(\Exception $e) { |
|
| 885 | + } catch (\Exception $e) { |
|
| 886 | 886 | $this->logger->logException($e, [ |
| 887 | 887 | 'message' => "Can't send new user mail to $email", |
| 888 | 888 | 'level' => ILogger::ERROR, |
@@ -164,12 +164,12 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | $user = $params['user']; |
| 167 | - $this->id = 'swift::' . $user . md5($params['bucket']); |
|
| 167 | + $this->id = 'swift::'.$user.md5($params['bucket']); |
|
| 168 | 168 | |
| 169 | 169 | $bucketUrl = new Uri($params['bucket']); |
| 170 | 170 | if ($bucketUrl->getHost()) { |
| 171 | 171 | $params['bucket'] = basename($bucketUrl->getPath()); |
| 172 | - $params['endpoint_url'] = (string)$bucketUrl->withPath(dirname($bucketUrl->getPath())); |
|
| 172 | + $params['endpoint_url'] = (string) $bucketUrl->withPath(dirname($bucketUrl->getPath())); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | if (empty($params['url'])) { |
@@ -258,16 +258,16 @@ discard block |
||
| 258 | 258 | continue; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - if ($this->is_dir($path . '/' . $file)) { |
|
| 262 | - $this->rmdir($path . '/' . $file); |
|
| 261 | + if ($this->is_dir($path.'/'.$file)) { |
|
| 262 | + $this->rmdir($path.'/'.$file); |
|
| 263 | 263 | } else { |
| 264 | - $this->unlink($path . '/' . $file); |
|
| 264 | + $this->unlink($path.'/'.$file); |
|
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | try { |
| 269 | - $this->objectStore->deleteObject($path . '/'); |
|
| 270 | - $this->objectCache->remove($path . '/'); |
|
| 269 | + $this->objectStore->deleteObject($path.'/'); |
|
| 270 | + $this->objectCache->remove($path.'/'); |
|
| 271 | 271 | } catch (BadResponseError $e) { |
| 272 | 272 | \OC::$server->getLogger()->logException($e, [ |
| 273 | 273 | 'level' => ILogger::ERROR, |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | $stat = array(); |
| 353 | - $stat['size'] = (int)$object->contentLength; |
|
| 353 | + $stat['size'] = (int) $object->contentLength; |
|
| 354 | 354 | $stat['mtime'] = $mtime; |
| 355 | 355 | $stat['atime'] = time(); |
| 356 | 356 | return $stat; |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | try { |
| 383 | 383 | $this->objectStore->deleteObject($path); |
| 384 | 384 | $this->objectCache->remove($path); |
| 385 | - $this->objectCache->remove($path . '/'); |
|
| 385 | + $this->objectCache->remove($path.'/'); |
|
| 386 | 386 | } catch (BadResponseError $e) { |
| 387 | 387 | if ($e->getResponse()->getStatusCode() !== 404) { |
| 388 | 388 | \OC::$server->getLogger()->logException($e, [ |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | file_put_contents($tmpFile, $source); |
| 441 | 441 | } |
| 442 | 442 | $handle = fopen($tmpFile, $mode); |
| 443 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
| 443 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
| 444 | 444 | $this->writeBack($tmpFile, $path); |
| 445 | 445 | }); |
| 446 | 446 | } |
@@ -490,11 +490,11 @@ discard block |
||
| 490 | 490 | try { |
| 491 | 491 | $source = $this->fetchObject($path1); |
| 492 | 492 | $source->copy([ |
| 493 | - 'destination' => $this->bucket . '/' . $path2 |
|
| 493 | + 'destination' => $this->bucket.'/'.$path2 |
|
| 494 | 494 | ]); |
| 495 | 495 | // invalidate target object to force repopulation on fetch |
| 496 | 496 | $this->objectCache->remove($path2); |
| 497 | - $this->objectCache->remove($path2 . '/'); |
|
| 497 | + $this->objectCache->remove($path2.'/'); |
|
| 498 | 498 | } catch (BadResponseError $e) { |
| 499 | 499 | \OC::$server->getLogger()->logException($e, [ |
| 500 | 500 | 'level' => ILogger::ERROR, |
@@ -505,13 +505,13 @@ discard block |
||
| 505 | 505 | |
| 506 | 506 | } else if ($fileType === 'dir') { |
| 507 | 507 | try { |
| 508 | - $source = $this->fetchObject($path1 . '/'); |
|
| 508 | + $source = $this->fetchObject($path1.'/'); |
|
| 509 | 509 | $source->copy([ |
| 510 | - 'destination' => $this->bucket . '/' . $path2 . '/' |
|
| 510 | + 'destination' => $this->bucket.'/'.$path2.'/' |
|
| 511 | 511 | ]); |
| 512 | 512 | // invalidate target object to force repopulation on fetch |
| 513 | 513 | $this->objectCache->remove($path2); |
| 514 | - $this->objectCache->remove($path2 . '/'); |
|
| 514 | + $this->objectCache->remove($path2.'/'); |
|
| 515 | 515 | } catch (BadResponseError $e) { |
| 516 | 516 | \OC::$server->getLogger()->logException($e, [ |
| 517 | 517 | 'level' => ILogger::ERROR, |
@@ -526,8 +526,8 @@ discard block |
||
| 526 | 526 | continue; |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | - $source = $path1 . '/' . $file; |
|
| 530 | - $target = $path2 . '/' . $file; |
|
| 529 | + $source = $path1.'/'.$file; |
|
| 530 | + $target = $path2.'/'.$file; |
|
| 531 | 531 | $this->copy($source, $target); |
| 532 | 532 | } |
| 533 | 533 | |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | $path = ''; |
| 609 | 609 | } |
| 610 | 610 | $cachedContent = $this->getCache()->getFolderContents($path); |
| 611 | - $cachedNames = array_map(function ($content) { |
|
| 611 | + $cachedNames = array_map(function($content) { |
|
| 612 | 612 | return $content['name']; |
| 613 | 613 | }, $cachedContent); |
| 614 | 614 | sort($cachedNames); |