@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $this->defaultLogoClaim = ''; |
66 | 66 | $this->defaultMailHeaderColor = '#0082c9'; /* header color of mail notifications */ |
67 | 67 | |
68 | - $themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php'; |
|
68 | + $themePath = OC::$SERVERROOT.'/themes/'.OC_Util::getTheme().'/defaults.php'; |
|
69 | 69 | if (file_exists($themePath)) { |
70 | 70 | // prevent defaults.php from printing output |
71 | 71 | ob_start(); |
@@ -239,9 +239,9 @@ discard block |
||
239 | 239 | if ($this->themeExist('getShortFooter')) { |
240 | 240 | $footer = $this->theme->getShortFooter(); |
241 | 241 | } else { |
242 | - $footer = '<a href="'. $this->getBaseUrl() . '" target="_blank"' . |
|
243 | - ' rel="noreferrer">' .$this->getEntity() . '</a>'. |
|
244 | - ' – ' . $this->getSlogan(); |
|
242 | + $footer = '<a href="'.$this->getBaseUrl().'" target="_blank"'. |
|
243 | + ' rel="noreferrer">'.$this->getEntity().'</a>'. |
|
244 | + ' – '.$this->getSlogan(); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | return $footer; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | if ($this->themeExist('buildDocLinkToKey')) { |
269 | 269 | return $this->theme->buildDocLinkToKey($key); |
270 | 270 | } |
271 | - return $this->getDocBaseUrl() . '/server/' . $this->defaultDocVersion . '/go.php?to=' . $key; |
|
271 | + return $this->getDocBaseUrl().'/server/'.$this->defaultDocVersion.'/go.php?to='.$key; |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * @return array scss variables to overwrite |
288 | 288 | */ |
289 | 289 | public function getScssVariables() { |
290 | - if($this->themeExist('getScssVariables')) { |
|
290 | + if ($this->themeExist('getScssVariables')) { |
|
291 | 291 | return $this->theme->getScssVariables(); |
292 | 292 | } |
293 | 293 | return []; |
@@ -90,24 +90,24 @@ discard block |
||
90 | 90 | * @return boolean |
91 | 91 | */ |
92 | 92 | public function process($root, $file, $app) { |
93 | - $path = explode('/', $root . '/' . $file); |
|
93 | + $path = explode('/', $root.'/'.$file); |
|
94 | 94 | |
95 | 95 | $fileNameSCSS = array_pop($path); |
96 | 96 | $fileNameCSS = str_replace('.scss', '.css', $fileNameSCSS); |
97 | 97 | |
98 | 98 | $path = implode('/', $path); |
99 | 99 | |
100 | - $webDir = substr($path, strlen($this->serverRoot)+1); |
|
100 | + $webDir = substr($path, strlen($this->serverRoot) + 1); |
|
101 | 101 | |
102 | 102 | try { |
103 | 103 | $folder = $this->appData->getFolder($app); |
104 | - } catch(NotFoundException $e) { |
|
104 | + } catch (NotFoundException $e) { |
|
105 | 105 | // creating css appdata folder |
106 | 106 | $folder = $this->appData->newFolder($app); |
107 | 107 | } |
108 | 108 | |
109 | 109 | |
110 | - if(!$this->variablesChanged() && $this->isCached($fileNameCSS, $folder)) { |
|
110 | + if (!$this->variablesChanged() && $this->isCached($fileNameCSS, $folder)) { |
|
111 | 111 | return true; |
112 | 112 | } |
113 | 113 | return $this->cache($path, $fileNameCSS, $fileNameSCSS, $folder, $webDir); |
@@ -133,13 +133,13 @@ discard block |
||
133 | 133 | try { |
134 | 134 | $cachedFile = $folder->getFile($fileNameCSS); |
135 | 135 | if ($cachedFile->getSize() > 0) { |
136 | - $depFileName = $fileNameCSS . '.deps'; |
|
137 | - $deps = $this->depsCache->get($folder->getName() . '-' . $depFileName); |
|
136 | + $depFileName = $fileNameCSS.'.deps'; |
|
137 | + $deps = $this->depsCache->get($folder->getName().'-'.$depFileName); |
|
138 | 138 | if ($deps === null) { |
139 | 139 | $depFile = $folder->getFile($depFileName); |
140 | 140 | $deps = $depFile->getContent(); |
141 | 141 | //Set to memcache for next run |
142 | - $this->depsCache->set($folder->getName() . '-' . $depFileName, $deps); |
|
142 | + $this->depsCache->set($folder->getName().'-'.$depFileName, $deps); |
|
143 | 143 | } |
144 | 144 | $deps = json_decode($deps, true); |
145 | 145 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | } |
152 | 152 | return true; |
153 | - } catch(NotFoundException $e) { |
|
153 | + } catch (NotFoundException $e) { |
|
154 | 154 | return false; |
155 | 155 | } |
156 | 156 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | private function variablesChanged() { |
163 | 163 | $injectedVariables = $this->getInjectedVariables(); |
164 | - if($this->config->getAppValue('core', 'scss.variables') !== md5($injectedVariables)) { |
|
164 | + if ($this->config->getAppValue('core', 'scss.variables') !== md5($injectedVariables)) { |
|
165 | 165 | $this->resetCache(); |
166 | 166 | $this->config->setAppValue('core', 'scss.variables', md5($injectedVariables)); |
167 | 167 | return true; |
@@ -182,9 +182,9 @@ discard block |
||
182 | 182 | $scss = new Compiler(); |
183 | 183 | $scss->setImportPaths([ |
184 | 184 | $path, |
185 | - \OC::$SERVERROOT . '/core/css/', |
|
185 | + \OC::$SERVERROOT.'/core/css/', |
|
186 | 186 | ]); |
187 | - if($this->config->getSystemValue('debug')) { |
|
187 | + if ($this->config->getSystemValue('debug')) { |
|
188 | 188 | // Debug mode |
189 | 189 | $scss->setFormatter(Expanded::class); |
190 | 190 | $scss->setLineNumberStyle(Compiler::LINE_COMMENTS); |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | |
196 | 196 | try { |
197 | 197 | $cachedfile = $folder->getFile($fileNameCSS); |
198 | - } catch(NotFoundException $e) { |
|
198 | + } catch (NotFoundException $e) { |
|
199 | 199 | $cachedfile = $folder->newFile($fileNameCSS); |
200 | 200 | } |
201 | 201 | |
202 | - $depFileName = $fileNameCSS . '.deps'; |
|
202 | + $depFileName = $fileNameCSS.'.deps'; |
|
203 | 203 | try { |
204 | 204 | $depFile = $folder->getFile($depFileName); |
205 | 205 | } catch (NotFoundException $e) { |
@@ -209,10 +209,10 @@ discard block |
||
209 | 209 | // Compile |
210 | 210 | try { |
211 | 211 | $compiledScss = $scss->compile( |
212 | - '@import "variables.scss";' . |
|
213 | - $this->getInjectedVariables() . |
|
212 | + '@import "variables.scss";'. |
|
213 | + $this->getInjectedVariables(). |
|
214 | 214 | '@import "'.$fileNameSCSS.'";'); |
215 | - } catch(ParserException $e) { |
|
215 | + } catch (ParserException $e) { |
|
216 | 216 | $this->logger->error($e, ['app' => 'core']); |
217 | 217 | return false; |
218 | 218 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $depFile->putContent(json_encode($scss->getParsedFiles())); |
223 | 223 | $this->logger->debug($webDir.'/'.$fileNameSCSS.' compiled and successfully cached', ['app' => 'core']); |
224 | 224 | return true; |
225 | - } catch(NotPermittedException $e) { |
|
225 | + } catch (NotPermittedException $e) { |
|
226 | 226 | return false; |
227 | 227 | } |
228 | 228 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | private function resetCache() { |
235 | 235 | $appDirectory = $this->appData->getDirectoryListing(); |
236 | - if(empty($appDirectory)){ |
|
236 | + if (empty($appDirectory)) { |
|
237 | 237 | return; |
238 | 238 | } |
239 | 239 | foreach ($appDirectory as $folder) { |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | private function getInjectedVariables() { |
252 | 252 | $variables = ''; |
253 | 253 | foreach ($this->defaults->getScssVariables() as $key => $value) { |
254 | - $variables .= '$' . $key . ': ' . $value . ';'; |
|
254 | + $variables .= '$'.$key.': '.$value.';'; |
|
255 | 255 | } |
256 | 256 | return $variables; |
257 | 257 | } |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | private function rebaseUrls($css, $webDir) { |
266 | 266 | $re = '/url\([\'"]([\.\w?=\/-]*)[\'"]\)/x'; |
267 | 267 | // OC\Route\Router:75 |
268 | - if(($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) { |
|
268 | + if (($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) { |
|
269 | 269 | $subst = 'url(\'../../'.$webDir.'/$1\')'; |
270 | 270 | } else { |
271 | 271 | $subst = 'url(\'../../../'.$webDir.'/$1\')'; |
@@ -333,8 +333,8 @@ discard block |
||
333 | 333 | * We cannot rely on automatic caching done by \OC_Util::addStyle, |
334 | 334 | * since we need to add the cacheBuster value to the url |
335 | 335 | */ |
336 | - $cssCached = $this->scssCacher->process(\OC::$SERVERROOT, $appPath . '/css/theming.scss', 'theming'); |
|
337 | - if(!$cssCached) { |
|
336 | + $cssCached = $this->scssCacher->process(\OC::$SERVERROOT, $appPath.'/css/theming.scss', 'theming'); |
|
337 | + if (!$cssCached) { |
|
338 | 338 | return new NotFoundResponse(); |
339 | 339 | } |
340 | 340 | |
@@ -363,12 +363,12 @@ discard block |
||
363 | 363 | $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0'); |
364 | 364 | $responseJS = '(function() { |
365 | 365 | OCA.Theming = { |
366 | - name: ' . json_encode($this->themingDefaults->getName()) . ', |
|
367 | - url: ' . json_encode($this->themingDefaults->getBaseUrl()) . ', |
|
368 | - slogan: ' . json_encode($this->themingDefaults->getSlogan()) . ', |
|
369 | - color: ' . json_encode($this->themingDefaults->getMailHeaderColor()) . ', |
|
370 | - inverted: ' . json_encode($this->util->invertTextColor($this->themingDefaults->getMailHeaderColor())) . ', |
|
371 | - cacheBuster: ' . json_encode($cacheBusterValue) . ' |
|
366 | + name: ' . json_encode($this->themingDefaults->getName()).', |
|
367 | + url: ' . json_encode($this->themingDefaults->getBaseUrl()).', |
|
368 | + slogan: ' . json_encode($this->themingDefaults->getSlogan()).', |
|
369 | + color: ' . json_encode($this->themingDefaults->getMailHeaderColor()).', |
|
370 | + inverted: ' . json_encode($this->util->invertTextColor($this->themingDefaults->getMailHeaderColor())).', |
|
371 | + cacheBuster: ' . json_encode($cacheBusterValue).' |
|
372 | 372 | }; |
373 | 373 | })();'; |
374 | 374 | $response = new DataDownloadResponse($responseJS, 'javascript', 'text/javascript'); |
@@ -52,46 +52,46 @@ discard block |
||
52 | 52 | * @param string $renderAs |
53 | 53 | * @param string $appId application id |
54 | 54 | */ |
55 | - public function __construct( $renderAs, $appId = '' ) { |
|
55 | + public function __construct($renderAs, $appId = '') { |
|
56 | 56 | |
57 | 57 | // yes - should be injected .... |
58 | 58 | $this->config = \OC::$server->getConfig(); |
59 | 59 | |
60 | 60 | |
61 | 61 | // Decide which page we show |
62 | - if($renderAs == 'user') { |
|
63 | - parent::__construct( 'core', 'layout.user' ); |
|
64 | - if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) { |
|
62 | + if ($renderAs == 'user') { |
|
63 | + parent::__construct('core', 'layout.user'); |
|
64 | + if (in_array(\OC_App::getCurrentApp(), ['settings', 'admin', 'help']) !== false) { |
|
65 | 65 | $this->assign('bodyid', 'body-settings'); |
66 | - }else{ |
|
66 | + } else { |
|
67 | 67 | $this->assign('bodyid', 'body-user'); |
68 | 68 | } |
69 | 69 | |
70 | 70 | // Code integrity notification |
71 | 71 | $integrityChecker = \OC::$server->getIntegrityCodeChecker(); |
72 | - if(\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) { |
|
72 | + if (\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) { |
|
73 | 73 | \OCP\Util::addScript('core', 'integritycheck-failed-notification'); |
74 | 74 | } |
75 | 75 | |
76 | 76 | // Add navigation entry |
77 | - $this->assign( 'application', ''); |
|
78 | - $this->assign( 'appid', $appId ); |
|
77 | + $this->assign('application', ''); |
|
78 | + $this->assign('appid', $appId); |
|
79 | 79 | $navigation = \OC_App::getNavigation(); |
80 | - $this->assign( 'navigation', $navigation); |
|
80 | + $this->assign('navigation', $navigation); |
|
81 | 81 | $navigation = \OC_App::getHeaderNavigation(); |
82 | - $this->assign( 'headernavigation', $navigation); |
|
82 | + $this->assign('headernavigation', $navigation); |
|
83 | 83 | $settingsNavigation = \OC_App::getSettingsNavigation(); |
84 | - $this->assign( 'settingsnavigation', $settingsNavigation); |
|
85 | - foreach($navigation as $entry) { |
|
84 | + $this->assign('settingsnavigation', $settingsNavigation); |
|
85 | + foreach ($navigation as $entry) { |
|
86 | 86 | if ($entry['active']) { |
87 | - $this->assign( 'application', $entry['name'] ); |
|
87 | + $this->assign('application', $entry['name']); |
|
88 | 88 | break; |
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
92 | - foreach($settingsNavigation as $entry) { |
|
92 | + foreach ($settingsNavigation as $entry) { |
|
93 | 93 | if ($entry['active']) { |
94 | - $this->assign( 'application', $entry['name'] ); |
|
94 | + $this->assign('application', $entry['name']); |
|
95 | 95 | break; |
96 | 96 | } |
97 | 97 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | // Send the language to our layouts |
126 | 126 | $this->assign('language', \OC::$server->getL10NFactory()->findLanguage()); |
127 | 127 | |
128 | - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
128 | + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
129 | 129 | if (empty(self::$versionHash)) { |
130 | 130 | $v = \OC_App::getAppVersions(); |
131 | 131 | $v['core'] = implode('.', \OCP\Util::getVersion()); |
@@ -156,10 +156,10 @@ discard block |
||
156 | 156 | $this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash])); |
157 | 157 | } |
158 | 158 | } |
159 | - foreach($jsFiles as $info) { |
|
159 | + foreach ($jsFiles as $info) { |
|
160 | 160 | $web = $info[1]; |
161 | 161 | $file = $info[2]; |
162 | - $this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
162 | + $this->append('jsfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | try { |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | // Do not initialise scss appdata until we have a fully installed instance |
172 | 172 | // Do not load scss for update, errors, installation or login page |
173 | - if(\OC::$server->getSystemConfig()->getValue('installed', false) |
|
173 | + if (\OC::$server->getSystemConfig()->getValue('installed', false) |
|
174 | 174 | && !\OCP\Util::needUpgrade() |
175 | 175 | && $pathInfo !== '' |
176 | 176 | && !preg_match('/^\/login/', $pathInfo)) { |
@@ -185,25 +185,25 @@ discard block |
||
185 | 185 | $this->assign('cssfiles', array()); |
186 | 186 | $this->assign('printcssfiles', []); |
187 | 187 | $this->assign('versionHash', self::$versionHash); |
188 | - foreach($cssFiles as $info) { |
|
188 | + foreach ($cssFiles as $info) { |
|
189 | 189 | $web = $info[1]; |
190 | 190 | $file = $info[2]; |
191 | 191 | |
192 | 192 | if (substr($file, -strlen('print.css')) === 'print.css') { |
193 | - $this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
193 | + $this->append('printcssfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
194 | 194 | } else { |
195 | - $this->append( 'cssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
195 | + $this->append('cssfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
200 | 200 | protected function getVersionHashSuffix() { |
201 | - if(\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
201 | + if (\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
202 | 202 | // allows chrome workspace mapping in debug mode |
203 | 203 | return ""; |
204 | 204 | } |
205 | 205 | |
206 | - return '?v=' . self::$versionHash; |
|
206 | + return '?v='.self::$versionHash; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | // Read the selected theme from the config file |
215 | 215 | $theme = \OC_Util::getTheme(); |
216 | 216 | |
217 | - if($compileScss) { |
|
217 | + if ($compileScss) { |
|
218 | 218 | $SCSSCacher = \OC::$server->query(SCSSCacher::class); |
219 | 219 | } else { |
220 | 220 | $SCSSCacher = null; |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | $locator = new \OC\Template\CSSResourceLocator( |
224 | 224 | \OC::$server->getLogger(), |
225 | 225 | $theme, |
226 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
227 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
226 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
227 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
228 | 228 | $SCSSCacher |
229 | 229 | ); |
230 | 230 | $locator->find($styles); |
@@ -242,8 +242,8 @@ discard block |
||
242 | 242 | $locator = new \OC\Template\JSResourceLocator( |
243 | 243 | \OC::$server->getLogger(), |
244 | 244 | $theme, |
245 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
246 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
245 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
246 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
247 | 247 | new JSCombiner( |
248 | 248 | \OC::$server->getAppDataDir('js'), |
249 | 249 | \OC::$server->getURLGenerator(), |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | */ |
264 | 264 | public static function convertToRelativePath($filePath) { |
265 | 265 | $relativePath = explode(\OC::$SERVERROOT, $filePath); |
266 | - if(count($relativePath) !== 2) { |
|
266 | + if (count($relativePath) !== 2) { |
|
267 | 267 | throw new \Exception('$filePath is not under the \OC::$SERVERROOT'); |
268 | 268 | } |
269 | 269 |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | |
113 | 113 | public function getShortFooter() { |
114 | 114 | $slogan = $this->getSlogan(); |
115 | - $footer = '<a href="'. $this->getBaseUrl() . '" target="_blank"' . |
|
116 | - ' rel="noreferrer">' .$this->getEntity() . '</a>'. |
|
117 | - ($slogan !== '' ? ' – ' . $slogan : ''); |
|
115 | + $footer = '<a href="'.$this->getBaseUrl().'" target="_blank"'. |
|
116 | + ' rel="noreferrer">'.$this->getEntity().'</a>'. |
|
117 | + ($slogan !== '' ? ' – '.$slogan : ''); |
|
118 | 118 | |
119 | 119 | return $footer; |
120 | 120 | } |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | $file = null; |
141 | 141 | } |
142 | 142 | $logo = $this->config->getAppValue('theming', 'logoMime', false); |
143 | - if(!$logo || $file === null) { |
|
144 | - return $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core','logo.svg')); |
|
143 | + if (!$logo || $file === null) { |
|
144 | + return $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'logo.svg')); |
|
145 | 145 | } else { |
146 | 146 | return $this->urlGenerator->linkToRouteAbsolute('theming.Theming.getLogo'); |
147 | 147 | } |
@@ -159,8 +159,8 @@ discard block |
||
159 | 159 | $file = null; |
160 | 160 | } |
161 | 161 | $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime', false); |
162 | - if(!$backgroundLogo || $file === null) { |
|
163 | - return $this->urlGenerator->imagePath('core','background.jpg'); |
|
162 | + if (!$backgroundLogo || $file === null) { |
|
163 | + return $this->urlGenerator->imagePath('core', 'background.jpg'); |
|
164 | 164 | } else { |
165 | 165 | return $this->urlGenerator->linkToRouteAbsolute('theming.Theming.getLoginBackground'); |
166 | 166 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | } |
178 | 178 | |
179 | 179 | $variables = [ |
180 | - 'theming-cachebuster' => "'" . $this->config->getAppValue('theming', 'cachebuster', '0') . "'", |
|
180 | + 'theming-cachebuster' => "'".$this->config->getAppValue('theming', 'cachebuster', '0')."'", |
|
181 | 181 | ]; |
182 | 182 | |
183 | 183 | $variables['image-logo'] = "'".$this->getLogo()."'"; |
@@ -204,11 +204,11 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function shouldReplaceIcons() { |
206 | 206 | $cache = $this->cacheFactory->create('theming'); |
207 | - if($value = $cache->get('shouldReplaceIcons')) { |
|
208 | - return (bool)$value; |
|
207 | + if ($value = $cache->get('shouldReplaceIcons')) { |
|
208 | + return (bool) $value; |
|
209 | 209 | } |
210 | 210 | $value = false; |
211 | - if(extension_loaded('imagick')) { |
|
211 | + if (extension_loaded('imagick')) { |
|
212 | 212 | $checkImagick = new \Imagick(); |
213 | 213 | if (count($checkImagick->queryFormats('SVG')) >= 1) { |
214 | 214 | $value = true; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | private function increaseCacheBuster() { |
226 | 226 | $cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0'); |
227 | - $this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1); |
|
227 | + $this->config->setAppValue('theming', 'cachebuster', (int) $cacheBusterKey + 1); |
|
228 | 228 | $this->cacheFactory->create('theming')->clear('getScssVariables'); |
229 | 229 | } |
230 | 230 |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $this->registerAlias(\OCP\Contacts\IManager::class, \OC\ContactsManager::class); |
134 | 134 | $this->registerAlias('ContactsManager', \OCP\Contacts\IManager::class); |
135 | 135 | |
136 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
136 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
137 | 137 | return new PreviewManager( |
138 | 138 | $c->getConfig(), |
139 | 139 | $c->getRootFolder(), |
@@ -144,13 +144,13 @@ discard block |
||
144 | 144 | }); |
145 | 145 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
146 | 146 | |
147 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
147 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
148 | 148 | return new \OC\Preview\Watcher( |
149 | 149 | $c->getAppDataDir('preview') |
150 | 150 | ); |
151 | 151 | }); |
152 | 152 | |
153 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
153 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
154 | 154 | $view = new View(); |
155 | 155 | $util = new Encryption\Util( |
156 | 156 | $view, |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | ); |
169 | 169 | }); |
170 | 170 | |
171 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
171 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
172 | 172 | $util = new Encryption\Util( |
173 | 173 | new View(), |
174 | 174 | $c->getUserManager(), |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | return new Encryption\File($util); |
179 | 179 | }); |
180 | 180 | |
181 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
181 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
182 | 182 | $view = new View(); |
183 | 183 | $util = new Encryption\Util( |
184 | 184 | $view, |
@@ -189,32 +189,32 @@ discard block |
||
189 | 189 | |
190 | 190 | return new Encryption\Keys\Storage($view, $util); |
191 | 191 | }); |
192 | - $this->registerService('TagMapper', function (Server $c) { |
|
192 | + $this->registerService('TagMapper', function(Server $c) { |
|
193 | 193 | return new TagMapper($c->getDatabaseConnection()); |
194 | 194 | }); |
195 | 195 | |
196 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
196 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
197 | 197 | $tagMapper = $c->query('TagMapper'); |
198 | 198 | return new TagManager($tagMapper, $c->getUserSession()); |
199 | 199 | }); |
200 | 200 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
201 | 201 | |
202 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
202 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
203 | 203 | $config = $c->getConfig(); |
204 | 204 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory'); |
205 | 205 | /** @var \OC\SystemTag\ManagerFactory $factory */ |
206 | 206 | $factory = new $factoryClass($this); |
207 | 207 | return $factory; |
208 | 208 | }); |
209 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
209 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
210 | 210 | return $c->query('SystemTagManagerFactory')->getManager(); |
211 | 211 | }); |
212 | 212 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
213 | 213 | |
214 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
214 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
215 | 215 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
216 | 216 | }); |
217 | - $this->registerService('RootFolder', function (Server $c) { |
|
217 | + $this->registerService('RootFolder', function(Server $c) { |
|
218 | 218 | $manager = \OC\Files\Filesystem::getMountManager(null); |
219 | 219 | $view = new View(); |
220 | 220 | $root = new Root( |
@@ -242,30 +242,30 @@ discard block |
||
242 | 242 | }); |
243 | 243 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
244 | 244 | |
245 | - $this->registerService(\OCP\IUserManager::class, function (Server $c) { |
|
245 | + $this->registerService(\OCP\IUserManager::class, function(Server $c) { |
|
246 | 246 | $config = $c->getConfig(); |
247 | 247 | return new \OC\User\Manager($config); |
248 | 248 | }); |
249 | 249 | $this->registerAlias('UserManager', \OCP\IUserManager::class); |
250 | 250 | |
251 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
251 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
252 | 252 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
253 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
253 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
254 | 254 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
255 | 255 | }); |
256 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
256 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
257 | 257 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
258 | 258 | }); |
259 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
259 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
260 | 260 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
261 | 261 | }); |
262 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
262 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
263 | 263 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
264 | 264 | }); |
265 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
265 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
266 | 266 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
267 | 267 | }); |
268 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
268 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
269 | 269 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
270 | 270 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
271 | 271 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -285,11 +285,11 @@ discard block |
||
285 | 285 | return new Store($session, $logger, $tokenProvider); |
286 | 286 | }); |
287 | 287 | $this->registerAlias(IStore::class, Store::class); |
288 | - $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) { |
|
288 | + $this->registerService('OC\Authentication\Token\DefaultTokenMapper', function(Server $c) { |
|
289 | 289 | $dbConnection = $c->getDatabaseConnection(); |
290 | 290 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
291 | 291 | }); |
292 | - $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function (Server $c) { |
|
292 | + $this->registerService('OC\Authentication\Token\DefaultTokenProvider', function(Server $c) { |
|
293 | 293 | $mapper = $c->query('OC\Authentication\Token\DefaultTokenMapper'); |
294 | 294 | $crypto = $c->getCrypto(); |
295 | 295 | $config = $c->getConfig(); |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | }); |
300 | 300 | $this->registerAlias('OC\Authentication\Token\IProvider', 'OC\Authentication\Token\DefaultTokenProvider'); |
301 | 301 | |
302 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
302 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
303 | 303 | $manager = $c->getUserManager(); |
304 | 304 | $session = new \OC\Session\Memory(''); |
305 | 305 | $timeFactory = new TimeFactory(); |
@@ -312,40 +312,40 @@ discard block |
||
312 | 312 | } |
313 | 313 | |
314 | 314 | $userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $c->getConfig(), $c->getSecureRandom()); |
315 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
315 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
316 | 316 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
317 | 317 | }); |
318 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
318 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
319 | 319 | /** @var $user \OC\User\User */ |
320 | 320 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
321 | 321 | }); |
322 | - $userSession->listen('\OC\User', 'preDelete', function ($user) { |
|
322 | + $userSession->listen('\OC\User', 'preDelete', function($user) { |
|
323 | 323 | /** @var $user \OC\User\User */ |
324 | 324 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
325 | 325 | }); |
326 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
326 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
327 | 327 | /** @var $user \OC\User\User */ |
328 | 328 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
329 | 329 | }); |
330 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
330 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
331 | 331 | /** @var $user \OC\User\User */ |
332 | 332 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
333 | 333 | }); |
334 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
334 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
335 | 335 | /** @var $user \OC\User\User */ |
336 | 336 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
337 | 337 | }); |
338 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
338 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
339 | 339 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
340 | 340 | }); |
341 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
341 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
342 | 342 | /** @var $user \OC\User\User */ |
343 | 343 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
344 | 344 | }); |
345 | - $userSession->listen('\OC\User', 'logout', function () { |
|
345 | + $userSession->listen('\OC\User', 'logout', function() { |
|
346 | 346 | \OC_Hook::emit('OC_User', 'logout', array()); |
347 | 347 | }); |
348 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value) { |
|
348 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value) { |
|
349 | 349 | /** @var $user \OC\User\User */ |
350 | 350 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value)); |
351 | 351 | }); |
@@ -353,14 +353,14 @@ discard block |
||
353 | 353 | }); |
354 | 354 | $this->registerAlias('UserSession', \OCP\IUserSession::class); |
355 | 355 | |
356 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
356 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
357 | 357 | return new \OC\Authentication\TwoFactorAuth\Manager($c->getAppManager(), $c->getSession(), $c->getConfig(), $c->getActivityManager(), $c->getLogger()); |
358 | 358 | }); |
359 | 359 | |
360 | 360 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
361 | 361 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
362 | 362 | |
363 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
363 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
364 | 364 | return new \OC\AllConfig( |
365 | 365 | $c->getSystemConfig() |
366 | 366 | ); |
@@ -368,17 +368,17 @@ discard block |
||
368 | 368 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
369 | 369 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
370 | 370 | |
371 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
371 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
372 | 372 | return new \OC\SystemConfig($config); |
373 | 373 | }); |
374 | 374 | |
375 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
375 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
376 | 376 | return new \OC\AppConfig($c->getDatabaseConnection()); |
377 | 377 | }); |
378 | 378 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
379 | 379 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
380 | 380 | |
381 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
381 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
382 | 382 | return new \OC\L10N\Factory( |
383 | 383 | $c->getConfig(), |
384 | 384 | $c->getRequest(), |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | }); |
389 | 389 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
390 | 390 | |
391 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
391 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
392 | 392 | $config = $c->getConfig(); |
393 | 393 | $cacheFactory = $c->getMemCacheFactory(); |
394 | 394 | return new \OC\URLGenerator( |
@@ -398,10 +398,10 @@ discard block |
||
398 | 398 | }); |
399 | 399 | $this->registerAlias('URLGenerator', \OCP\IURLGenerator::class); |
400 | 400 | |
401 | - $this->registerService('AppHelper', function ($c) { |
|
401 | + $this->registerService('AppHelper', function($c) { |
|
402 | 402 | return new \OC\AppHelper(); |
403 | 403 | }); |
404 | - $this->registerService('AppFetcher', function ($c) { |
|
404 | + $this->registerService('AppFetcher', function($c) { |
|
405 | 405 | return new AppFetcher( |
406 | 406 | $this->getAppDataDir('appstore'), |
407 | 407 | $this->getHTTPClientService(), |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | $this->getConfig() |
410 | 410 | ); |
411 | 411 | }); |
412 | - $this->registerService('CategoryFetcher', function ($c) { |
|
412 | + $this->registerService('CategoryFetcher', function($c) { |
|
413 | 413 | return new CategoryFetcher( |
414 | 414 | $this->getAppDataDir('appstore'), |
415 | 415 | $this->getHTTPClientService(), |
@@ -418,21 +418,21 @@ discard block |
||
418 | 418 | ); |
419 | 419 | }); |
420 | 420 | |
421 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
421 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
422 | 422 | return new Cache\File(); |
423 | 423 | }); |
424 | 424 | $this->registerAlias('UserCache', \OCP\ICache::class); |
425 | 425 | |
426 | - $this->registerService(Factory::class, function (Server $c) { |
|
426 | + $this->registerService(Factory::class, function(Server $c) { |
|
427 | 427 | $config = $c->getConfig(); |
428 | 428 | |
429 | 429 | if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) { |
430 | 430 | $v = \OC_App::getAppVersions(); |
431 | - $v['core'] = md5(file_get_contents(\OC::$SERVERROOT . '/version.php')); |
|
431 | + $v['core'] = md5(file_get_contents(\OC::$SERVERROOT.'/version.php')); |
|
432 | 432 | $version = implode(',', $v); |
433 | 433 | $instanceId = \OC_Util::getInstanceId(); |
434 | 434 | $path = \OC::$SERVERROOT; |
435 | - $prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . \OC::$WEBROOT); |
|
435 | + $prefix = md5($instanceId.'-'.$version.'-'.$path.'-'.\OC::$WEBROOT); |
|
436 | 436 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
437 | 437 | $config->getSystemValue('memcache.local', null), |
438 | 438 | $config->getSystemValue('memcache.distributed', null), |
@@ -449,12 +449,12 @@ discard block |
||
449 | 449 | $this->registerAlias('MemCacheFactory', Factory::class); |
450 | 450 | $this->registerAlias(ICacheFactory::class, Factory::class); |
451 | 451 | |
452 | - $this->registerService('RedisFactory', function (Server $c) { |
|
452 | + $this->registerService('RedisFactory', function(Server $c) { |
|
453 | 453 | $systemConfig = $c->getSystemConfig(); |
454 | 454 | return new RedisFactory($systemConfig); |
455 | 455 | }); |
456 | 456 | |
457 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
457 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
458 | 458 | return new \OC\Activity\Manager( |
459 | 459 | $c->getRequest(), |
460 | 460 | $c->getUserSession(), |
@@ -464,14 +464,14 @@ discard block |
||
464 | 464 | }); |
465 | 465 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
466 | 466 | |
467 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
467 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
468 | 468 | return new \OC\Activity\EventMerger( |
469 | 469 | $c->getL10N('lib') |
470 | 470 | ); |
471 | 471 | }); |
472 | 472 | $this->registerAlias(IValidator::class, Validator::class); |
473 | 473 | |
474 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
474 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
475 | 475 | return new AvatarManager( |
476 | 476 | $c->getUserManager(), |
477 | 477 | $c->getAppDataDir('avatar'), |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | }); |
483 | 483 | $this->registerAlias('AvatarManager', \OCP\IAvatarManager::class); |
484 | 484 | |
485 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
485 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
486 | 486 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
487 | 487 | $logger = Log::getLogClass($logType); |
488 | 488 | call_user_func(array($logger, 'init')); |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | }); |
492 | 492 | $this->registerAlias('Logger', \OCP\ILogger::class); |
493 | 493 | |
494 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
494 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
495 | 495 | $config = $c->getConfig(); |
496 | 496 | return new \OC\BackgroundJob\JobList( |
497 | 497 | $c->getDatabaseConnection(), |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | }); |
502 | 502 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
503 | 503 | |
504 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
504 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
505 | 505 | $cacheFactory = $c->getMemCacheFactory(); |
506 | 506 | $logger = $c->getLogger(); |
507 | 507 | if ($cacheFactory->isAvailable()) { |
@@ -513,32 +513,32 @@ discard block |
||
513 | 513 | }); |
514 | 514 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
515 | 515 | |
516 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
516 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
517 | 517 | return new Search(); |
518 | 518 | }); |
519 | 519 | $this->registerAlias('Search', \OCP\ISearch::class); |
520 | 520 | |
521 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
521 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
522 | 522 | return new SecureRandom(); |
523 | 523 | }); |
524 | 524 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
525 | 525 | |
526 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
526 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
527 | 527 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
528 | 528 | }); |
529 | 529 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
530 | 530 | |
531 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
531 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
532 | 532 | return new Hasher($c->getConfig()); |
533 | 533 | }); |
534 | 534 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
535 | 535 | |
536 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
536 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
537 | 537 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
538 | 538 | }); |
539 | 539 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
540 | 540 | |
541 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
541 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
542 | 542 | $systemConfig = $c->getSystemConfig(); |
543 | 543 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
544 | 544 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | }); |
553 | 553 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
554 | 554 | |
555 | - $this->registerService('HTTPHelper', function (Server $c) { |
|
555 | + $this->registerService('HTTPHelper', function(Server $c) { |
|
556 | 556 | $config = $c->getConfig(); |
557 | 557 | return new HTTPHelper( |
558 | 558 | $config, |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | ); |
561 | 561 | }); |
562 | 562 | |
563 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
563 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
564 | 564 | $user = \OC_User::getUser(); |
565 | 565 | $uid = $user ? $user : null; |
566 | 566 | return new ClientService( |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | }); |
571 | 571 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
572 | 572 | |
573 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
573 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
574 | 574 | if ($c->getSystemConfig()->getValue('debug', false)) { |
575 | 575 | return new EventLogger(); |
576 | 576 | } else { |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | }); |
580 | 580 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
581 | 581 | |
582 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
582 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
583 | 583 | if ($c->getSystemConfig()->getValue('debug', false)) { |
584 | 584 | return new QueryLogger(); |
585 | 585 | } else { |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | }); |
589 | 589 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
590 | 590 | |
591 | - $this->registerService(TempManager::class, function (Server $c) { |
|
591 | + $this->registerService(TempManager::class, function(Server $c) { |
|
592 | 592 | return new TempManager( |
593 | 593 | $c->getLogger(), |
594 | 594 | $c->getConfig() |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | $this->registerAlias('TempManager', TempManager::class); |
598 | 598 | $this->registerAlias(ITempManager::class, TempManager::class); |
599 | 599 | |
600 | - $this->registerService(AppManager::class, function (Server $c) { |
|
600 | + $this->registerService(AppManager::class, function(Server $c) { |
|
601 | 601 | return new \OC\App\AppManager( |
602 | 602 | $c->getUserSession(), |
603 | 603 | $c->getAppConfig(), |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | $this->registerAlias('AppManager', AppManager::class); |
610 | 610 | $this->registerAlias(IAppManager::class, AppManager::class); |
611 | 611 | |
612 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
612 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
613 | 613 | return new DateTimeZone( |
614 | 614 | $c->getConfig(), |
615 | 615 | $c->getSession() |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | }); |
618 | 618 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
619 | 619 | |
620 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
620 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
621 | 621 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
622 | 622 | |
623 | 623 | return new DateTimeFormatter( |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | }); |
628 | 628 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
629 | 629 | |
630 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
630 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
631 | 631 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
632 | 632 | $listener = new UserMountCacheListener($mountCache); |
633 | 633 | $listener->listen($c->getUserManager()); |
@@ -635,10 +635,10 @@ discard block |
||
635 | 635 | }); |
636 | 636 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
637 | 637 | |
638 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
638 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
639 | 639 | $loader = \OC\Files\Filesystem::getLoader(); |
640 | 640 | $mountCache = $c->query('UserMountCache'); |
641 | - $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
641 | + $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
|
642 | 642 | |
643 | 643 | // builtin providers |
644 | 644 | |
@@ -651,14 +651,14 @@ discard block |
||
651 | 651 | }); |
652 | 652 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
653 | 653 | |
654 | - $this->registerService('IniWrapper', function ($c) { |
|
654 | + $this->registerService('IniWrapper', function($c) { |
|
655 | 655 | return new IniGetWrapper(); |
656 | 656 | }); |
657 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
657 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
658 | 658 | $jobList = $c->getJobList(); |
659 | 659 | return new AsyncBus($jobList); |
660 | 660 | }); |
661 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
661 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
662 | 662 | return new TrustedDomainHelper($this->getConfig()); |
663 | 663 | }); |
664 | 664 | $this->registerService('Throttler', function(Server $c) { |
@@ -669,10 +669,10 @@ discard block |
||
669 | 669 | $c->getConfig() |
670 | 670 | ); |
671 | 671 | }); |
672 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
672 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
673 | 673 | // IConfig and IAppManager requires a working database. This code |
674 | 674 | // might however be called when ownCloud is not yet setup. |
675 | - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
675 | + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
676 | 676 | $config = $c->getConfig(); |
677 | 677 | $appManager = $c->getAppManager(); |
678 | 678 | } else { |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | $c->getTempManager() |
691 | 691 | ); |
692 | 692 | }); |
693 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
693 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
694 | 694 | if (isset($this['urlParams'])) { |
695 | 695 | $urlParams = $this['urlParams']; |
696 | 696 | } else { |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | }); |
727 | 727 | $this->registerAlias('Request', \OCP\IRequest::class); |
728 | 728 | |
729 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
729 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
730 | 730 | return new Mailer( |
731 | 731 | $c->getConfig(), |
732 | 732 | $c->getLogger(), |
@@ -738,14 +738,14 @@ discard block |
||
738 | 738 | $this->registerService('LDAPProvider', function(Server $c) { |
739 | 739 | $config = $c->getConfig(); |
740 | 740 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
741 | - if(is_null($factoryClass)) { |
|
741 | + if (is_null($factoryClass)) { |
|
742 | 742 | throw new \Exception('ldapProviderFactory not set'); |
743 | 743 | } |
744 | 744 | /** @var \OCP\LDAP\ILDAPProviderFactory $factory */ |
745 | 745 | $factory = new $factoryClass($this); |
746 | 746 | return $factory->getLDAPProvider(); |
747 | 747 | }); |
748 | - $this->registerService('LockingProvider', function (Server $c) { |
|
748 | + $this->registerService('LockingProvider', function(Server $c) { |
|
749 | 749 | $ini = $c->getIniWrapper(); |
750 | 750 | $config = $c->getConfig(); |
751 | 751 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -761,37 +761,37 @@ discard block |
||
761 | 761 | return new NoopLockingProvider(); |
762 | 762 | }); |
763 | 763 | |
764 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
764 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
765 | 765 | return new \OC\Files\Mount\Manager(); |
766 | 766 | }); |
767 | 767 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
768 | 768 | |
769 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
769 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
770 | 770 | return new \OC\Files\Type\Detection( |
771 | 771 | $c->getURLGenerator(), |
772 | 772 | \OC::$configDir, |
773 | - \OC::$SERVERROOT . '/resources/config/' |
|
773 | + \OC::$SERVERROOT.'/resources/config/' |
|
774 | 774 | ); |
775 | 775 | }); |
776 | 776 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
777 | 777 | |
778 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
778 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
779 | 779 | return new \OC\Files\Type\Loader( |
780 | 780 | $c->getDatabaseConnection() |
781 | 781 | ); |
782 | 782 | }); |
783 | 783 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
784 | 784 | |
785 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
785 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
786 | 786 | return new Manager( |
787 | 787 | $c->query(IValidator::class) |
788 | 788 | ); |
789 | 789 | }); |
790 | 790 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
791 | 791 | |
792 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
792 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
793 | 793 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
794 | - $manager->registerCapability(function () use ($c) { |
|
794 | + $manager->registerCapability(function() use ($c) { |
|
795 | 795 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
796 | 796 | }); |
797 | 797 | return $manager; |
@@ -848,13 +848,13 @@ discard block |
||
848 | 848 | |
849 | 849 | ); |
850 | 850 | }); |
851 | - $this->registerService(EventDispatcher::class, function () { |
|
851 | + $this->registerService(EventDispatcher::class, function() { |
|
852 | 852 | return new EventDispatcher(); |
853 | 853 | }); |
854 | 854 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
855 | 855 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
856 | 856 | |
857 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
857 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
858 | 858 | // FIXME: Instantiiated here due to cyclic dependency |
859 | 859 | $request = new Request( |
860 | 860 | [ |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | $request |
880 | 880 | ); |
881 | 881 | }); |
882 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
882 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
883 | 883 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
884 | 884 | |
885 | 885 | return new CsrfTokenManager( |
@@ -887,10 +887,10 @@ discard block |
||
887 | 887 | $c->query(SessionStorage::class) |
888 | 888 | ); |
889 | 889 | }); |
890 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
890 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
891 | 891 | return new SessionStorage($c->getSession()); |
892 | 892 | }); |
893 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
893 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
894 | 894 | return new ContentSecurityPolicyManager(); |
895 | 895 | }); |
896 | 896 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
@@ -941,23 +941,23 @@ discard block |
||
941 | 941 | ); |
942 | 942 | return $manager; |
943 | 943 | }); |
944 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
944 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
945 | 945 | return new \OC\Files\AppData\Factory( |
946 | 946 | $c->getRootFolder(), |
947 | 947 | $c->getSystemConfig() |
948 | 948 | ); |
949 | 949 | }); |
950 | 950 | |
951 | - $this->registerService('LockdownManager', function (Server $c) { |
|
951 | + $this->registerService('LockdownManager', function(Server $c) { |
|
952 | 952 | return new LockdownManager(); |
953 | 953 | }); |
954 | 954 | |
955 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
955 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
956 | 956 | return new CloudIdManager(); |
957 | 957 | }); |
958 | 958 | |
959 | 959 | /* To trick DI since we don't extend the DIContainer here */ |
960 | - $this->registerService(CleanPreviewsBackgroundJob::class, function (Server $c) { |
|
960 | + $this->registerService(CleanPreviewsBackgroundJob::class, function(Server $c) { |
|
961 | 961 | return new CleanPreviewsBackgroundJob( |
962 | 962 | $c->getRootFolder(), |
963 | 963 | $c->getLogger(), |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | * @deprecated since 9.2.0 use IAppData |
1112 | 1112 | */ |
1113 | 1113 | public function getAppFolder() { |
1114 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
1114 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
1115 | 1115 | $root = $this->getRootFolder(); |
1116 | 1116 | if (!$root->nodeExists($dir)) { |
1117 | 1117 | $folder = $root->newFolder($dir); |