@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | $modules_list = \Xoops::getInstance()->getActiveModules(); |
102 | 102 | if (empty($modules_list)) { |
103 | 103 | // this should only happen if an exception was thrown in setActiveModules() |
104 | - $modules_list = array ('system'); |
|
104 | + $modules_list = array('system'); |
|
105 | 105 | } |
106 | - $this->preloadList =array(); |
|
106 | + $this->preloadList = array(); |
|
107 | 107 | $i = 0; |
108 | 108 | foreach ($modules_list as $module) { |
109 | - if (is_dir($dir = \XoopsBaseConfig::get('root-path') . "/modules/{$module}/preloads/")) { |
|
109 | + if (is_dir($dir = \XoopsBaseConfig::get('root-path')."/modules/{$module}/preloads/")) { |
|
110 | 110 | $file_list = Lists\File::getList($dir); |
111 | 111 | foreach ($file_list as $file) { |
112 | 112 | if (preg_match('/(\.php)$/i', $file)) { |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | { |
151 | 151 | $xoops = \Xoops::getInstance(); |
152 | 152 | foreach ($this->preloadList as $preload) { |
153 | - $path = $xoops->path('modules/' . $preload['module'] . '/preloads/' . $preload['file']. '.php'); |
|
153 | + $path = $xoops->path('modules/'.$preload['module'].'/preloads/'.$preload['file'].'.php'); |
|
154 | 154 | include_once $path; |
155 | 155 | $class_name = ucfirst($preload['module']) |
156 | - . ($preload['file'] === 'preload' ? '' : ucfirst($preload['file']) ) |
|
156 | + . ($preload['file'] === 'preload' ? '' : ucfirst($preload['file'])) |
|
157 | 157 | . 'Preload'; |
158 | 158 | if (!class_exists($class_name)) { |
159 | 159 | continue; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | public function addListener($eventName, $callback) |
216 | 216 | { |
217 | 217 | $eventName = $this->toInternalEventName($eventName); |
218 | - $this->eventListeners[$eventName][]=$callback; |
|
218 | + $this->eventListeners[$eventName][] = $callback; |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | /** |
@@ -77,7 +77,7 @@ |
||
77 | 77 | } |
78 | 78 | $xoops->setConfig('theme_set', $options['folderName']); |
79 | 79 | } |
80 | - $options['path'] = \XoopsBaseConfig::get('themes-path') . '/' . $options['folderName']; |
|
80 | + $options['path'] = \XoopsBaseConfig::get('themes-path').'/'.$options['folderName']; |
|
81 | 81 | $inst = new XoopsTheme(); |
82 | 82 | foreach ($options as $k => $v) { |
83 | 83 | $inst->$k = $v; |
@@ -187,7 +187,7 @@ |
||
187 | 187 | : "module:system/system_block_dummy.tpl"; |
188 | 188 | //$tplName = str_replace('.html', '.tpl', $tplName); |
189 | 189 | |
190 | - $cacheid = $this->generateCacheId('blk_' . $xobject->getVar('bid')); |
|
190 | + $cacheid = $this->generateCacheId('blk_'.$xobject->getVar('bid')); |
|
191 | 191 | |
192 | 192 | $xoops->events()->triggerEvent( |
193 | 193 | 'core.themeblocks.buildblock.start', |
@@ -36,13 +36,13 @@ |
||
36 | 36 | $options["plugins"] = array(); |
37 | 37 | $options['renderBanner'] = false; |
38 | 38 | $inst = parent::createInstance($options); |
39 | - $inst->path = \XoopsBaseConfig::get('adminthemes-path') . '/' . $inst->folderName; |
|
40 | - $inst->url = \XoopsBaseConfig::get('adminthemes-url') . '/' . $inst->folderName; |
|
39 | + $inst->path = \XoopsBaseConfig::get('adminthemes-path').'/'.$inst->folderName; |
|
40 | + $inst->url = \XoopsBaseConfig::get('adminthemes-url').'/'.$inst->folderName; |
|
41 | 41 | $inst->template->assign(array( |
42 | - 'theme_path' => $inst->path, 'theme_tpl' => $inst->path . '/xotpl', 'theme_url' => $inst->url, |
|
43 | - 'theme_img' => $inst->url . '/img', 'theme_icons' => $inst->url . '/icons', |
|
44 | - 'theme_css' => $inst->url . '/css', 'theme_js' => $inst->url . '/js', |
|
45 | - 'theme_lang' => $inst->url . '/language', |
|
42 | + 'theme_path' => $inst->path, 'theme_tpl' => $inst->path.'/xotpl', 'theme_url' => $inst->url, |
|
43 | + 'theme_img' => $inst->url.'/img', 'theme_icons' => $inst->url.'/icons', |
|
44 | + 'theme_css' => $inst->url.'/css', 'theme_js' => $inst->url.'/js', |
|
45 | + 'theme_lang' => $inst->url.'/language', |
|
46 | 46 | )); |
47 | 47 | |
48 | 48 | return $inst; |
@@ -195,15 +195,15 @@ discard block |
||
195 | 195 | { |
196 | 196 | $xoops = \Xoops::getInstance(); |
197 | 197 | $this->assets = $xoops->assets(); |
198 | - $this->path = \XoopsBaseConfig::get('themes-path') . '/' . $this->folderName; |
|
199 | - $this->url = \XoopsBaseConfig::get('themes-url') . '/' . $this->folderName; |
|
198 | + $this->path = \XoopsBaseConfig::get('themes-path').'/'.$this->folderName; |
|
199 | + $this->url = \XoopsBaseConfig::get('themes-url').'/'.$this->folderName; |
|
200 | 200 | $this->template = null; |
201 | 201 | $this->template = new XoopsTpl(); |
202 | 202 | //$this->template->currentTheme = $this; |
203 | 203 | $this->template->assignByRef('xoTheme', $this); |
204 | 204 | $this->template->assign(array( |
205 | 205 | 'xoops_theme' => $xoops->getConfig('theme_set'), |
206 | - 'xoops_imageurl' => \XoopsBaseConfig::get('themes-url') . '/' . $xoops->getConfig('theme_set') . '/', |
|
206 | + 'xoops_imageurl' => \XoopsBaseConfig::get('themes-url').'/'.$xoops->getConfig('theme_set').'/', |
|
207 | 207 | 'xoops_themecss' => $xoops->getCss($xoops->getConfig('theme_set')), |
208 | 208 | 'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES), |
209 | 209 | 'xoops_sitename' => htmlspecialchars($xoops->getConfig('sitename'), ENT_QUOTES), |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | : htmlspecialchars($xoops->getConfig('slogan'), ENT_QUOTES) |
216 | 216 | )); |
217 | 217 | $this->template->assign(array( |
218 | - 'theme_path' => $this->path, 'theme_tpl' => $this->path . '/xotpl', 'theme_url' => $this->url, |
|
219 | - 'theme_img' => $this->url . '/img', 'theme_icons' => $this->url . '/icons', |
|
220 | - 'theme_css' => $this->url . '/css', 'theme_js' => $this->url . '/js', |
|
221 | - 'theme_lang' => $this->url . '/language', |
|
218 | + 'theme_path' => $this->path, 'theme_tpl' => $this->path.'/xotpl', 'theme_url' => $this->url, |
|
219 | + 'theme_img' => $this->url.'/img', 'theme_icons' => $this->url.'/icons', |
|
220 | + 'theme_css' => $this->url.'/css', 'theme_js' => $this->url.'/js', |
|
221 | + 'theme_lang' => $this->url.'/language', |
|
222 | 222 | )); |
223 | 223 | |
224 | 224 | if ($xoops->isUser()) { |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | 'description', 'keywords', 'robots', 'rating', 'author', 'copyright' |
247 | 247 | ); |
248 | 248 | foreach ($metas as $name) { |
249 | - $this->addMeta('meta', $name, $xoops->getConfig('meta_' . $name)); |
|
249 | + $this->addMeta('meta', $name, $xoops->getConfig('meta_'.$name)); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | // Other assigns |
@@ -285,8 +285,8 @@ discard block |
||
285 | 285 | //to control order of loading JS and CSS |
286 | 286 | // TODO - this should be done in such a way it can join the base asset |
287 | 287 | // load above. |
288 | - if (\XoopsLoad::fileExists($this->path . "/theme_onload.php")) { |
|
289 | - include_once($this->path . "/theme_onload.php"); |
|
288 | + if (\XoopsLoad::fileExists($this->path."/theme_onload.php")) { |
|
289 | + include_once($this->path."/theme_onload.php"); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | // Instantiate and initialize all the theme plugins |
@@ -328,22 +328,22 @@ discard block |
||
328 | 328 | $extra_string = $xoops->getConfig('locale'); |
329 | 329 | // Generate group section |
330 | 330 | if (!$xoops->isUser()) { |
331 | - $extra_string .= '-' . FixedGroups::ANONYMOUS; |
|
331 | + $extra_string .= '-'.FixedGroups::ANONYMOUS; |
|
332 | 332 | } else { |
333 | 333 | $groups = $xoops->user->getGroups(); |
334 | 334 | sort($groups); |
335 | 335 | // Generate group string for non-anonymous groups, |
336 | 336 | // db-pass and db-name (before we find better variables) are used |
337 | 337 | // to protect group sensitive contents |
338 | - $extra_string .= '-' . substr(md5(implode('-', $groups)), 0, 8) . '-' . substr(md5( |
|
339 | - \XoopsBaseConfig::get('db-pass') . \XoopsBaseConfig::get('db-name') |
|
338 | + $extra_string .= '-'.substr(md5(implode('-', $groups)), 0, 8).'-'.substr(md5( |
|
339 | + \XoopsBaseConfig::get('db-pass').\XoopsBaseConfig::get('db-name') |
|
340 | 340 | . \XoopsBaseConfig::get('db-user') |
341 | 341 | ), 0, 8); |
342 | 342 | } |
343 | 343 | } |
344 | 344 | $extraString = $extra_string; |
345 | 345 | } |
346 | - $cache_id .= '-' . $extraString; |
|
346 | + $cache_id .= '-'.$extraString; |
|
347 | 347 | return $cache_id; |
348 | 348 | } |
349 | 349 | |
@@ -361,9 +361,9 @@ discard block |
||
361 | 361 | $uri = str_replace(\XoopsBaseConfig::get('url'), '', $_SERVER['REQUEST_URI']); |
362 | 362 | // Clean uri by removing session id |
363 | 363 | if (defined('SID') && SID && strpos($uri, SID)) { |
364 | - $uri = preg_replace("/([\?&])(" . SID . "$|" . SID . "&)/", "\\1", $uri); |
|
364 | + $uri = preg_replace("/([\?&])(".SID."$|".SID."&)/", "\\1", $uri); |
|
365 | 365 | } |
366 | - $this->contentCacheId = $this->generateCacheId('page_' . substr(md5($uri), 0, 8)); |
|
366 | + $this->contentCacheId = $this->generateCacheId('page_'.substr(md5($uri), 0, 8)); |
|
367 | 367 | if ($this->template->isCached($template, $this->contentCacheId)) { |
368 | 368 | \Xoops::getInstance()->events()->triggerEvent('core.theme.checkcache.success', array($template, $this)); |
369 | 369 | $this->render(null, null, $template); |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | |
435 | 435 | // We assume no overlap between $GLOBALS['xoopsOption']['xoops_module_header'] and |
436 | 436 | // $this->template->getTemplateVars( 'xoops_module_header' ) ? |
437 | - $this->template->assign('xoops_module_header', $this->renderMetas(true) . "\n" . $header); |
|
437 | + $this->template->assign('xoops_module_header', $this->renderMetas(true)."\n".$header); |
|
438 | 438 | |
439 | 439 | if ($canvasTpl) { |
440 | 440 | $this->canvasTemplate = $canvasTpl; |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | if (false === (bool)($xoops->getConfig('disable_theme_shortcodes'))) { |
461 | 461 | $this->template->loadFilter('output', 'shortcodes'); |
462 | 462 | } |
463 | - $this->template->display($this->path . '/' . $this->canvasTemplate); |
|
463 | + $this->template->display($this->path.'/'.$this->canvasTemplate); |
|
464 | 464 | $this->renderCount++; |
465 | 465 | $xoops->events()->triggerEvent('core.theme.render.end', array($this)); |
466 | 466 | return true; |
@@ -489,16 +489,16 @@ discard block |
||
489 | 489 | |
490 | 490 | $language = \XoopsLocale::getLocale(); |
491 | 491 | // Load global localization stylesheet if available |
492 | - if (\XoopsLoad::fileExists($xoops->path('locale/' . $language . '/style.css'))) { |
|
493 | - $cssAssets[] = $xoops->path('locale/' . $language . '/style.css'); |
|
492 | + if (\XoopsLoad::fileExists($xoops->path('locale/'.$language.'/style.css'))) { |
|
493 | + $cssAssets[] = $xoops->path('locale/'.$language.'/style.css'); |
|
494 | 494 | } |
495 | 495 | //$this->addLanguage($type); |
496 | 496 | // Load theme localization stylesheet and scripts if available |
497 | - if (\XoopsLoad::fileExists($this->path . '/locale/' . $language . '/script.js')) { |
|
498 | - $jsAssets[] = $this->url . '/locale/' . $language . '/script.js'; |
|
497 | + if (\XoopsLoad::fileExists($this->path.'/locale/'.$language.'/script.js')) { |
|
498 | + $jsAssets[] = $this->url.'/locale/'.$language.'/script.js'; |
|
499 | 499 | } |
500 | - if (\XoopsLoad::fileExists($this->path . '/locale/' . $language . '/style.css')) { |
|
501 | - $cssAssets[] = $this->path . '/locale/' . $language . '/style.css'; |
|
500 | + if (\XoopsLoad::fileExists($this->path.'/locale/'.$language.'/style.css')) { |
|
501 | + $cssAssets[] = $this->path.'/locale/'.$language.'/style.css'; |
|
502 | 502 | } |
503 | 503 | return array($cssAssets, $jsAssets); |
504 | 504 | } |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | public function addBaseAssets($type, $assets) |
643 | 643 | { |
644 | 644 | if (is_scalar($assets)) { |
645 | - $this->baseAssets[$type][]=$assets; |
|
645 | + $this->baseAssets[$type][] = $assets; |
|
646 | 646 | } elseif (is_array($assets)) { |
647 | 647 | $this->baseAssets[$type] = array_merge($this->baseAssets[$type], $assets); |
648 | 648 | } |
@@ -809,14 +809,14 @@ discard block |
||
809 | 809 | if (!empty($this->baseAssets['js'])) { |
810 | 810 | $url = $this->assets->getUrlToAssets('js', $this->baseAssets['js']); |
811 | 811 | if (!empty($url)) { |
812 | - $str .= '<script src="' . $url . '" type="text/javascript"></script>'."\n"; |
|
812 | + $str .= '<script src="'.$url.'" type="text/javascript"></script>'."\n"; |
|
813 | 813 | } |
814 | 814 | } |
815 | 815 | |
816 | 816 | if (!empty($this->baseAssets['css'])) { |
817 | 817 | $url = $this->assets->getUrlToAssets('css', $this->baseAssets['css']); |
818 | 818 | if (!empty($url)) { |
819 | - $str .= '<link rel="stylesheet" href="' . $url . '" type="text/css" />'."\n"; |
|
819 | + $str .= '<link rel="stylesheet" href="'.$url.'" type="text/css" />'."\n"; |
|
820 | 820 | } |
821 | 821 | } |
822 | 822 | return $str; |
@@ -839,9 +839,9 @@ discard block |
||
839 | 839 | switch ($type) { |
840 | 840 | case 'script': |
841 | 841 | foreach ($this->metas[$type] as $attrs) { |
842 | - $str .= "<script" . $this->renderAttributes($attrs) . ">"; |
|
842 | + $str .= "<script".$this->renderAttributes($attrs).">"; |
|
843 | 843 | if (@$attrs['_']) { |
844 | - $str .= "\n//<![CDATA[\n" . $attrs['_'] . "\n//]]>"; |
|
844 | + $str .= "\n//<![CDATA[\n".$attrs['_']."\n//]]>"; |
|
845 | 845 | } |
846 | 846 | $str .= "</script>\n"; |
847 | 847 | } |
@@ -850,29 +850,29 @@ discard block |
||
850 | 850 | foreach ($this->metas[$type] as $attrs) { |
851 | 851 | $rel = $attrs['rel']; |
852 | 852 | unset($attrs['rel']); |
853 | - $str .= '<link rel="' . $rel . '"' . $this->renderAttributes($attrs) . " />\n"; |
|
853 | + $str .= '<link rel="'.$rel.'"'.$this->renderAttributes($attrs)." />\n"; |
|
854 | 854 | } |
855 | 855 | break; |
856 | 856 | case 'stylesheet': |
857 | 857 | foreach ($this->metas[$type] as $attrs) { |
858 | 858 | if (@$attrs['_']) { |
859 | - $str .= '<style' . $this->renderAttributes($attrs) |
|
860 | - . ">\n/* <![CDATA[ */\n" . $attrs['_'] . "\n/* //]]> */\n</style>"; |
|
859 | + $str .= '<style'.$this->renderAttributes($attrs) |
|
860 | + . ">\n/* <![CDATA[ */\n".$attrs['_']."\n/* //]]> */\n</style>"; |
|
861 | 861 | } else { |
862 | - $str .= '<link rel="stylesheet"' . $this->renderAttributes($attrs) . " />\n"; |
|
862 | + $str .= '<link rel="stylesheet"'.$this->renderAttributes($attrs)." />\n"; |
|
863 | 863 | } |
864 | 864 | } |
865 | 865 | break; |
866 | 866 | case 'http': |
867 | 867 | foreach ($this->metas[$type] as $name => $content) { |
868 | - $str .= '<meta http-equiv="' . htmlspecialchars($name, ENT_QUOTES) . '" content="' |
|
869 | - . htmlspecialchars($content, ENT_QUOTES) . "\" />\n"; |
|
868 | + $str .= '<meta http-equiv="'.htmlspecialchars($name, ENT_QUOTES).'" content="' |
|
869 | + . htmlspecialchars($content, ENT_QUOTES)."\" />\n"; |
|
870 | 870 | } |
871 | 871 | break; |
872 | 872 | default: |
873 | 873 | foreach ($this->metas[$type] as $name => $content) { |
874 | - $str .= '<meta name="' . htmlspecialchars($name, ENT_QUOTES) . '" content="' |
|
875 | - . htmlspecialchars($content, ENT_QUOTES) . "\" />\n"; |
|
874 | + $str .= '<meta name="'.htmlspecialchars($name, ENT_QUOTES).'" content="' |
|
875 | + . htmlspecialchars($content, ENT_QUOTES)."\" />\n"; |
|
876 | 876 | } |
877 | 877 | break; |
878 | 878 | } |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | if (!isset($cache[$tagName])) { |
894 | 894 | $cache[$tagName] = 1; |
895 | 895 | } |
896 | - return $tagName . '-' . $cache[$tagName]++; |
|
896 | + return $tagName.'-'.$cache[$tagName]++; |
|
897 | 897 | } |
898 | 898 | |
899 | 899 | /** |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | $str = ''; |
909 | 909 | foreach ($coll as $name => $val) { |
910 | 910 | if ($name !== '_') { |
911 | - $str .= ' ' . $name . '="' . htmlspecialchars($val, ENT_QUOTES) . '"'; |
|
911 | + $str .= ' '.$name.'="'.htmlspecialchars($val, ENT_QUOTES).'"'; |
|
912 | 912 | } |
913 | 913 | } |
914 | 914 | return $str; |
@@ -928,12 +928,12 @@ discard block |
||
928 | 928 | } |
929 | 929 | $xoops_root_path = \XoopsBaseConfig::get('root-path'); |
930 | 930 | //\Xoops::getInstance()->events()->triggerEvent('debug.log', $this); |
931 | - if (\XoopsLoad::fileExists($xoops_root_path . "/{$this->themesPath}/{$this->folderName}/{$path}")) { |
|
931 | + if (\XoopsLoad::fileExists($xoops_root_path."/{$this->themesPath}/{$this->folderName}/{$path}")) { |
|
932 | 932 | //\Xoops::getInstance()->events()->triggerEvent('debug.log', "custom theme path {$this->themesPath}/{$this->folderName}/{$path}"); |
933 | 933 | return "{$this->themesPath}/{$this->folderName}/{$path}"; |
934 | 934 | } |
935 | 935 | |
936 | - if (\XoopsLoad::fileExists($xoops_root_path . "/themes/{$this->folderName}/{$path}")) { |
|
936 | + if (\XoopsLoad::fileExists($xoops_root_path."/themes/{$this->folderName}/{$path}")) { |
|
937 | 937 | //\Xoops::getInstance()->events()->triggerEvent('debug.log', "main theme folder themes/{$this->folderName}/{$path}"); |
938 | 938 | return "themes/{$this->folderName}/{$path}"; |
939 | 939 | } |
@@ -174,12 +174,12 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public $headersCacheEngine = 'default'; |
176 | 176 | |
177 | - /** |
|
177 | + /** |
|
178 | 178 | * |
179 | 179 | *$renderer instance of renderer |
180 | 180 | * |
181 | 181 | */ |
182 | - protected $renderer; |
|
182 | + protected $renderer; |
|
183 | 183 | |
184 | 184 | /** |
185 | 185 | * *#@- |
@@ -321,10 +321,10 @@ discard block |
||
321 | 321 | */ |
322 | 322 | public function setRenderer($renderer) |
323 | 323 | { |
324 | - $this->renderer = $renderer; |
|
324 | + $this->renderer = $renderer; |
|
325 | 325 | } |
326 | 326 | |
327 | - /** |
|
327 | + /** |
|
328 | 328 | * get the renderer |
329 | 329 | * |
330 | 330 | * @return Renderer |
@@ -333,10 +333,10 @@ discard block |
||
333 | 333 | { |
334 | 334 | // return a default if not set |
335 | 335 | if (null === $this->renderer) { |
336 | - return $element->defaultRender(); |
|
337 | - } else { |
|
338 | - return $this->renderer->render($element); |
|
339 | - } |
|
336 | + return $element->defaultRender(); |
|
337 | + } else { |
|
338 | + return $this->renderer->render($element); |
|
339 | + } |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | /** |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function setForce($force = false) |
82 | 82 | { |
83 | - $this->force = (bool) $force; |
|
83 | + $this->force = (bool)$force; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | $prefix = \XoopsBaseConfig::get('db-prefix'); |
137 | 137 | if ($tablename != '') { |
138 | - return $prefix . '_' . $tablename; |
|
138 | + return $prefix.'_'.$tablename; |
|
139 | 139 | } else { |
140 | 140 | return $prefix; |
141 | 141 | } |
@@ -257,14 +257,14 @@ discard block |
||
257 | 257 | $events->triggerEvent('core.database.query.end'); |
258 | 258 | } else { |
259 | 259 | //$events->triggerEvent('core.database.query.failure', (array('Not safe:'))); |
260 | - return (int) 0; |
|
260 | + return (int)0; |
|
261 | 261 | } |
262 | 262 | if ($result != 0) { |
263 | 263 | //$events->triggerEvent('core.database.query.success', (array($query))); |
264 | - return (int) $result; |
|
264 | + return (int)$result; |
|
265 | 265 | } else { |
266 | 266 | //$events->triggerEvent('core.database.query.failure', (array($query))); |
267 | - return (int) 0; |
|
267 | + return (int)0; |
|
268 | 268 | } |
269 | 269 | } |
270 | 270 | |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | $result = call_user_func_array(array('parent', 'query'), func_get_args()); |
332 | 332 | } catch (\Exception $e) { |
333 | 333 | $events->triggerEvent('core.exception', $e); |
334 | - $result=null; |
|
334 | + $result = null; |
|
335 | 335 | } |
336 | 336 | $events->triggerEvent('core.database.query.end'); |
337 | 337 | if ($result) { |
@@ -105,7 +105,7 @@ |
||
105 | 105 | public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) |
106 | 106 | { |
107 | 107 | if (!isset($this->schemaArray['tables'][$localTable->getName()]['constraint'])) { |
108 | - $this->schemaArray['tables'][$localTable->getName()]['constraint']=array(); |
|
108 | + $this->schemaArray['tables'][$localTable->getName()]['constraint'] = array(); |
|
109 | 109 | } |
110 | 110 | $this->schemaArray['tables'][$localTable->getName()]['constraint'][] = array( |
111 | 111 | 'name' => $fkConstraint->getName(), |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | { |
52 | 52 | static $instance; |
53 | 53 | if (!isset($instance)) { |
54 | - $xoops = \Xoops::getInstance(); |
|
54 | + $xoops = \Xoops::getInstance(); |
|
55 | 55 | $config = new \Doctrine\DBAL\Configuration(); |
56 | 56 | $config->setSQLLogger(new XoopsDebugStack()); |
57 | 57 | $parameters = \XoopsBaseConfig::get('db-parameters'); |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | 'wrapperClass' => '\Xoops\Core\Database\Connection', |
71 | 71 | ); |
72 | 72 | // Support for other doctrine databases |
73 | - $xoops_db_port = \XoopsBaseConfig::get('db-port'); |
|
73 | + $xoops_db_port = \XoopsBaseConfig::get('db-port'); |
|
74 | 74 | if (!empty($xoops_db_port)) { |
75 | 75 | $connectionParams['port'] = $xoops_db_port; |
76 | 76 | } |
77 | - $xoops_db_socket = \XoopsBaseConfig::get('db-socket'); |
|
77 | + $xoops_db_socket = \XoopsBaseConfig::get('db-socket'); |
|
78 | 78 | if (!empty($xoops_db_socket)) { |
79 | 79 | $connectionParams['unix_socket'] = $xoops_db_socket; |
80 | 80 | } |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $connectionParams = $parameters; |
60 | 60 | $connectionParams['wrapperClass'] = '\Xoops\Core\Database\Connection'; |
61 | 61 | } else { |
62 | - $driver = 'pdo_' . \XoopsBaseConfig::get('db-type'); |
|
62 | + $driver = 'pdo_'.\XoopsBaseConfig::get('db-type'); |
|
63 | 63 | $connectionParams = array( |
64 | 64 | 'dbname' => \XoopsBaseConfig::get('db-name'), |
65 | 65 | 'user' => \XoopsBaseConfig::get('db-user'), |
@@ -131,15 +131,15 @@ discard block |
||
131 | 131 | $assetsPrefs = $xoops->cache()->read($this->assetsPrefsCacheKey); |
132 | 132 | $file = $xoops->path($this->assetsPrefsFilename); |
133 | 133 | $mtime = filemtime($file); |
134 | - if ($assetsPrefs===false || !isset($assetsPrefs['mtime']) || !$mtime |
|
135 | - || (isset($assetsPrefs['mtime']) && $assetsPrefs['mtime']<$mtime)) { |
|
134 | + if ($assetsPrefs === false || !isset($assetsPrefs['mtime']) || !$mtime |
|
135 | + || (isset($assetsPrefs['mtime']) && $assetsPrefs['mtime'] < $mtime)) { |
|
136 | 136 | if ($mtime) { |
137 | 137 | $assetsPrefs = Yaml::read($file); |
138 | 138 | if (!is_array($assetsPrefs)) { |
139 | 139 | $xoops->logger()->error("Invalid config in system_assets_prefs.yml"); |
140 | 140 | $assetsPrefs = array(); |
141 | 141 | } else { |
142 | - $assetsPrefs['mtime']=$mtime; |
|
142 | + $assetsPrefs['mtime'] = $mtime; |
|
143 | 143 | $xoops->cache()->write($this->assetsPrefsCacheKey, $assetsPrefs); |
144 | 144 | $this->copyBaseFileAssets(); |
145 | 145 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $assets = array($assets); // just a single path name |
213 | 213 | } |
214 | 214 | |
215 | - if ($filters==='default') { |
|
215 | + if ($filters === 'default') { |
|
216 | 216 | if (isset($this->default_filters[$type])) { |
217 | 217 | $filters = $this->default_filters[$type]; |
218 | 218 | } else { |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | $filters |
312 | 312 | ); |
313 | 313 | $asset_path = $asset->getTargetPath(); |
314 | - if (!is_readable($target_path . $asset_path)) { |
|
314 | + if (!is_readable($target_path.$asset_path)) { |
|
315 | 315 | $assetKey = 'Asset '.$asset_path; |
316 | 316 | $xoops->events()->triggerEvent('debug.timer.start', $assetKey); |
317 | 317 | $oldumask = umask(0002); |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | $xoops->events()->triggerEvent('debug.timer.stop', $assetKey); |
321 | 321 | } |
322 | 322 | |
323 | - return $xoops->url('assets/' . $asset_path); |
|
323 | + return $xoops->url('assets/'.$asset_path); |
|
324 | 324 | |
325 | 325 | } catch (\Exception $e) { |
326 | 326 | $xoops->events()->triggerEvent('core.exception', $e); |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | |
361 | 361 | try { |
362 | 362 | if (is_scalar($assets)) { |
363 | - $assets = array($assets); // just a single path name |
|
363 | + $assets = array($assets); // just a single path name |
|
364 | 364 | } |
365 | 365 | foreach ($assets as $a) { |
366 | 366 | // translate path if not a reference or absolute path |
@@ -368,10 +368,10 @@ discard block |
||
368 | 368 | && (substr_compare($a, '/', 0, 1) != 0)) { |
369 | 369 | $a = $xoops->path($a); |
370 | 370 | } |
371 | - if (false===strpos($a, '*')) { |
|
371 | + if (false === strpos($a, '*')) { |
|
372 | 372 | $assetArray[] = new FileAsset($a); // single file |
373 | 373 | } else { |
374 | - $assetArray[] = new GlobAsset($a); // wild card match |
|
374 | + $assetArray[] = new GlobAsset($a); // wild card match |
|
375 | 375 | } |
376 | 376 | } |
377 | 377 | |
@@ -452,9 +452,9 @@ discard block |
||
452 | 452 | { |
453 | 453 | $xoops = \Xoops::getInstance(); |
454 | 454 | |
455 | - $fromPath = $xoops->path($fromPath) . '/'; |
|
456 | - $toPath = $xoops->path('assets') . '/' . $output . '/'; |
|
457 | - $from = glob($fromPath . '/' . $pattern); |
|
455 | + $fromPath = $xoops->path($fromPath).'/'; |
|
456 | + $toPath = $xoops->path('assets').'/'.$output.'/'; |
|
457 | + $from = glob($fromPath.'/'.$pattern); |
|
458 | 458 | |
459 | 459 | if (!is_dir($toPath)) { |
460 | 460 | $oldUmask = umask(0); |
@@ -468,8 +468,8 @@ discard block |
||
468 | 468 | foreach ($from as $filepath) { |
469 | 469 | $xoops->events()->triggerEvent('debug.timer.start', $filepath); |
470 | 470 | $filename = basename($filepath); |
471 | - $status=copy($filepath, $toPath.$filename); |
|
472 | - if (false===$status) { |
|
471 | + $status = copy($filepath, $toPath.$filename); |
|
472 | + if (false === $status) { |
|
473 | 473 | $xoops->logger()->warning('Failed to copy asset '.$filename); |
474 | 474 | } else { |
475 | 475 | //$xoops->logger()->debug('Copied asset '.$filename); |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | umask($oldUmask); |
481 | 481 | return $count; |
482 | 482 | } else { |
483 | - $xoops->logger()->warning('Asset directory is not writable. ' . $output); |
|
483 | + $xoops->logger()->warning('Asset directory is not writable. '.$output); |
|
484 | 484 | return false; |
485 | 485 | } |
486 | 486 | } |