@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | <meta charset="utf-8"> |
5 | 5 | <title> |
6 | 6 | <?php |
7 | - p(!empty($_['application'])?$_['application'].' - ':''); |
|
7 | + p(!empty($_['application']) ? $_['application'].' - ' : ''); |
|
8 | 8 | p($theme->getTitle()); |
9 | 9 | ?> |
10 | 10 | </title> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | <meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>"> |
15 | 15 | <meta name="apple-mobile-web-app-capable" content="yes"> |
16 | 16 | <meta name="apple-mobile-web-app-status-bar-style" content="black"> |
17 | - <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid']!='files')? $_['application']:$theme->getTitle()); ?>"> |
|
17 | + <meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid'] != 'files') ? $_['application'] : $theme->getTitle()); ?>"> |
|
18 | 18 | <meta name="mobile-web-app-capable" content="yes"> |
19 | 19 | <meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>"> |
20 | 20 | <link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>"> |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | <?php emit_script_loading_tags($_); ?> |
26 | 26 | <?php print_unescaped($_['headers']); ?> |
27 | 27 | </head> |
28 | - <body id="<?php p($_['bodyid']);?>"> |
|
28 | + <body id="<?php p($_['bodyid']); ?>"> |
|
29 | 29 | <?php include 'layout.noscript.warning.php'; ?> |
30 | 30 | |
31 | 31 | <a href="#app-content" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | id="nextcloud"> |
41 | 41 | <div class="logo logo-icon"> |
42 | 42 | <h1 class="hidden-visually"> |
43 | - <?php p($theme->getName()); ?> <?php p(!empty($_['application'])?$_['application']: $l->t('Apps')); ?> |
|
43 | + <?php p($theme->getName()); ?> <?php p(!empty($_['application']) ? $_['application'] : $l->t('Apps')); ?> |
|
44 | 44 | </h1> |
45 | 45 | </div> |
46 | 46 | </a> |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | <?php if ($_['themingInvertMenu']) { ?> |
56 | 56 | <defs><filter id="invertMenuMain-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter></defs> |
57 | 57 | <?php } ?> |
58 | - <image x="0" y="0" width="20" height="20" preserveAspectRatio="xMinYMin meet"<?php if ($_['themingInvertMenu']) { ?> filter="url(#invertMenuMain-<?php p($entry['id']); ?>)"<?php } ?> xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" class="app-icon" /> |
|
58 | + <image x="0" y="0" width="20" height="20" preserveAspectRatio="xMinYMin meet"<?php if ($_['themingInvertMenu']) { ?> filter="url(#invertMenuMain-<?php p($entry['id']); ?>)"<?php } ?> xlink:href="<?php print_unescaped($entry['icon'].'?v='.$_['versionHash']); ?>" class="app-icon" /> |
|
59 | 59 | </svg> |
60 | 60 | <div class="icon-loading-small-dark" |
61 | 61 | style="display:none;"></div> |
@@ -78,14 +78,14 @@ discard block |
||
78 | 78 | <div id="navigation" style="display: none;" aria-label="<?php p($l->t('More apps menu')); ?>"> |
79 | 79 | <div id="apps"> |
80 | 80 | <ul> |
81 | - <?php foreach($_['navigation'] as $entry): ?> |
|
81 | + <?php foreach ($_['navigation'] as $entry): ?> |
|
82 | 82 | <li data-id="<?php p($entry['id']); ?>"> |
83 | 83 | <a href="<?php print_unescaped($entry['href']); ?>" |
84 | - <?php if( $entry['active'] ): ?> class="active"<?php endif; ?> |
|
84 | + <?php if ($entry['active']): ?> class="active"<?php endif; ?> |
|
85 | 85 | aria-label="<?php p($entry['name']); ?>"> |
86 | 86 | <svg width="16" height="16" viewBox="0 0 16 16" alt=""> |
87 | 87 | <defs><filter id="invertMenuMore-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"></feColorMatrix></filter></defs> |
88 | - <image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invertMenuMore-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" class="app-icon"></image> |
|
88 | + <image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invertMenuMore-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'].'?v='.$_['versionHash']); ?>" class="app-icon"></image> |
|
89 | 89 | </svg> |
90 | 90 | <div class="icon-loading-small" style="display:none;"></div> |
91 | 91 | <span><?php p($entry['name']); ?></span> |
@@ -102,43 +102,43 @@ discard block |
||
102 | 102 | <div class="header-right"> |
103 | 103 | <form class="searchbox" action="#" method="post" role="search" novalidate> |
104 | 104 | <label for="searchbox" class="hidden-visually"> |
105 | - <?php p($l->t('Search'));?> |
|
105 | + <?php p($l->t('Search')); ?> |
|
106 | 106 | </label> |
107 | 107 | <input id="searchbox" type="search" name="query" |
108 | 108 | value="" required class="hidden icon-search-white" |
109 | 109 | autocomplete="off"> |
110 | - <button class="icon-close-white" type="reset"><span class="hidden-visually"><?php p($l->t('Reset search'));?></span></button> |
|
110 | + <button class="icon-close-white" type="reset"><span class="hidden-visually"><?php p($l->t('Reset search')); ?></span></button> |
|
111 | 111 | </form> |
112 | 112 | <div id="contactsmenu"> |
113 | 113 | <div class="icon-contacts menutoggle" tabindex="0" role="button" |
114 | 114 | aria-haspopup="true" aria-controls="contactsmenu-menu" aria-expanded="false"> |
115 | - <span class="hidden-visually"><?php p($l->t('Contacts'));?> |
|
115 | + <span class="hidden-visually"><?php p($l->t('Contacts')); ?> |
|
116 | 116 | </div> |
117 | 117 | <div id="contactsmenu-menu" class="menu" |
118 | - aria-label="<?php p($l->t('Contacts menu'));?>"></div> |
|
118 | + aria-label="<?php p($l->t('Contacts menu')); ?>"></div> |
|
119 | 119 | </div> |
120 | 120 | <div id="settings"> |
121 | 121 | <div id="expand" tabindex="0" role="button" class="menutoggle" |
122 | - aria-label="<?php p($l->t('Settings'));?>" |
|
122 | + aria-label="<?php p($l->t('Settings')); ?>" |
|
123 | 123 | aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false"> |
124 | 124 | <div class="avatardiv<?php if ($_['userAvatarSet']) { print_unescaped(' avatardiv-shown'); } else { print_unescaped('" style="display: none'); } ?>"> |
125 | 125 | <?php if ($_['userAvatarSet']): ?> |
126 | 126 | <img alt="" width="32" height="32" |
127 | - src="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 32, 'v' => $_['userAvatarVersion']]));?>" |
|
128 | - srcset="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 64, 'v' => $_['userAvatarVersion']]));?> 2x, <?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 128, 'v' => $_['userAvatarVersion']]));?> 4x" |
|
127 | + src="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 32, 'v' => $_['userAvatarVersion']])); ?>" |
|
128 | + srcset="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 64, 'v' => $_['userAvatarVersion']])); ?> 2x, <?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 128, 'v' => $_['userAvatarVersion']])); ?> 4x" |
|
129 | 129 | > |
130 | 130 | <?php endif; ?> |
131 | 131 | </div> |
132 | 132 | <div id="expandDisplayName" class="icon-settings-white"></div> |
133 | 133 | </div> |
134 | 134 | <nav id="expanddiv" style="display:none;" |
135 | - aria-label="<?php p($l->t('Settings menu'));?>"> |
|
135 | + aria-label="<?php p($l->t('Settings menu')); ?>"> |
|
136 | 136 | <ul> |
137 | - <?php foreach($_['settingsnavigation'] as $entry):?> |
|
137 | + <?php foreach ($_['settingsnavigation'] as $entry):?> |
|
138 | 138 | <li data-id="<?php p($entry['id']); ?>"> |
139 | 139 | <a href="<?php print_unescaped($entry['href']); ?>" |
140 | - <?php if( $entry["active"] ): ?> class="active"<?php endif; ?>> |
|
141 | - <img alt="" src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>"> |
|
140 | + <?php if ($entry["active"]): ?> class="active"<?php endif; ?>> |
|
141 | + <img alt="" src="<?php print_unescaped($entry['icon'].'?v='.$_['versionHash']); ?>"> |
|
142 | 142 | <?php p($entry['name']) ?> |
143 | 143 | </a> |
144 | 144 | </li> |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | // To find out if we are running from CLI or not |
175 | 175 | $this->registerParameter('isCLI', \OC::$CLI); |
176 | 176 | |
177 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
177 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
178 | 178 | return $c; |
179 | 179 | }); |
180 | 180 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
194 | 194 | |
195 | 195 | |
196 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
196 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
197 | 197 | return new PreviewManager( |
198 | 198 | $c->getConfig(), |
199 | 199 | $c->getRootFolder(), |
@@ -204,13 +204,13 @@ discard block |
||
204 | 204 | }); |
205 | 205 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
206 | 206 | |
207 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
207 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
208 | 208 | return new \OC\Preview\Watcher( |
209 | 209 | $c->getAppDataDir('preview') |
210 | 210 | ); |
211 | 211 | }); |
212 | 212 | |
213 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
213 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
214 | 214 | $view = new View(); |
215 | 215 | $util = new Encryption\Util( |
216 | 216 | $view, |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | ); |
229 | 229 | }); |
230 | 230 | |
231 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
231 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
232 | 232 | $util = new Encryption\Util( |
233 | 233 | new View(), |
234 | 234 | $c->getUserManager(), |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | ); |
243 | 243 | }); |
244 | 244 | |
245 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
245 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
246 | 246 | $view = new View(); |
247 | 247 | $util = new Encryption\Util( |
248 | 248 | $view, |
@@ -253,30 +253,30 @@ discard block |
||
253 | 253 | |
254 | 254 | return new Encryption\Keys\Storage($view, $util); |
255 | 255 | }); |
256 | - $this->registerService('TagMapper', function (Server $c) { |
|
256 | + $this->registerService('TagMapper', function(Server $c) { |
|
257 | 257 | return new TagMapper($c->getDatabaseConnection()); |
258 | 258 | }); |
259 | 259 | |
260 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
260 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
261 | 261 | $tagMapper = $c->query('TagMapper'); |
262 | 262 | return new TagManager($tagMapper, $c->getUserSession()); |
263 | 263 | }); |
264 | 264 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
265 | 265 | |
266 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
266 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
267 | 267 | $config = $c->getConfig(); |
268 | 268 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
269 | 269 | return new $factoryClass($this); |
270 | 270 | }); |
271 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
271 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
272 | 272 | return $c->query('SystemTagManagerFactory')->getManager(); |
273 | 273 | }); |
274 | 274 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
275 | 275 | |
276 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
276 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
277 | 277 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
278 | 278 | }); |
279 | - $this->registerService('RootFolder', function (Server $c) { |
|
279 | + $this->registerService('RootFolder', function(Server $c) { |
|
280 | 280 | $manager = \OC\Files\Filesystem::getMountManager(null); |
281 | 281 | $view = new View(); |
282 | 282 | $root = new Root( |
@@ -297,38 +297,38 @@ discard block |
||
297 | 297 | }); |
298 | 298 | $this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class); |
299 | 299 | |
300 | - $this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) { |
|
301 | - return new LazyRoot(function () use ($c) { |
|
300 | + $this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) { |
|
301 | + return new LazyRoot(function() use ($c) { |
|
302 | 302 | return $c->query('RootFolder'); |
303 | 303 | }); |
304 | 304 | }); |
305 | 305 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
306 | 306 | |
307 | - $this->registerService(\OC\User\Manager::class, function (Server $c) { |
|
307 | + $this->registerService(\OC\User\Manager::class, function(Server $c) { |
|
308 | 308 | $config = $c->getConfig(); |
309 | 309 | return new \OC\User\Manager($config); |
310 | 310 | }); |
311 | 311 | $this->registerAlias('UserManager', \OC\User\Manager::class); |
312 | 312 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
313 | 313 | |
314 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
314 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
315 | 315 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
316 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
316 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
317 | 317 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
318 | 318 | }); |
319 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
319 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
320 | 320 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
321 | 321 | }); |
322 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
322 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
323 | 323 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
324 | 324 | }); |
325 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
325 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
326 | 326 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
327 | 327 | }); |
328 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
328 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
329 | 329 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
330 | 330 | }); |
331 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
331 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
332 | 332 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
333 | 333 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
334 | 334 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | }); |
338 | 338 | $this->registerAlias('GroupManager', \OCP\IGroupManager::class); |
339 | 339 | |
340 | - $this->registerService(Store::class, function (Server $c) { |
|
340 | + $this->registerService(Store::class, function(Server $c) { |
|
341 | 341 | $session = $c->getSession(); |
342 | 342 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
343 | 343 | $tokenProvider = $c->query(IProvider::class); |
@@ -348,13 +348,13 @@ discard block |
||
348 | 348 | return new Store($session, $logger, $tokenProvider); |
349 | 349 | }); |
350 | 350 | $this->registerAlias(IStore::class, Store::class); |
351 | - $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { |
|
351 | + $this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) { |
|
352 | 352 | $dbConnection = $c->getDatabaseConnection(); |
353 | 353 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
354 | 354 | }); |
355 | 355 | $this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
356 | 356 | |
357 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
357 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
358 | 358 | $manager = $c->getUserManager(); |
359 | 359 | $session = new \OC\Session\Memory(''); |
360 | 360 | $timeFactory = new TimeFactory(); |
@@ -378,45 +378,45 @@ discard block |
||
378 | 378 | $c->getLockdownManager(), |
379 | 379 | $c->getLogger() |
380 | 380 | ); |
381 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
381 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
382 | 382 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
383 | 383 | }); |
384 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
384 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
385 | 385 | /** @var $user \OC\User\User */ |
386 | 386 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
387 | 387 | }); |
388 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) { |
|
388 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) { |
|
389 | 389 | /** @var $user \OC\User\User */ |
390 | 390 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
391 | 391 | $dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
392 | 392 | }); |
393 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
393 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
394 | 394 | /** @var $user \OC\User\User */ |
395 | 395 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
396 | 396 | }); |
397 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
397 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
398 | 398 | /** @var $user \OC\User\User */ |
399 | 399 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
400 | 400 | }); |
401 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
401 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
402 | 402 | /** @var $user \OC\User\User */ |
403 | 403 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
404 | 404 | }); |
405 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
405 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
406 | 406 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
407 | 407 | }); |
408 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
408 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
409 | 409 | /** @var $user \OC\User\User */ |
410 | 410 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
411 | 411 | }); |
412 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
412 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
413 | 413 | /** @var $user \OC\User\User */ |
414 | 414 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
415 | 415 | }); |
416 | - $userSession->listen('\OC\User', 'logout', function () { |
|
416 | + $userSession->listen('\OC\User', 'logout', function() { |
|
417 | 417 | \OC_Hook::emit('OC_User', 'logout', array()); |
418 | 418 | }); |
419 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
419 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
420 | 420 | /** @var $user \OC\User\User */ |
421 | 421 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
422 | 422 | $dispatcher->dispatch('OCP\IUser::changeUser', new GenericEvent($user, ['feature' => $feature, 'oldValue' => $oldValue, 'value' => $value])); |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
431 | 431 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
432 | 432 | |
433 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
433 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
434 | 434 | return new \OC\AllConfig( |
435 | 435 | $c->getSystemConfig() |
436 | 436 | ); |
@@ -438,17 +438,17 @@ discard block |
||
438 | 438 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
439 | 439 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
440 | 440 | |
441 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
441 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
442 | 442 | return new \OC\SystemConfig($config); |
443 | 443 | }); |
444 | 444 | |
445 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
445 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
446 | 446 | return new \OC\AppConfig($c->getDatabaseConnection()); |
447 | 447 | }); |
448 | 448 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
449 | 449 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
450 | 450 | |
451 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
451 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
452 | 452 | return new \OC\L10N\Factory( |
453 | 453 | $c->getConfig(), |
454 | 454 | $c->getRequest(), |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | }); |
459 | 459 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
460 | 460 | |
461 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
461 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
462 | 462 | $config = $c->getConfig(); |
463 | 463 | $cacheFactory = $c->getMemCacheFactory(); |
464 | 464 | $request = $c->getRequest(); |
@@ -473,12 +473,12 @@ discard block |
||
473 | 473 | $this->registerAlias('AppFetcher', AppFetcher::class); |
474 | 474 | $this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
475 | 475 | |
476 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
476 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
477 | 477 | return new Cache\File(); |
478 | 478 | }); |
479 | 479 | $this->registerAlias('UserCache', \OCP\ICache::class); |
480 | 480 | |
481 | - $this->registerService(Factory::class, function (Server $c) { |
|
481 | + $this->registerService(Factory::class, function(Server $c) { |
|
482 | 482 | |
483 | 483 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
484 | 484 | ArrayCache::class, |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | $version = implode(',', $v); |
496 | 496 | $instanceId = \OC_Util::getInstanceId(); |
497 | 497 | $path = \OC::$SERVERROOT; |
498 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
498 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
499 | 499 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
500 | 500 | $config->getSystemValue('memcache.local', null), |
501 | 501 | $config->getSystemValue('memcache.distributed', null), |
@@ -508,12 +508,12 @@ discard block |
||
508 | 508 | $this->registerAlias('MemCacheFactory', Factory::class); |
509 | 509 | $this->registerAlias(ICacheFactory::class, Factory::class); |
510 | 510 | |
511 | - $this->registerService('RedisFactory', function (Server $c) { |
|
511 | + $this->registerService('RedisFactory', function(Server $c) { |
|
512 | 512 | $systemConfig = $c->getSystemConfig(); |
513 | 513 | return new RedisFactory($systemConfig); |
514 | 514 | }); |
515 | 515 | |
516 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
516 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
517 | 517 | return new \OC\Activity\Manager( |
518 | 518 | $c->getRequest(), |
519 | 519 | $c->getUserSession(), |
@@ -523,14 +523,14 @@ discard block |
||
523 | 523 | }); |
524 | 524 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
525 | 525 | |
526 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
526 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
527 | 527 | return new \OC\Activity\EventMerger( |
528 | 528 | $c->getL10N('lib') |
529 | 529 | ); |
530 | 530 | }); |
531 | 531 | $this->registerAlias(IValidator::class, Validator::class); |
532 | 532 | |
533 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
533 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
534 | 534 | return new AvatarManager( |
535 | 535 | $c->query(\OC\User\Manager::class), |
536 | 536 | $c->getAppDataDir('avatar'), |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | |
544 | 544 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
545 | 545 | |
546 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
546 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
547 | 547 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
548 | 548 | $factory = new LogFactory($c, $this->getSystemConfig()); |
549 | 549 | $logger = $factory->get($logType); |
@@ -553,11 +553,11 @@ discard block |
||
553 | 553 | }); |
554 | 554 | $this->registerAlias('Logger', \OCP\ILogger::class); |
555 | 555 | |
556 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
556 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
557 | 557 | return new LogFactory($c, $this->getSystemConfig()); |
558 | 558 | }); |
559 | 559 | |
560 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
560 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
561 | 561 | $config = $c->getConfig(); |
562 | 562 | return new \OC\BackgroundJob\JobList( |
563 | 563 | $c->getDatabaseConnection(), |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | }); |
568 | 568 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
569 | 569 | |
570 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
570 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
571 | 571 | $cacheFactory = $c->getMemCacheFactory(); |
572 | 572 | $logger = $c->getLogger(); |
573 | 573 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -579,12 +579,12 @@ discard block |
||
579 | 579 | }); |
580 | 580 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
581 | 581 | |
582 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
582 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
583 | 583 | return new Search(); |
584 | 584 | }); |
585 | 585 | $this->registerAlias('Search', \OCP\ISearch::class); |
586 | 586 | |
587 | - $this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) { |
|
587 | + $this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) { |
|
588 | 588 | return new \OC\Security\RateLimiting\Limiter( |
589 | 589 | $this->getUserSession(), |
590 | 590 | $this->getRequest(), |
@@ -592,34 +592,34 @@ discard block |
||
592 | 592 | $c->query(\OC\Security\RateLimiting\Backend\IBackend::class) |
593 | 593 | ); |
594 | 594 | }); |
595 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
595 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
596 | 596 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
597 | 597 | $this->getMemCacheFactory(), |
598 | 598 | new \OC\AppFramework\Utility\TimeFactory() |
599 | 599 | ); |
600 | 600 | }); |
601 | 601 | |
602 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
602 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
603 | 603 | return new SecureRandom(); |
604 | 604 | }); |
605 | 605 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
606 | 606 | |
607 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
607 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
608 | 608 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
609 | 609 | }); |
610 | 610 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
611 | 611 | |
612 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
612 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
613 | 613 | return new Hasher($c->getConfig()); |
614 | 614 | }); |
615 | 615 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
616 | 616 | |
617 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
617 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
618 | 618 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
619 | 619 | }); |
620 | 620 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
621 | 621 | |
622 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
622 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
623 | 623 | $systemConfig = $c->getSystemConfig(); |
624 | 624 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
625 | 625 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
635 | 635 | |
636 | 636 | |
637 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
637 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
638 | 638 | $user = \OC_User::getUser(); |
639 | 639 | $uid = $user ? $user : null; |
640 | 640 | return new ClientService( |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | ); |
650 | 650 | }); |
651 | 651 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
652 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
652 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
653 | 653 | $eventLogger = new EventLogger(); |
654 | 654 | if ($c->getSystemConfig()->getValue('debug', false)) { |
655 | 655 | // In debug mode, module is being activated by default |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | }); |
660 | 660 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
661 | 661 | |
662 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
662 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
663 | 663 | $queryLogger = new QueryLogger(); |
664 | 664 | if ($c->getSystemConfig()->getValue('debug', false)) { |
665 | 665 | // In debug mode, module is being activated by default |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | }); |
670 | 670 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
671 | 671 | |
672 | - $this->registerService(TempManager::class, function (Server $c) { |
|
672 | + $this->registerService(TempManager::class, function(Server $c) { |
|
673 | 673 | return new TempManager( |
674 | 674 | $c->getLogger(), |
675 | 675 | $c->getConfig() |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | $this->registerAlias('TempManager', TempManager::class); |
679 | 679 | $this->registerAlias(ITempManager::class, TempManager::class); |
680 | 680 | |
681 | - $this->registerService(AppManager::class, function (Server $c) { |
|
681 | + $this->registerService(AppManager::class, function(Server $c) { |
|
682 | 682 | return new \OC\App\AppManager( |
683 | 683 | $c->getUserSession(), |
684 | 684 | $c->query(\OC\AppConfig::class), |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | $this->registerAlias('AppManager', AppManager::class); |
691 | 691 | $this->registerAlias(IAppManager::class, AppManager::class); |
692 | 692 | |
693 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
693 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
694 | 694 | return new DateTimeZone( |
695 | 695 | $c->getConfig(), |
696 | 696 | $c->getSession() |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | }); |
699 | 699 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
700 | 700 | |
701 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
701 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
702 | 702 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
703 | 703 | |
704 | 704 | return new DateTimeFormatter( |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | }); |
709 | 709 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
710 | 710 | |
711 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
711 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
712 | 712 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
713 | 713 | $listener = new UserMountCacheListener($mountCache); |
714 | 714 | $listener->listen($c->getUserManager()); |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | }); |
717 | 717 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
718 | 718 | |
719 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
719 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
720 | 720 | $loader = \OC\Files\Filesystem::getLoader(); |
721 | 721 | $mountCache = $c->query('UserMountCache'); |
722 | 722 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -732,10 +732,10 @@ discard block |
||
732 | 732 | }); |
733 | 733 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
734 | 734 | |
735 | - $this->registerService('IniWrapper', function ($c) { |
|
735 | + $this->registerService('IniWrapper', function($c) { |
|
736 | 736 | return new IniGetWrapper(); |
737 | 737 | }); |
738 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
738 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
739 | 739 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
740 | 740 | if ($busClass) { |
741 | 741 | list($app, $class) = explode('::', $busClass, 2); |
@@ -750,10 +750,10 @@ discard block |
||
750 | 750 | return new CronBus($jobList); |
751 | 751 | } |
752 | 752 | }); |
753 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
753 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
754 | 754 | return new TrustedDomainHelper($this->getConfig()); |
755 | 755 | }); |
756 | - $this->registerService('Throttler', function (Server $c) { |
|
756 | + $this->registerService('Throttler', function(Server $c) { |
|
757 | 757 | return new Throttler( |
758 | 758 | $c->getDatabaseConnection(), |
759 | 759 | new TimeFactory(), |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | $c->getConfig() |
762 | 762 | ); |
763 | 763 | }); |
764 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
764 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
765 | 765 | // IConfig and IAppManager requires a working database. This code |
766 | 766 | // might however be called when ownCloud is not yet setup. |
767 | 767 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | $c->getTempManager() |
783 | 783 | ); |
784 | 784 | }); |
785 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
785 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
786 | 786 | if (isset($this['urlParams'])) { |
787 | 787 | $urlParams = $this['urlParams']; |
788 | 788 | } else { |
@@ -818,7 +818,7 @@ discard block |
||
818 | 818 | }); |
819 | 819 | $this->registerAlias('Request', \OCP\IRequest::class); |
820 | 820 | |
821 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
821 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
822 | 822 | return new Mailer( |
823 | 823 | $c->getConfig(), |
824 | 824 | $c->getLogger(), |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | }); |
830 | 830 | $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
831 | 831 | |
832 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
832 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
833 | 833 | $config = $c->getConfig(); |
834 | 834 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
835 | 835 | if (is_null($factoryClass)) { |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | $factory = new $factoryClass($this); |
840 | 840 | return $factory->getLDAPProvider(); |
841 | 841 | }); |
842 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
842 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
843 | 843 | $ini = $c->getIniWrapper(); |
844 | 844 | $config = $c->getConfig(); |
845 | 845 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -862,49 +862,49 @@ discard block |
||
862 | 862 | }); |
863 | 863 | $this->registerAlias('LockingProvider', ILockingProvider::class); |
864 | 864 | |
865 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
865 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
866 | 866 | return new \OC\Files\Mount\Manager(); |
867 | 867 | }); |
868 | 868 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
869 | 869 | |
870 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
870 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
871 | 871 | return new \OC\Files\Type\Detection( |
872 | 872 | $c->getURLGenerator(), |
873 | 873 | \OC::$configDir, |
874 | - \OC::$SERVERROOT . '/resources/config/' |
|
874 | + \OC::$SERVERROOT.'/resources/config/' |
|
875 | 875 | ); |
876 | 876 | }); |
877 | 877 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
878 | 878 | |
879 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
879 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
880 | 880 | return new \OC\Files\Type\Loader( |
881 | 881 | $c->getDatabaseConnection() |
882 | 882 | ); |
883 | 883 | }); |
884 | 884 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
885 | - $this->registerService(BundleFetcher::class, function () { |
|
885 | + $this->registerService(BundleFetcher::class, function() { |
|
886 | 886 | return new BundleFetcher($this->getL10N('lib')); |
887 | 887 | }); |
888 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
888 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
889 | 889 | return new Manager( |
890 | 890 | $c->query(IValidator::class) |
891 | 891 | ); |
892 | 892 | }); |
893 | 893 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
894 | 894 | |
895 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
895 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
896 | 896 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
897 | - $manager->registerCapability(function () use ($c) { |
|
897 | + $manager->registerCapability(function() use ($c) { |
|
898 | 898 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
899 | 899 | }); |
900 | - $manager->registerCapability(function () use ($c) { |
|
900 | + $manager->registerCapability(function() use ($c) { |
|
901 | 901 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
902 | 902 | }); |
903 | 903 | return $manager; |
904 | 904 | }); |
905 | 905 | $this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
906 | 906 | |
907 | - $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
907 | + $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
908 | 908 | $config = $c->getConfig(); |
909 | 909 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
910 | 910 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
915 | 915 | $manager = $c->getUserManager(); |
916 | 916 | $user = $manager->get($id); |
917 | - if(is_null($user)) { |
|
917 | + if (is_null($user)) { |
|
918 | 918 | $l = $c->getL10N('core'); |
919 | 919 | $displayName = $l->t('Unknown user'); |
920 | 920 | } else { |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | }); |
928 | 928 | $this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
929 | 929 | |
930 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
930 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
931 | 931 | /* |
932 | 932 | * Dark magic for autoloader. |
933 | 933 | * If we do a class_exists it will try to load the class which will |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | } |
955 | 955 | return new \OC_Defaults(); |
956 | 956 | }); |
957 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
957 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
958 | 958 | /** @var Factory $cacheFactory */ |
959 | 959 | $cacheFactory = $c->query(Factory::class); |
960 | 960 | return new SCSSCacher( |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | $c->query(IconsCacher::class) |
969 | 969 | ); |
970 | 970 | }); |
971 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
971 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
972 | 972 | /** @var Factory $cacheFactory */ |
973 | 973 | $cacheFactory = $c->query(Factory::class); |
974 | 974 | return new JSCombiner( |
@@ -979,13 +979,13 @@ discard block |
||
979 | 979 | $c->getLogger() |
980 | 980 | ); |
981 | 981 | }); |
982 | - $this->registerService(EventDispatcher::class, function () { |
|
982 | + $this->registerService(EventDispatcher::class, function() { |
|
983 | 983 | return new EventDispatcher(); |
984 | 984 | }); |
985 | 985 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
986 | 986 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
987 | 987 | |
988 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
988 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
989 | 989 | // FIXME: Instantiiated here due to cyclic dependency |
990 | 990 | $request = new Request( |
991 | 991 | [ |
@@ -1010,7 +1010,7 @@ discard block |
||
1010 | 1010 | $request |
1011 | 1011 | ); |
1012 | 1012 | }); |
1013 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
1013 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
1014 | 1014 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
1015 | 1015 | |
1016 | 1016 | return new CsrfTokenManager( |
@@ -1018,22 +1018,22 @@ discard block |
||
1018 | 1018 | $c->query(SessionStorage::class) |
1019 | 1019 | ); |
1020 | 1020 | }); |
1021 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
1021 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
1022 | 1022 | return new SessionStorage($c->getSession()); |
1023 | 1023 | }); |
1024 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
1024 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
1025 | 1025 | return new ContentSecurityPolicyManager(); |
1026 | 1026 | }); |
1027 | 1027 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
1028 | 1028 | |
1029 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
1029 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
1030 | 1030 | return new ContentSecurityPolicyNonceManager( |
1031 | 1031 | $c->getCsrfTokenManager(), |
1032 | 1032 | $c->getRequest() |
1033 | 1033 | ); |
1034 | 1034 | }); |
1035 | 1035 | |
1036 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
1036 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
1037 | 1037 | $config = $c->getConfig(); |
1038 | 1038 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
1039 | 1039 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | |
1078 | 1078 | $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class); |
1079 | 1079 | |
1080 | - $this->registerService('SettingsManager', function (Server $c) { |
|
1080 | + $this->registerService('SettingsManager', function(Server $c) { |
|
1081 | 1081 | $manager = new \OC\Settings\Manager( |
1082 | 1082 | $c->getLogger(), |
1083 | 1083 | $c->getDatabaseConnection(), |
@@ -1095,36 +1095,36 @@ discard block |
||
1095 | 1095 | ); |
1096 | 1096 | return $manager; |
1097 | 1097 | }); |
1098 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
1098 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1099 | 1099 | return new \OC\Files\AppData\Factory( |
1100 | 1100 | $c->getRootFolder(), |
1101 | 1101 | $c->getSystemConfig() |
1102 | 1102 | ); |
1103 | 1103 | }); |
1104 | 1104 | |
1105 | - $this->registerService('LockdownManager', function (Server $c) { |
|
1106 | - return new LockdownManager(function () use ($c) { |
|
1105 | + $this->registerService('LockdownManager', function(Server $c) { |
|
1106 | + return new LockdownManager(function() use ($c) { |
|
1107 | 1107 | return $c->getSession(); |
1108 | 1108 | }); |
1109 | 1109 | }); |
1110 | 1110 | |
1111 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
1111 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1112 | 1112 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
1113 | 1113 | }); |
1114 | 1114 | |
1115 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
1115 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1116 | 1116 | return new CloudIdManager(); |
1117 | 1117 | }); |
1118 | 1118 | |
1119 | - $this->registerService(IConfig::class, function (Server $c) { |
|
1119 | + $this->registerService(IConfig::class, function(Server $c) { |
|
1120 | 1120 | return new GlobalScale\Config($c->getConfig()); |
1121 | 1121 | }); |
1122 | 1122 | |
1123 | - $this->registerService(ICloudFederationProviderManager::class, function (Server $c) { |
|
1123 | + $this->registerService(ICloudFederationProviderManager::class, function(Server $c) { |
|
1124 | 1124 | return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger()); |
1125 | 1125 | }); |
1126 | 1126 | |
1127 | - $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
1127 | + $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
1128 | 1128 | return new CloudFederationFactory(); |
1129 | 1129 | }); |
1130 | 1130 | |
@@ -1134,18 +1134,18 @@ discard block |
||
1134 | 1134 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
1135 | 1135 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1136 | 1136 | |
1137 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1137 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1138 | 1138 | return new Defaults( |
1139 | 1139 | $c->getThemingDefaults() |
1140 | 1140 | ); |
1141 | 1141 | }); |
1142 | 1142 | $this->registerAlias('Defaults', \OCP\Defaults::class); |
1143 | 1143 | |
1144 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
1144 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1145 | 1145 | return $c->query(\OCP\IUserSession::class)->getSession(); |
1146 | 1146 | }); |
1147 | 1147 | |
1148 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
1148 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
1149 | 1149 | return new ShareHelper( |
1150 | 1150 | $c->query(\OCP\Share\IManager::class) |
1151 | 1151 | ); |
@@ -1221,11 +1221,11 @@ discard block |
||
1221 | 1221 | // no avatar to remove |
1222 | 1222 | } catch (\Exception $e) { |
1223 | 1223 | // Ignore exceptions |
1224 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
1224 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1225 | 1225 | } |
1226 | 1226 | }); |
1227 | 1227 | |
1228 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
1228 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1229 | 1229 | $manager = $this->getAvatarManager(); |
1230 | 1230 | /** @var IUser $user */ |
1231 | 1231 | $user = $e->getSubject(); |
@@ -1376,7 +1376,7 @@ discard block |
||
1376 | 1376 | * @deprecated since 9.2.0 use IAppData |
1377 | 1377 | */ |
1378 | 1378 | public function getAppFolder() { |
1379 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
1379 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
1380 | 1380 | $root = $this->getRootFolder(); |
1381 | 1381 | if (!$root->nodeExists($dir)) { |
1382 | 1382 | $folder = $root->newFolder($dir); |
@@ -1951,7 +1951,7 @@ discard block |
||
1951 | 1951 | /** |
1952 | 1952 | * @return \OCP\Collaboration\AutoComplete\IManager |
1953 | 1953 | */ |
1954 | - public function getAutoCompleteManager(){ |
|
1954 | + public function getAutoCompleteManager() { |
|
1955 | 1955 | return $this->query(IManager::class); |
1956 | 1956 | } |
1957 | 1957 |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | private static function initLocalStorageRootFS() { |
83 | 83 | // mount local file backend as root |
84 | - $configDataDirectory = \OC::$server->getSystemConfig()->getValue("datadirectory", OC::$SERVERROOT . "/data"); |
|
84 | + $configDataDirectory = \OC::$server->getSystemConfig()->getValue("datadirectory", OC::$SERVERROOT."/data"); |
|
85 | 85 | //first set up the local "root" storage |
86 | 86 | \OC\Files\Filesystem::initMountManager(); |
87 | 87 | if (!self::$rootMounted) { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | \OC\Files\Filesystem::initMountManager(); |
204 | 204 | |
205 | 205 | \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false); |
206 | - \OC\Files\Filesystem::addStorageWrapper('mount_options', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
206 | + \OC\Files\Filesystem::addStorageWrapper('mount_options', function($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
207 | 207 | if ($storage->instanceOfStorage('\OC\Files\Storage\Common')) { |
208 | 208 | /** @var \OC\Files\Storage\Common $storage */ |
209 | 209 | $storage->setMountOptions($mount->getOptions()); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | return $storage; |
212 | 212 | }); |
213 | 213 | |
214 | - \OC\Files\Filesystem::addStorageWrapper('enable_sharing', function ($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
214 | + \OC\Files\Filesystem::addStorageWrapper('enable_sharing', function($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
215 | 215 | if (!$mount->getOption('enable_sharing', true)) { |
216 | 216 | return new \OC\Files\Storage\Wrapper\PermissionsMask([ |
217 | 217 | 'storage' => $storage, |
@@ -222,21 +222,21 @@ discard block |
||
222 | 222 | }); |
223 | 223 | |
224 | 224 | // install storage availability wrapper, before most other wrappers |
225 | - \OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, \OCP\Files\Storage\IStorage $storage) { |
|
225 | + \OC\Files\Filesystem::addStorageWrapper('oc_availability', function($mountPoint, \OCP\Files\Storage\IStorage $storage) { |
|
226 | 226 | if (!$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) { |
227 | 227 | return new \OC\Files\Storage\Wrapper\Availability(['storage' => $storage]); |
228 | 228 | } |
229 | 229 | return $storage; |
230 | 230 | }); |
231 | 231 | |
232 | - \OC\Files\Filesystem::addStorageWrapper('oc_encoding', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
232 | + \OC\Files\Filesystem::addStorageWrapper('oc_encoding', function($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
233 | 233 | if ($mount->getOption('encoding_compatibility', false) && !$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) { |
234 | 234 | return new \OC\Files\Storage\Wrapper\Encoding(['storage' => $storage]); |
235 | 235 | } |
236 | 236 | return $storage; |
237 | 237 | }); |
238 | 238 | |
239 | - \OC\Files\Filesystem::addStorageWrapper('oc_quota', function ($mountPoint, $storage) { |
|
239 | + \OC\Files\Filesystem::addStorageWrapper('oc_quota', function($mountPoint, $storage) { |
|
240 | 240 | // set up quota for home storages, even for other users |
241 | 241 | // which can happen when using sharing |
242 | 242 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | return $storage; |
260 | 260 | }); |
261 | 261 | |
262 | - \OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
262 | + \OC\Files\Filesystem::addStorageWrapper('readonly', function($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
263 | 263 | /* |
264 | 264 | * Do not allow any operations that modify the storage |
265 | 265 | */ |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | //if we aren't logged in, there is no use to set up the filesystem |
301 | 301 | if ($user != "") { |
302 | 302 | |
303 | - $userDir = '/' . $user . '/files'; |
|
303 | + $userDir = '/'.$user.'/files'; |
|
304 | 304 | |
305 | 305 | //jail the user into his "home" directory |
306 | 306 | \OC\Files\Filesystem::init($user, $userDir); |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | return \OCP\Files\FileInfo::SPACE_UNLIMITED; |
381 | 381 | } |
382 | 382 | $userQuota = $user->getQuota(); |
383 | - if($userQuota === 'none') { |
|
383 | + if ($userQuota === 'none') { |
|
384 | 384 | return \OCP\Files\FileInfo::SPACE_UNLIMITED; |
385 | 385 | } |
386 | 386 | return OC_Helper::computerFileSize($userQuota); |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | */ |
397 | 397 | public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) { |
398 | 398 | |
399 | - $plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton'); |
|
399 | + $plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT.'/core/skeleton'); |
|
400 | 400 | $userLang = \OC::$server->getL10NFactory()->findLanguage(); |
401 | 401 | $skeletonDirectory = str_replace('{lang}', $userLang, $plainSkeletonDirectory); |
402 | 402 | |
@@ -418,9 +418,9 @@ discard block |
||
418 | 418 | if ($instanceId === null) { |
419 | 419 | throw new \RuntimeException('no instance id!'); |
420 | 420 | } |
421 | - $appdata = 'appdata_' . $instanceId; |
|
421 | + $appdata = 'appdata_'.$instanceId; |
|
422 | 422 | if ($userId === $appdata) { |
423 | - throw new \RuntimeException('username is reserved name: ' . $appdata); |
|
423 | + throw new \RuntimeException('username is reserved name: '.$appdata); |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | if (!empty($skeletonDirectory)) { |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | |
448 | 448 | // Verify if folder exists |
449 | 449 | $dir = opendir($source); |
450 | - if($dir === false) { |
|
450 | + if ($dir === false) { |
|
451 | 451 | $logger->error(sprintf('Could not opendir "%s"', $source), ['app' => 'core']); |
452 | 452 | return; |
453 | 453 | } |
@@ -455,14 +455,14 @@ discard block |
||
455 | 455 | // Copy the files |
456 | 456 | while (false !== ($file = readdir($dir))) { |
457 | 457 | if (!\OC\Files\Filesystem::isIgnoredDir($file)) { |
458 | - if (is_dir($source . '/' . $file)) { |
|
458 | + if (is_dir($source.'/'.$file)) { |
|
459 | 459 | $child = $target->newFolder($file); |
460 | - self::copyr($source . '/' . $file, $child); |
|
460 | + self::copyr($source.'/'.$file, $child); |
|
461 | 461 | } else { |
462 | 462 | $child = $target->newFile($file); |
463 | - $sourceStream = fopen($source . '/' . $file, 'r'); |
|
464 | - if($sourceStream === false) { |
|
465 | - $logger->error(sprintf('Could not fopen "%s"', $source . '/' . $file), ['app' => 'core']); |
|
463 | + $sourceStream = fopen($source.'/'.$file, 'r'); |
|
464 | + if ($sourceStream === false) { |
|
465 | + $logger->error(sprintf('Could not fopen "%s"', $source.'/'.$file), ['app' => 'core']); |
|
466 | 466 | closedir($dir); |
467 | 467 | return; |
468 | 468 | } |
@@ -539,8 +539,8 @@ discard block |
||
539 | 539 | return; |
540 | 540 | } |
541 | 541 | |
542 | - $timestamp = filemtime(OC::$SERVERROOT . '/version.php'); |
|
543 | - require OC::$SERVERROOT . '/version.php'; |
|
542 | + $timestamp = filemtime(OC::$SERVERROOT.'/version.php'); |
|
543 | + require OC::$SERVERROOT.'/version.php'; |
|
544 | 544 | /** @var $timestamp int */ |
545 | 545 | self::$versionCache['OC_Version_Timestamp'] = $timestamp; |
546 | 546 | /** @var $OC_Version string */ |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | |
588 | 588 | // core js files need separate handling |
589 | 589 | if ($application !== 'core' && $file !== null) { |
590 | - self::addTranslations ( $application ); |
|
590 | + self::addTranslations($application); |
|
591 | 591 | } |
592 | 592 | self::addExternalResource($application, $prepend, $path, "script"); |
593 | 593 | } |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | if ($type === "style") { |
665 | 665 | if (!in_array($path, self::$styles)) { |
666 | 666 | if ($prepend === true) { |
667 | - array_unshift ( self::$styles, $path ); |
|
667 | + array_unshift(self::$styles, $path); |
|
668 | 668 | } else { |
669 | 669 | self::$styles[] = $path; |
670 | 670 | } |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | } elseif ($type === "script") { |
673 | 673 | if (!in_array($path, self::$scripts)) { |
674 | 674 | if ($prepend === true) { |
675 | - array_unshift ( self::$scripts, $path ); |
|
675 | + array_unshift(self::$scripts, $path); |
|
676 | 676 | } else { |
677 | 677 | self::$scripts [] = $path; |
678 | 678 | } |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | 'text' => $text |
697 | 697 | ); |
698 | 698 | if ($prepend === true) { |
699 | - array_unshift (self::$headers, $header); |
|
699 | + array_unshift(self::$headers, $header); |
|
700 | 700 | |
701 | 701 | } else { |
702 | 702 | self::$headers[] = $header; |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | public static function checkServer(\OC\SystemConfig $config) { |
713 | 713 | $l = \OC::$server->getL10N('lib'); |
714 | 714 | $errors = array(); |
715 | - $CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT . '/data'); |
|
715 | + $CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT.'/data'); |
|
716 | 716 | |
717 | 717 | if (!self::needUpgrade($config) && $config->getValue('installed', false)) { |
718 | 718 | // this check needs to be done every time |
@@ -747,14 +747,14 @@ discard block |
||
747 | 747 | } |
748 | 748 | |
749 | 749 | // Check if config folder is writable. |
750 | - if(!OC_Helper::isReadOnlyConfigEnabled()) { |
|
750 | + if (!OC_Helper::isReadOnlyConfigEnabled()) { |
|
751 | 751 | if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) { |
752 | 752 | $errors[] = array( |
753 | 753 | 'error' => $l->t('Cannot write into "config" directory'), |
754 | 754 | 'hint' => $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s', |
755 | - [ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. ' |
|
755 | + [$urlGenerator->linkToDocs('admin-dir_permissions')]).'. ' |
|
756 | 756 | . $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s', |
757 | - [ $urlGenerator->linkToDocs('admin-config') ] ) |
|
757 | + [$urlGenerator->linkToDocs('admin-config')]) |
|
758 | 758 | ); |
759 | 759 | } |
760 | 760 | } |
@@ -889,15 +889,15 @@ discard block |
||
889 | 889 | } |
890 | 890 | } |
891 | 891 | |
892 | - foreach($missingDependencies as $missingDependency) { |
|
892 | + foreach ($missingDependencies as $missingDependency) { |
|
893 | 893 | $errors[] = array( |
894 | 894 | 'error' => $l->t('PHP module %s not installed.', array($missingDependency)), |
895 | 895 | 'hint' => $moduleHint |
896 | 896 | ); |
897 | 897 | $webServerRestart = true; |
898 | 898 | } |
899 | - foreach($invalidIniSettings as $setting) { |
|
900 | - if(is_bool($setting[1])) { |
|
899 | + foreach ($invalidIniSettings as $setting) { |
|
900 | + if (is_bool($setting[1])) { |
|
901 | 901 | $setting[1] = $setting[1] ? 'on' : 'off'; |
902 | 902 | } |
903 | 903 | $errors[] = [ |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | * TODO: Should probably be implemented in the above generic dependency |
916 | 916 | * check somehow in the long-term. |
917 | 917 | */ |
918 | - if($iniWrapper->getBool('mbstring.func_overload') !== null && |
|
918 | + if ($iniWrapper->getBool('mbstring.func_overload') !== null && |
|
919 | 919 | $iniWrapper->getBool('mbstring.func_overload') === true) { |
920 | 920 | $errors[] = array( |
921 | 921 | 'error' => $l->t('mbstring.func_overload is set to "%s" instead of the expected value "0"', [$iniWrapper->getString('mbstring.func_overload')]), |
@@ -923,16 +923,16 @@ discard block |
||
923 | 923 | ); |
924 | 924 | } |
925 | 925 | |
926 | - if(function_exists('xml_parser_create') && |
|
927 | - LIBXML_LOADED_VERSION < 20700 ) { |
|
926 | + if (function_exists('xml_parser_create') && |
|
927 | + LIBXML_LOADED_VERSION < 20700) { |
|
928 | 928 | $version = LIBXML_LOADED_VERSION; |
929 | - $major = floor($version/10000); |
|
929 | + $major = floor($version / 10000); |
|
930 | 930 | $version -= ($major * 10000); |
931 | - $minor = floor($version/100); |
|
931 | + $minor = floor($version / 100); |
|
932 | 932 | $version -= ($minor * 100); |
933 | 933 | $patch = $version; |
934 | 934 | $errors[] = array( |
935 | - 'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major . '.' . $minor . '.' . $patch]), |
|
935 | + 'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major.'.'.$minor.'.'.$patch]), |
|
936 | 936 | 'hint' => $l->t('To fix this issue update your libxml2 version and restart your web server.') |
937 | 937 | ); |
938 | 938 | } |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | * @return array arrays with error messages and hints |
999 | 999 | */ |
1000 | 1000 | public static function checkDataDirectoryPermissions($dataDirectory) { |
1001 | - if(\OC::$server->getConfig()->getSystemValue('check_data_directory_permissions', true) === false) { |
|
1001 | + if (\OC::$server->getConfig()->getSystemValue('check_data_directory_permissions', true) === false) { |
|
1002 | 1002 | return []; |
1003 | 1003 | } |
1004 | 1004 | $l = \OC::$server->getL10N('lib'); |
@@ -1036,10 +1036,10 @@ discard block |
||
1036 | 1036 | 'hint' => $l->t('Check the value of "datadirectory" in your configuration') |
1037 | 1037 | ]; |
1038 | 1038 | } |
1039 | - if (!file_exists($dataDirectory . '/.ocdata')) { |
|
1039 | + if (!file_exists($dataDirectory.'/.ocdata')) { |
|
1040 | 1040 | $errors[] = [ |
1041 | 1041 | 'error' => $l->t('Your data directory is invalid'), |
1042 | - 'hint' => $l->t('Ensure there is a file called ".ocdata"' . |
|
1042 | + 'hint' => $l->t('Ensure there is a file called ".ocdata"'. |
|
1043 | 1043 | ' in the root of the data directory.') |
1044 | 1044 | ]; |
1045 | 1045 | } |
@@ -1055,7 +1055,7 @@ discard block |
||
1055 | 1055 | public static function checkLoggedIn() { |
1056 | 1056 | // Check if we are a user |
1057 | 1057 | if (!\OC::$server->getUserSession()->isLoggedIn()) { |
1058 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute( |
|
1058 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute( |
|
1059 | 1059 | 'core.login.showLoginForm', |
1060 | 1060 | [ |
1061 | 1061 | 'redirect_url' => \OC::$server->getRequest()->getRequestUri(), |
@@ -1066,7 +1066,7 @@ discard block |
||
1066 | 1066 | } |
1067 | 1067 | // Redirect to 2FA challenge selection if 2FA challenge was not solved yet |
1068 | 1068 | if (\OC::$server->getTwoFactorAuthManager()->needsSecondFactor(\OC::$server->getUserSession()->getUser())) { |
1069 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
1069 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
1070 | 1070 | exit(); |
1071 | 1071 | } |
1072 | 1072 | } |
@@ -1079,7 +1079,7 @@ discard block |
||
1079 | 1079 | public static function checkAdminUser() { |
1080 | 1080 | OC_Util::checkLoggedIn(); |
1081 | 1081 | if (!OC_User::isAdminUser(OC_User::getUser())) { |
1082 | - header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php')); |
|
1082 | + header('Location: '.\OCP\Util::linkToAbsolute('', 'index.php')); |
|
1083 | 1083 | exit(); |
1084 | 1084 | } |
1085 | 1085 | } |
@@ -1093,12 +1093,12 @@ discard block |
||
1093 | 1093 | OC_Util::checkLoggedIn(); |
1094 | 1094 | $userObject = \OC::$server->getUserSession()->getUser(); |
1095 | 1095 | $isSubAdmin = false; |
1096 | - if($userObject !== null) { |
|
1096 | + if ($userObject !== null) { |
|
1097 | 1097 | $isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject); |
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | if (!$isSubAdmin) { |
1101 | - header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php')); |
|
1101 | + header('Location: '.\OCP\Util::linkToAbsolute('', 'index.php')); |
|
1102 | 1102 | exit(); |
1103 | 1103 | } |
1104 | 1104 | return true; |
@@ -1135,10 +1135,10 @@ discard block |
||
1135 | 1135 | } |
1136 | 1136 | } |
1137 | 1137 | |
1138 | - if($config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') { |
|
1139 | - $location = $urlGenerator->getAbsoluteURL('/apps/' . $appId . '/'); |
|
1138 | + if ($config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') { |
|
1139 | + $location = $urlGenerator->getAbsoluteURL('/apps/'.$appId.'/'); |
|
1140 | 1140 | } else { |
1141 | - $location = $urlGenerator->getAbsoluteURL('/index.php/apps/' . $appId . '/'); |
|
1141 | + $location = $urlGenerator->getAbsoluteURL('/index.php/apps/'.$appId.'/'); |
|
1142 | 1142 | } |
1143 | 1143 | } |
1144 | 1144 | } |
@@ -1152,7 +1152,7 @@ discard block |
||
1152 | 1152 | */ |
1153 | 1153 | public static function redirectToDefaultPage() { |
1154 | 1154 | $location = self::getDefaultPageUrl(); |
1155 | - header('Location: ' . $location); |
|
1155 | + header('Location: '.$location); |
|
1156 | 1156 | exit(); |
1157 | 1157 | } |
1158 | 1158 | |
@@ -1165,7 +1165,7 @@ discard block |
||
1165 | 1165 | $id = \OC::$server->getSystemConfig()->getValue('instanceid', null); |
1166 | 1166 | if (is_null($id)) { |
1167 | 1167 | // We need to guarantee at least one letter in instanceid so it can be used as the session_name |
1168 | - $id = 'oc' . \OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
1168 | + $id = 'oc'.\OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
1169 | 1169 | \OC::$server->getSystemConfig()->setValue('instanceid', $id); |
1170 | 1170 | } |
1171 | 1171 | return $id; |
@@ -1187,7 +1187,7 @@ discard block |
||
1187 | 1187 | }, $value); |
1188 | 1188 | } else { |
1189 | 1189 | // Specify encoding for PHP<5.4 |
1190 | - $value = htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8'); |
|
1190 | + $value = htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8'); |
|
1191 | 1191 | } |
1192 | 1192 | return $value; |
1193 | 1193 | } |
@@ -1220,7 +1220,7 @@ discard block |
||
1220 | 1220 | $testContent = 'This is used for testing whether htaccess is properly enabled to disallow access from the outside. This file can be safely removed.'; |
1221 | 1221 | |
1222 | 1222 | // creating a test file |
1223 | - $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName; |
|
1223 | + $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName; |
|
1224 | 1224 | |
1225 | 1225 | if (file_exists($testFile)) {// already running this test, possible recursive call |
1226 | 1226 | return false; |
@@ -1229,7 +1229,7 @@ discard block |
||
1229 | 1229 | $fp = @fopen($testFile, 'w'); |
1230 | 1230 | if (!$fp) { |
1231 | 1231 | throw new OC\HintException('Can\'t create test file to check for working .htaccess file.', |
1232 | - 'Make sure it is possible for the webserver to write to ' . $testFile); |
|
1232 | + 'Make sure it is possible for the webserver to write to '.$testFile); |
|
1233 | 1233 | } |
1234 | 1234 | fwrite($fp, $testContent); |
1235 | 1235 | fclose($fp); |
@@ -1256,10 +1256,10 @@ discard block |
||
1256 | 1256 | } |
1257 | 1257 | |
1258 | 1258 | $fileName = '/htaccesstest.txt'; |
1259 | - $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName; |
|
1259 | + $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName; |
|
1260 | 1260 | |
1261 | 1261 | // accessing the file via http |
1262 | - $url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT . '/data' . $fileName); |
|
1262 | + $url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT.'/data'.$fileName); |
|
1263 | 1263 | try { |
1264 | 1264 | $content = \OC::$server->getHTTPClientService()->newClient()->get($url)->getBody(); |
1265 | 1265 | } catch (\Exception $e) { |
@@ -1350,7 +1350,7 @@ discard block |
||
1350 | 1350 | $theme = \OC::$server->getSystemConfig()->getValue("theme", ''); |
1351 | 1351 | |
1352 | 1352 | if ($theme === '') { |
1353 | - if (is_dir(OC::$SERVERROOT . '/themes/default')) { |
|
1353 | + if (is_dir(OC::$SERVERROOT.'/themes/default')) { |
|
1354 | 1354 | $theme = 'default'; |
1355 | 1355 | } |
1356 | 1356 | } |
@@ -1423,13 +1423,13 @@ discard block |
||
1423 | 1423 | * @return bool|string |
1424 | 1424 | */ |
1425 | 1425 | public static function normalizeUnicode($value) { |
1426 | - if(Normalizer::isNormalized($value)) { |
|
1426 | + if (Normalizer::isNormalized($value)) { |
|
1427 | 1427 | return $value; |
1428 | 1428 | } |
1429 | 1429 | |
1430 | 1430 | $normalizedValue = Normalizer::normalize($value); |
1431 | 1431 | if ($normalizedValue === null || $normalizedValue === false) { |
1432 | - \OC::$server->getLogger()->warning('normalizing failed for "' . $value . '"', ['app' => 'core']); |
|
1432 | + \OC::$server->getLogger()->warning('normalizing failed for "'.$value.'"', ['app' => 'core']); |
|
1433 | 1433 | return $value; |
1434 | 1434 | } |
1435 | 1435 | |
@@ -1445,7 +1445,7 @@ discard block |
||
1445 | 1445 | $version = OC_Util::getVersionString(); |
1446 | 1446 | $build = OC_Util::getBuild(); |
1447 | 1447 | if (!empty($build) and OC_Util::getChannel() === 'daily') { |
1448 | - $version .= ' Build:' . $build; |
|
1448 | + $version .= ' Build:'.$build; |
|
1449 | 1449 | } |
1450 | 1450 | return $version; |
1451 | 1451 | } |
@@ -1467,7 +1467,7 @@ discard block |
||
1467 | 1467 | } |
1468 | 1468 | |
1469 | 1469 | // detect part files |
1470 | - if (preg_match('/' . \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX . '/', $trimmed) !== 0) { |
|
1470 | + if (preg_match('/'.\OCP\Files\FileInfo::BLACKLIST_FILES_REGEX.'/', $trimmed) !== 0) { |
|
1471 | 1471 | return false; |
1472 | 1472 | } |
1473 | 1473 | |
@@ -1498,19 +1498,19 @@ discard block |
||
1498 | 1498 | } else if ($config->getValue('debug', false) && $versionDiff < 0) { |
1499 | 1499 | // downgrade with debug |
1500 | 1500 | $installedMajor = explode('.', $installedVersion); |
1501 | - $installedMajor = $installedMajor[0] . '.' . $installedMajor[1]; |
|
1501 | + $installedMajor = $installedMajor[0].'.'.$installedMajor[1]; |
|
1502 | 1502 | $currentMajor = explode('.', $currentVersion); |
1503 | - $currentMajor = $currentMajor[0] . '.' . $currentMajor[1]; |
|
1503 | + $currentMajor = $currentMajor[0].'.'.$currentMajor[1]; |
|
1504 | 1504 | if ($installedMajor === $currentMajor) { |
1505 | 1505 | // Same major, allow downgrade for developers |
1506 | 1506 | return true; |
1507 | 1507 | } else { |
1508 | 1508 | // downgrade attempt, throw exception |
1509 | - throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); |
|
1509 | + throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')'); |
|
1510 | 1510 | } |
1511 | 1511 | } else if ($versionDiff < 0) { |
1512 | 1512 | // downgrade attempt, throw exception |
1513 | - throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); |
|
1513 | + throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')'); |
|
1514 | 1514 | } |
1515 | 1515 | |
1516 | 1516 | // also check for upgrades for apps (independently from the user) |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $this->defaults = $defaults; |
103 | 103 | $this->serverRoot = $serverRoot; |
104 | 104 | $this->cacheFactory = $cacheFactory; |
105 | - $this->depsCache = $cacheFactory->createDistributed('SCSS-' . md5($this->urlGenerator->getBaseUrl())); |
|
105 | + $this->depsCache = $cacheFactory->createDistributed('SCSS-'.md5($this->urlGenerator->getBaseUrl())); |
|
106 | 106 | $this->iconsCacher = $iconsCacher; |
107 | 107 | } |
108 | 108 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @throws NotPermittedException |
117 | 117 | */ |
118 | 118 | public function process(string $root, string $file, string $app): bool { |
119 | - $path = explode('/', $root . '/' . $file); |
|
119 | + $path = explode('/', $root.'/'.$file); |
|
120 | 120 | |
121 | 121 | $fileNameSCSS = array_pop($path); |
122 | 122 | $fileNameCSS = $this->prependVersionPrefix($this->prependBaseurlPrefix(str_replace('.scss', '.css', $fileNameSCSS)), $app); |
@@ -171,13 +171,13 @@ discard block |
||
171 | 171 | try { |
172 | 172 | $cachedFile = $folder->getFile($fileNameCSS); |
173 | 173 | if ($cachedFile->getSize() > 0) { |
174 | - $depFileName = $fileNameCSS . '.deps'; |
|
175 | - $deps = $this->depsCache->get($folder->getName() . '-' . $depFileName); |
|
174 | + $depFileName = $fileNameCSS.'.deps'; |
|
175 | + $deps = $this->depsCache->get($folder->getName().'-'.$depFileName); |
|
176 | 176 | if ($deps === null) { |
177 | 177 | $depFile = $folder->getFile($depFileName); |
178 | 178 | $deps = $depFile->getContent(); |
179 | 179 | //Set to memcache for next run |
180 | - $this->depsCache->set($folder->getName() . '-' . $depFileName, $deps); |
|
180 | + $this->depsCache->set($folder->getName().'-'.$depFileName, $deps); |
|
181 | 181 | } |
182 | 182 | $deps = json_decode($deps, true); |
183 | 183 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $scss = new Compiler(); |
228 | 228 | $scss->setImportPaths([ |
229 | 229 | $path, |
230 | - $this->serverRoot . '/core/css/' |
|
230 | + $this->serverRoot.'/core/css/' |
|
231 | 231 | ]); |
232 | 232 | |
233 | 233 | // Continue after throw |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $cachedfile = $folder->newFile($fileNameCSS); |
248 | 248 | } |
249 | 249 | |
250 | - $depFileName = $fileNameCSS . '.deps'; |
|
250 | + $depFileName = $fileNameCSS.'.deps'; |
|
251 | 251 | try { |
252 | 252 | $depFile = $folder->getFile($depFileName); |
253 | 253 | } catch (NotFoundException $e) { |
@@ -257,11 +257,11 @@ discard block |
||
257 | 257 | // Compile |
258 | 258 | try { |
259 | 259 | $compiledScss = $scss->compile( |
260 | - '$webroot: \'' . $this->getRoutePrefix() . '\';' . |
|
261 | - '@import "variables.scss";' . |
|
262 | - '@import "functions.scss";' . |
|
263 | - $this->getInjectedVariables() . |
|
264 | - '@import "' . $fileNameSCSS . '";'); |
|
260 | + '$webroot: \''.$this->getRoutePrefix().'\';'. |
|
261 | + '@import "variables.scss";'. |
|
262 | + '@import "functions.scss";'. |
|
263 | + $this->getInjectedVariables(). |
|
264 | + '@import "'.$fileNameSCSS.'";'); |
|
265 | 265 | } catch (ParserException $e) { |
266 | 266 | $this->logger->error($e, ['app' => 'core']); |
267 | 267 | |
@@ -273,9 +273,9 @@ discard block |
||
273 | 273 | |
274 | 274 | // Gzip file |
275 | 275 | try { |
276 | - $gzipFile = $folder->getFile($fileNameCSS . '.gzip'); # Safari doesn't like .gz |
|
276 | + $gzipFile = $folder->getFile($fileNameCSS.'.gzip'); # Safari doesn't like .gz |
|
277 | 277 | } catch (NotFoundException $e) { |
278 | - $gzipFile = $folder->newFile($fileNameCSS . '.gzip'); # Safari doesn't like .gz |
|
278 | + $gzipFile = $folder->newFile($fileNameCSS.'.gzip'); # Safari doesn't like .gz |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | try { |
@@ -283,13 +283,13 @@ discard block |
||
283 | 283 | $cachedfile->putContent($data); |
284 | 284 | $deps = json_encode($scss->getParsedFiles()); |
285 | 285 | $depFile->putContent($deps); |
286 | - $this->depsCache->set($folder->getName() . '-' . $depFileName, $deps); |
|
286 | + $this->depsCache->set($folder->getName().'-'.$depFileName, $deps); |
|
287 | 287 | $gzipFile->putContent(gzencode($data, 9)); |
288 | - $this->logger->debug('SCSSCacher: ' . $webDir . '/' . $fileNameSCSS . ' compiled and successfully cached', ['app' => 'core']); |
|
288 | + $this->logger->debug('SCSSCacher: '.$webDir.'/'.$fileNameSCSS.' compiled and successfully cached', ['app' => 'core']); |
|
289 | 289 | |
290 | 290 | return true; |
291 | 291 | } catch (NotPermittedException $e) { |
292 | - $this->logger->error('SCSSCacher: unable to cache: ' . $fileNameSCSS); |
|
292 | + $this->logger->error('SCSSCacher: unable to cache: '.$fileNameSCSS); |
|
293 | 293 | |
294 | 294 | return false; |
295 | 295 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | try { |
309 | 309 | $file->delete(); |
310 | 310 | } catch (NotPermittedException $e) { |
311 | - $this->logger->logException($e, ['message' => 'SCSSCacher: unable to delete file: ' . $file->getName()]); |
|
311 | + $this->logger->logException($e, ['message' => 'SCSSCacher: unable to delete file: '.$file->getName()]); |
|
312 | 312 | } |
313 | 313 | } |
314 | 314 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | } |
324 | 324 | $variables = ''; |
325 | 325 | foreach ($this->defaults->getScssVariables() as $key => $value) { |
326 | - $variables .= '$' . $key . ': ' . $value . ';'; |
|
326 | + $variables .= '$'.$key.': '.$value.';'; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | // check for valid variables / otherwise fall back to defaults |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | */ |
347 | 347 | private function rebaseUrls(string $css, string $webDir): string { |
348 | 348 | $re = '/url\([\'"]([^\/][\.\w?=\/-]*)[\'"]\)/x'; |
349 | - $subst = 'url(\'' . $webDir . '/$1\')'; |
|
349 | + $subst = 'url(\''.$webDir.'/$1\')'; |
|
350 | 350 | |
351 | 351 | return preg_replace($re, $subst, $css); |
352 | 352 | } |
@@ -371,12 +371,12 @@ discard block |
||
371 | 371 | * @return string |
372 | 372 | */ |
373 | 373 | private function prependBaseurlPrefix(string $cssFile): string { |
374 | - return substr(md5($this->urlGenerator->getBaseUrl() . $this->getRoutePrefix()), 0, 4) . '-' . $cssFile; |
|
374 | + return substr(md5($this->urlGenerator->getBaseUrl().$this->getRoutePrefix()), 0, 4).'-'.$cssFile; |
|
375 | 375 | } |
376 | 376 | |
377 | 377 | private function getRoutePrefix() { |
378 | 378 | $frontControllerActive = ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'); |
379 | - $prefix = \OC::$WEBROOT . '/index.php'; |
|
379 | + $prefix = \OC::$WEBROOT.'/index.php'; |
|
380 | 380 | if ($frontControllerActive) { |
381 | 381 | $prefix = \OC::$WEBROOT; |
382 | 382 | } |
@@ -392,11 +392,11 @@ discard block |
||
392 | 392 | private function prependVersionPrefix(string $cssFile, string $appId): string { |
393 | 393 | $appVersion = \OC_App::getAppVersion($appId); |
394 | 394 | if ($appVersion !== '0') { |
395 | - return substr(md5($appVersion), 0, 4) . '-' . $cssFile; |
|
395 | + return substr(md5($appVersion), 0, 4).'-'.$cssFile; |
|
396 | 396 | } |
397 | 397 | $coreVersion = \OC_Util::getVersionString(); |
398 | 398 | |
399 | - return substr(md5($coreVersion), 0, 4) . '-' . $cssFile; |
|
399 | + return substr(md5($coreVersion), 0, 4).'-'.$cssFile; |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | /** |
@@ -414,9 +414,9 @@ discard block |
||
414 | 414 | $appDirectoryPath = explode($appName, $path)[1]; |
415 | 415 | // Remove the webroot |
416 | 416 | |
417 | - return str_replace($webRoot, '', $appWebPath . $appDirectoryPath); |
|
417 | + return str_replace($webRoot, '', $appWebPath.$appDirectoryPath); |
|
418 | 418 | } |
419 | 419 | |
420 | - return $webRoot . substr($path, strlen($serverRoot)); |
|
420 | + return $webRoot.substr($path, strlen($serverRoot)); |
|
421 | 421 | } |
422 | 422 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare (strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * @copyright Copyright (c) 2018, John Molakvoæ ([email protected]) |
5 | 5 | * |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | // remove :root |
98 | 98 | $currentData = str_replace([':root {', '}'], '', $currentData); |
99 | 99 | |
100 | - $icons = $this->getIconsFromCss($currentData . $css); |
|
100 | + $icons = $this->getIconsFromCss($currentData.$css); |
|
101 | 101 | |
102 | 102 | $data = ''; |
103 | 103 | foreach ($icons as $icon => $url) { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare (strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * @copyright Copyright (c) 2018 John Molakvoæ (skjnldsv) <[email protected]> |
5 | 5 | * |
@@ -121,15 +121,15 @@ discard block |
||
121 | 121 | |
122 | 122 | foreach ($userValues as $key => $scssFile) { |
123 | 123 | if ($scssFile !== false) { |
124 | - $imports .= '@import "' . $scssFile . '";'; |
|
124 | + $imports .= '@import "'.$scssFile.'";'; |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
128 | 128 | if ($imports !== '') { |
129 | 129 | $scss = new Compiler(); |
130 | 130 | $scss->setImportPaths([ |
131 | - $this->appRoot . '/css/', |
|
132 | - $this->serverRoot . '/core/css/' |
|
131 | + $this->appRoot.'/css/', |
|
132 | + $this->serverRoot.'/core/css/' |
|
133 | 133 | ]); |
134 | 134 | |
135 | 135 | // Continue after throw |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | // Import theme, variables and compile css4 variables |
140 | 140 | try { |
141 | 141 | $css .= $scss->compile( |
142 | - $imports . |
|
143 | - '@import "variables.scss";' . |
|
142 | + $imports. |
|
143 | + '@import "variables.scss";'. |
|
144 | 144 | '@import "css-variables.scss";' |
145 | 145 | ); |
146 | 146 | } catch (ParserException $e) { |
@@ -153,21 +153,21 @@ discard block |
||
153 | 153 | |
154 | 154 | // Rebase all urls |
155 | 155 | $appWebRoot = substr($this->appRoot, strlen($this->serverRoot) - strlen(\OC::$WEBROOT)); |
156 | - $css = $this->rebaseUrls($css, $appWebRoot . '/css'); |
|
156 | + $css = $this->rebaseUrls($css, $appWebRoot.'/css'); |
|
157 | 157 | |
158 | 158 | if (in_array('themedark', $userValues) && $this->iconsCacher->getCachedCSS() && $this->iconsCacher->getCachedCSS()->getSize() > 0) { |
159 | 159 | $iconsCss = $this->invertSvgIconsColor($this->iconsCacher->getCachedCSS()->getContent()); |
160 | - $css = $css . $iconsCss; |
|
160 | + $css = $css.$iconsCss; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $response = new DataDisplayResponse($css, Http::STATUS_OK, ['Content-Type' => 'text/css']); |
164 | 164 | |
165 | 165 | // Set cache control |
166 | 166 | $ttl = 31536000; |
167 | - $response->addHeader('Cache-Control', 'max-age=' . $ttl . ', immutable'); |
|
167 | + $response->addHeader('Cache-Control', 'max-age='.$ttl.', immutable'); |
|
168 | 168 | $expires = new \DateTime(); |
169 | 169 | $expires->setTimestamp($this->timeFactory->getTime()); |
170 | - $expires->add(new \DateInterval('PT' . $ttl . 'S')); |
|
170 | + $expires->add(new \DateInterval('PT'.$ttl.'S')); |
|
171 | 171 | $response->addHeader('Expires', $expires->format(\DateTime::RFC1123)); |
172 | 172 | $response->addHeader('Pragma', 'cache'); |
173 | 173 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | private function rebaseUrls(string $css, string $webDir): string { |
208 | 208 | $re = '/url\([\'"]([^\/][\.\w?=\/-]*)[\'"]\)/x'; |
209 | - $subst = 'url(\'' . $webDir . '/$1\')'; |
|
209 | + $subst = 'url(\''.$webDir.'/$1\')'; |
|
210 | 210 | |
211 | 211 | return preg_replace($re, $subst, $css); |
212 | 212 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare (strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | /** |
4 | 4 | * @copyright Copyright (c) 2018, John Molakvoæ ([email protected]) |
5 | 5 | * |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @return DataDisplayResponse|NotFoundResponse |
68 | 68 | */ |
69 | 69 | public function getSvgFromCore(string $folder, string $fileName, string $color = 'ffffff') { |
70 | - $path = $this->serverRoot . "/core/img/$folder/$fileName.svg"; |
|
70 | + $path = $this->serverRoot."/core/img/$folder/$fileName.svg"; |
|
71 | 71 | return $this->getSvg($path, $color, $fileName); |
72 | 72 | } |
73 | 73 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public function getSvgFromApp(string $app, string $fileName, string $color = 'ffffff') { |
86 | 86 | |
87 | 87 | if ($app === 'settings') { |
88 | - $path = $this->serverRoot . "/settings/img/$fileName.svg"; |
|
88 | + $path = $this->serverRoot."/settings/img/$fileName.svg"; |
|
89 | 89 | return $this->getSvg($path, $color, $fileName); |
90 | 90 | } |
91 | 91 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if (!$appPath) { |
96 | 96 | return new NotFoundResponse(); |
97 | 97 | } |
98 | - $path = $this->serverRoot . $appPath ."/img/$fileName.svg"; |
|
98 | + $path = $this->serverRoot.$appPath."/img/$fileName.svg"; |
|
99 | 99 | return $this->getSvg($path, $color, $fileName); |
100 | 100 | } |
101 | 101 | |
@@ -121,21 +121,21 @@ discard block |
||
121 | 121 | // add fill (fill is not present on black elements) |
122 | 122 | $fillRe = '/<((circle|rect|path)((?!fill)[a-z0-9 =".\-#():;])+)\/>/mi'; |
123 | 123 | |
124 | - $svg = preg_replace($fillRe, '<$1 fill="#' . $color . '"/>', $svg); |
|
124 | + $svg = preg_replace($fillRe, '<$1 fill="#'.$color.'"/>', $svg); |
|
125 | 125 | |
126 | 126 | // replace any fill or stroke colors |
127 | - $svg = preg_replace('/stroke="#([a-z0-9]{3,6})"/mi', 'stroke="#' . $color . '"', $svg); |
|
128 | - $svg = preg_replace('/fill="#([a-z0-9]{3,6})"/mi', 'fill="#' . $color . '"', $svg); |
|
127 | + $svg = preg_replace('/stroke="#([a-z0-9]{3,6})"/mi', 'stroke="#'.$color.'"', $svg); |
|
128 | + $svg = preg_replace('/fill="#([a-z0-9]{3,6})"/mi', 'fill="#'.$color.'"', $svg); |
|
129 | 129 | |
130 | 130 | $response = new DataDisplayResponse($svg, Http::STATUS_OK, ['Content-Type' => 'image/svg+xml']); |
131 | 131 | |
132 | 132 | // Set cache control |
133 | 133 | $ttl = 31536000; |
134 | 134 | $response->cacheFor($ttl); |
135 | - $response->addHeader('Content-Disposition', 'inline; filename="' . $fileName . '.svg"'); |
|
135 | + $response->addHeader('Content-Disposition', 'inline; filename="'.$fileName.'.svg"'); |
|
136 | 136 | $expires = new \DateTime(); |
137 | 137 | $expires->setTimestamp($this->timeFactory->getTime()); |
138 | - $expires->add(new \DateInterval('PT' . $ttl . 'S')); |
|
138 | + $expires->add(new \DateInterval('PT'.$ttl.'S')); |
|
139 | 139 | $response->addHeader('Expires', $expires->format(\DateTime::RFC1123)); |
140 | 140 | $response->addHeader('Pragma', 'cache'); |
141 | 141 |