@@ -71,17 +71,17 @@ |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $app = substr($script, 0, strpos($script, '/')); |
74 | - $script = substr($script, strpos($script, '/')+1); |
|
74 | + $script = substr($script, strpos($script, '/') + 1); |
|
75 | 75 | $app_path = \OC_App::getAppPath($app); |
76 | 76 | $app_url = \OC_App::getAppWebPath($app); |
77 | 77 | |
78 | 78 | // missing translations files fill be ignored |
79 | 79 | if (strpos($script, 'l10n/') === 0) { |
80 | - $this->appendIfExist($app_path, $script . '.js', $app_url); |
|
80 | + $this->appendIfExist($app_path, $script.'.js', $app_url); |
|
81 | 81 | return; |
82 | 82 | } |
83 | 83 | if (!$this->cacheAndAppendCombineJsonIfExist($app_path, $script.'.json', $app)) { |
84 | - $this->append($app_path, $script . '.js', $app_url); |
|
84 | + $this->append($app_path, $script.'.js', $app_url); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 |
@@ -53,16 +53,16 @@ discard block |
||
53 | 53 | |
54 | 54 | $container = $this->getContainer(); |
55 | 55 | |
56 | - $container->registerService('defaultMailAddress', function () { |
|
56 | + $container->registerService('defaultMailAddress', function() { |
|
57 | 57 | return Util::getDefaultEmailAddress('lostpassword-noreply'); |
58 | 58 | }); |
59 | - $container->registerService(Manager::class, function () { |
|
59 | + $container->registerService(Manager::class, function() { |
|
60 | 60 | return new Manager( |
61 | 61 | \OC::$server->getAppDataDir('identityproof'), |
62 | 62 | \OC::$server->getCrypto() |
63 | 63 | ); |
64 | 64 | }); |
65 | - $container->registerService(CssController::class, function () use ($container) { |
|
65 | + $container->registerService(CssController::class, function() use ($container) { |
|
66 | 66 | return new CssController( |
67 | 67 | $container->query('appName'), |
68 | 68 | $container->query(IRequest::class), |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $container->query(ITimeFactory::class) |
71 | 71 | ); |
72 | 72 | }); |
73 | - $container->registerService(OCJSController::class, function () use ($container) { |
|
73 | + $container->registerService(OCJSController::class, function() use ($container) { |
|
74 | 74 | /** @var Server $server */ |
75 | 75 | $server = $container->getServer(); |
76 | 76 | return new OCJSController( |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $server->getURLGenerator() |
90 | 90 | ); |
91 | 91 | }); |
92 | - $container->registerService(JsController::class, function () use ($container) { |
|
92 | + $container->registerService(JsController::class, function() use ($container) { |
|
93 | 93 | return new JsController( |
94 | 94 | $container->query('AppName'), |
95 | 95 | $container->query(IRequest::class), |
@@ -64,7 +64,7 @@ |
||
64 | 64 | try { |
65 | 65 | $folder = $this->appData->getFolder($appName); |
66 | 66 | $jsFile = $folder->getFile($fileName); |
67 | - } catch(NotFoundException $e) { |
|
67 | + } catch (NotFoundException $e) { |
|
68 | 68 | return new NotFoundResponse(); |
69 | 69 | } |
70 | 70 |
@@ -72,19 +72,19 @@ discard block |
||
72 | 72 | return false; |
73 | 73 | } |
74 | 74 | |
75 | - $path = explode('/', $root . '/' . $file); |
|
75 | + $path = explode('/', $root.'/'.$file); |
|
76 | 76 | |
77 | 77 | $fileName = array_pop($path); |
78 | 78 | $path = implode('/', $path); |
79 | 79 | |
80 | 80 | try { |
81 | 81 | $folder = $this->appData->getFolder($app); |
82 | - } catch(NotFoundException $e) { |
|
82 | + } catch (NotFoundException $e) { |
|
83 | 83 | // creating css appdata folder |
84 | 84 | $folder = $this->appData->newFolder($app); |
85 | 85 | } |
86 | 86 | |
87 | - if($this->isCached($fileName, $folder)) { |
|
87 | + if ($this->isCached($fileName, $folder)) { |
|
88 | 88 | return true; |
89 | 89 | } |
90 | 90 | return $this->cache($path, $fileName, $folder); |
@@ -96,13 +96,13 @@ discard block |
||
96 | 96 | * @return bool |
97 | 97 | */ |
98 | 98 | protected function isCached($fileName, ISimpleFolder $folder) { |
99 | - $fileName = str_replace('.json', '.js', $fileName) . '.deps'; |
|
99 | + $fileName = str_replace('.json', '.js', $fileName).'.deps'; |
|
100 | 100 | try { |
101 | - $deps = $this->depsCache->get($folder->getName() . '-' . $fileName); |
|
101 | + $deps = $this->depsCache->get($folder->getName().'-'.$fileName); |
|
102 | 102 | if ($deps === null) { |
103 | 103 | $depFile = $folder->getFile($fileName); |
104 | 104 | $deps = $depFile->getContent(); |
105 | - $this->depsCache->set($folder->getName() . '-' . $fileName, $deps); |
|
105 | + $this->depsCache->set($folder->getName().'-'.$fileName, $deps); |
|
106 | 106 | } |
107 | 107 | $deps = json_decode($deps, true); |
108 | 108 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | return true; |
116 | - } catch(NotFoundException $e) { |
|
116 | + } catch (NotFoundException $e) { |
|
117 | 117 | return false; |
118 | 118 | } |
119 | 119 | } |
@@ -126,17 +126,17 @@ discard block |
||
126 | 126 | */ |
127 | 127 | protected function cache($path, $fileName, ISimpleFolder $folder) { |
128 | 128 | $deps = []; |
129 | - $fullPath = $path . '/' . $fileName; |
|
129 | + $fullPath = $path.'/'.$fileName; |
|
130 | 130 | $data = json_decode(file_get_contents($fullPath)); |
131 | 131 | $deps[$fullPath] = filemtime($fullPath); |
132 | 132 | |
133 | 133 | $res = ''; |
134 | 134 | foreach ($data as $file) { |
135 | - $filePath = $path . '/' . $file; |
|
135 | + $filePath = $path.'/'.$file; |
|
136 | 136 | |
137 | 137 | if (is_file($filePath)) { |
138 | 138 | $res .= file_get_contents($filePath); |
139 | - $res .= PHP_EOL . PHP_EOL; |
|
139 | + $res .= PHP_EOL.PHP_EOL; |
|
140 | 140 | $deps[$filePath] = filemtime($filePath); |
141 | 141 | } |
142 | 142 | } |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | $fileName = str_replace('.json', '.js', $fileName); |
145 | 145 | try { |
146 | 146 | $cachedfile = $folder->getFile($fileName); |
147 | - } catch(NotFoundException $e) { |
|
147 | + } catch (NotFoundException $e) { |
|
148 | 148 | $cachedfile = $folder->newFile($fileName); |
149 | 149 | } |
150 | 150 | |
151 | - $depFileName = $fileName . '.deps'; |
|
151 | + $depFileName = $fileName.'.deps'; |
|
152 | 152 | try { |
153 | 153 | $depFile = $folder->getFile($depFileName); |
154 | 154 | } catch (NotFoundException $e) { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * @return string[] |
184 | 184 | */ |
185 | 185 | public function getContent($root, $file) { |
186 | - $data = json_decode(file_get_contents($root . '/' . $file)); |
|
186 | + $data = json_decode(file_get_contents($root.'/'.$file)); |
|
187 | 187 | |
188 | 188 | $path = explode('/', $file); |
189 | 189 | array_pop($path); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | $result = []; |
193 | 193 | foreach ($data as $f) { |
194 | - $result[] = $path . '/' . $f; |
|
194 | + $result[] = $path.'/'.$f; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | return $result; |
@@ -52,45 +52,45 @@ 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 | // Decide which page we show |
61 | - if($renderAs == 'user') { |
|
62 | - parent::__construct( 'core', 'layout.user' ); |
|
63 | - if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) { |
|
61 | + if ($renderAs == 'user') { |
|
62 | + parent::__construct('core', 'layout.user'); |
|
63 | + if (in_array(\OC_App::getCurrentApp(), ['settings', 'admin', 'help']) !== false) { |
|
64 | 64 | $this->assign('bodyid', 'body-settings'); |
65 | - }else{ |
|
65 | + } else { |
|
66 | 66 | $this->assign('bodyid', 'body-user'); |
67 | 67 | } |
68 | 68 | |
69 | 69 | // Code integrity notification |
70 | 70 | $integrityChecker = \OC::$server->getIntegrityCodeChecker(); |
71 | - if(\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) { |
|
71 | + if (\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) { |
|
72 | 72 | \OCP\Util::addScript('core', 'integritycheck-failed-notification'); |
73 | 73 | } |
74 | 74 | |
75 | 75 | // Add navigation entry |
76 | - $this->assign( 'application', ''); |
|
77 | - $this->assign( 'appid', $appId ); |
|
76 | + $this->assign('application', ''); |
|
77 | + $this->assign('appid', $appId); |
|
78 | 78 | $navigation = \OC_App::getNavigation(); |
79 | - $this->assign( 'navigation', $navigation); |
|
79 | + $this->assign('navigation', $navigation); |
|
80 | 80 | $navigation = \OC_App::getHeaderNavigation(); |
81 | - $this->assign( 'headernavigation', $navigation); |
|
81 | + $this->assign('headernavigation', $navigation); |
|
82 | 82 | $settingsNavigation = \OC_App::getSettingsNavigation(); |
83 | - $this->assign( 'settingsnavigation', $settingsNavigation); |
|
84 | - foreach($navigation as $entry) { |
|
83 | + $this->assign('settingsnavigation', $settingsNavigation); |
|
84 | + foreach ($navigation as $entry) { |
|
85 | 85 | if ($entry['active']) { |
86 | - $this->assign( 'application', $entry['name'] ); |
|
86 | + $this->assign('application', $entry['name']); |
|
87 | 87 | break; |
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | - foreach($settingsNavigation as $entry) { |
|
91 | + foreach ($settingsNavigation as $entry) { |
|
92 | 92 | if ($entry['active']) { |
93 | - $this->assign( 'application', $entry['name'] ); |
|
93 | + $this->assign('application', $entry['name']); |
|
94 | 94 | break; |
95 | 95 | } |
96 | 96 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | // Send the language to our layouts |
125 | 125 | $this->assign('language', \OC::$server->getL10NFactory()->findLanguage()); |
126 | 126 | |
127 | - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
127 | + if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
|
128 | 128 | if (empty(self::$versionHash)) { |
129 | 129 | $v = \OC_App::getAppVersions(); |
130 | 130 | $v['core'] = implode('.', \OCP\Util::getVersion()); |
@@ -155,10 +155,10 @@ discard block |
||
155 | 155 | $this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash])); |
156 | 156 | } |
157 | 157 | } |
158 | - foreach($jsFiles as $info) { |
|
158 | + foreach ($jsFiles as $info) { |
|
159 | 159 | $web = $info[1]; |
160 | 160 | $file = $info[2]; |
161 | - $this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
161 | + $this->append('jsfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | try { |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | // Do not initialise scss appdata until we have a fully installed instance |
171 | 171 | // Do not load scss for update, errors, installation or login page |
172 | - if(\OC::$server->getSystemConfig()->getValue('installed', false) |
|
172 | + if (\OC::$server->getSystemConfig()->getValue('installed', false) |
|
173 | 173 | && !\OCP\Util::needUpgrade() |
174 | 174 | && $pathInfo !== '' |
175 | 175 | && !preg_match('/^\/login/', $pathInfo)) { |
@@ -184,25 +184,25 @@ discard block |
||
184 | 184 | $this->assign('cssfiles', array()); |
185 | 185 | $this->assign('printcssfiles', []); |
186 | 186 | $this->assign('versionHash', self::$versionHash); |
187 | - foreach($cssFiles as $info) { |
|
187 | + foreach ($cssFiles as $info) { |
|
188 | 188 | $web = $info[1]; |
189 | 189 | $file = $info[2]; |
190 | 190 | |
191 | 191 | if (substr($file, -strlen('print.css')) === 'print.css') { |
192 | - $this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
192 | + $this->append('printcssfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
193 | 193 | } else { |
194 | - $this->append( 'cssfiles', $web.'/'.$file . $this->getVersionHashSuffix() ); |
|
194 | + $this->append('cssfiles', $web.'/'.$file.$this->getVersionHashSuffix()); |
|
195 | 195 | } |
196 | 196 | } |
197 | 197 | } |
198 | 198 | |
199 | 199 | protected function getVersionHashSuffix() { |
200 | - if(\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
200 | + if (\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
201 | 201 | // allows chrome workspace mapping in debug mode |
202 | 202 | return ""; |
203 | 203 | } |
204 | 204 | |
205 | - return '?v=' . self::$versionHash; |
|
205 | + return '?v='.self::$versionHash; |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | /** |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | // Read the selected theme from the config file |
214 | 214 | $theme = \OC_Util::getTheme(); |
215 | 215 | |
216 | - if($compileScss) { |
|
216 | + if ($compileScss) { |
|
217 | 217 | /** @var \OC\Memcache\Factory $cache */ |
218 | 218 | $cache = \OC::$server->query('MemCacheFactory'); |
219 | 219 | $SCSSCacher = new SCSSCacher( |
@@ -231,8 +231,8 @@ discard block |
||
231 | 231 | $locator = new \OC\Template\CSSResourceLocator( |
232 | 232 | \OC::$server->getLogger(), |
233 | 233 | $theme, |
234 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
235 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
234 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
235 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
236 | 236 | $SCSSCacher); |
237 | 237 | $locator->find($styles); |
238 | 238 | return $locator->getResources(); |
@@ -249,8 +249,8 @@ discard block |
||
249 | 249 | $locator = new \OC\Template\JSResourceLocator( |
250 | 250 | \OC::$server->getLogger(), |
251 | 251 | $theme, |
252 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
253 | - array( \OC::$SERVERROOT => \OC::$WEBROOT ), |
|
252 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
253 | + array(\OC::$SERVERROOT => \OC::$WEBROOT), |
|
254 | 254 | new JSCombiner( |
255 | 255 | \OC::$server->getAppDataDir('js'), |
256 | 256 | \OC::$server->getURLGenerator(), |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | */ |
271 | 271 | public static function convertToRelativePath($filePath) { |
272 | 272 | $relativePath = explode(\OC::$SERVERROOT, $filePath); |
273 | - if(count($relativePath) !== 2) { |
|
273 | + if (count($relativePath) !== 2) { |
|
274 | 274 | throw new \Exception('$filePath is not under the \OC::$SERVERROOT'); |
275 | 275 | } |
276 | 276 |