@@ -4,12 +4,12 @@ discard block |
||
4 | 4 | * @see http://www.php-fig.org/psr/psr-4/examples/ |
5 | 5 | */ |
6 | 6 | spl_autoload_register( |
7 | - static function ($class) { |
|
7 | + static function($class) { |
|
8 | 8 | // project-specific namespace prefix |
9 | - $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
9 | + $prefix = 'XoopsModules\\'.ucfirst(basename(dirname(__DIR__))); |
|
10 | 10 | |
11 | 11 | // base directory for the namespace prefix |
12 | - $baseDir = dirname(__DIR__) . '/class/'; |
|
12 | + $baseDir = dirname(__DIR__).'/class/'; |
|
13 | 13 | |
14 | 14 | // does the class use the namespace prefix? |
15 | 15 | $len = mb_strlen($prefix); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | // replace the namespace prefix with the base directory, replace namespace |
25 | 25 | // separators with directory separators in the relative class name, append |
26 | 26 | // with .php |
27 | - $file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php'; |
|
27 | + $file = $baseDir.str_replace('\\', '/', $relativeClass).'.php'; |
|
28 | 28 | |
29 | 29 | // if the file exists, require it |
30 | 30 | if (is_file($file)) { |
@@ -69,7 +69,7 @@ |
||
69 | 69 | { |
70 | 70 | $ret = false; |
71 | 71 | |
72 | - $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; |
|
72 | + $class = __NAMESPACE__.'\\'.\ucfirst($name).'Handler'; |
|
73 | 73 | if (!\class_exists($class)) { |
74 | 74 | throw new \RuntimeException("Class '$class' not found"); |
75 | 75 | } |
@@ -49,10 +49,10 @@ |
||
49 | 49 | if (!$edit_func) { |
50 | 50 | return false; |
51 | 51 | } |
52 | - if (is_file(XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'))) { |
|
52 | + if (is_file(XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file'))) { |
|
53 | 53 | xoops_loadLanguage('blocks', $this->getVar('dirname')); |
54 | 54 | |
55 | - require_once XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'); |
|
55 | + require_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file'); |
|
56 | 56 | $options = explode('|', $this->getVar('options')); |
57 | 57 | $edit_form = $edit_func($options); |
58 | 58 | if (!$edit_form) { |
@@ -38,19 +38,19 @@ discard block |
||
38 | 38 | // $sql .= " WHERE metakey='version' LIMIT 1"; |
39 | 39 | // $query = $GLOBALS['xoopsDB']->query($sql); |
40 | 40 | // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
41 | - $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
41 | + $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>".constant('CO_'.$moduleDirNameUpper.'_IMAGEINFO')."</legend>\n"; |
|
42 | 42 | $html .= "<div style='padding: 8px;'>\n"; |
43 | 43 | // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
44 | 44 | // $html .= "<br>\n"; |
45 | 45 | // $html .= "<br>\n"; |
46 | - $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
46 | + $html .= '<div>'.constant('CO_'.$moduleDirNameUpper.'_SPHPINI')."</div>\n"; |
|
47 | 47 | $html .= "<ul>\n"; |
48 | 48 | |
49 | - $gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
50 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
49 | + $gdlib = function_exists('gd_info') ? '<span style="color: green;">'.constant('CO_'.$moduleDirNameUpper.'_GDON').'</span>' : '<span style="color: red;">'.constant('CO_'.$moduleDirNameUpper.'_GDOFF').'</span>'; |
|
50 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS').$gdlib; |
|
51 | 51 | if (function_exists('gd_info')) { |
52 | 52 | if (true === ($gdlib = gd_info())) { |
53 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
53 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBVERSION').'<b>'.$gdlib['GD Version'].'</b>'; |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | // |
@@ -60,18 +60,18 @@ discard block |
||
60 | 60 | // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
61 | 61 | // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
62 | 62 | // |
63 | - $downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
64 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
63 | + $downloads = ini_get('file_uploads') ? '<span style="color: green;">'.constant('CO_'.$moduleDirNameUpper.'_ON').'</span>' : '<span style="color: red;">'.constant('CO_'.$moduleDirNameUpper.'_OFF').'</span>'; |
|
64 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS').$downloads; |
|
65 | 65 | |
66 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n"; |
|
67 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n"; |
|
68 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . ini_get('memory_limit') . "</span></b>\n"; |
|
66 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE').' <b><span style="color: blue;">'.ini_get('upload_max_filesize')."</span></b>\n"; |
|
67 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE').' <b><span style="color: blue;">'.ini_get('post_max_size')."</span></b>\n"; |
|
68 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT').' <b><span style="color: blue;">'.ini_get('memory_limit')."</span></b>\n"; |
|
69 | 69 | $html .= "</ul>\n"; |
70 | 70 | $html .= "<ul>\n"; |
71 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
71 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERPATH').' <b>'.XOOPS_ROOT_PATH."</b>\n"; |
|
72 | 72 | $html .= "</ul>\n"; |
73 | 73 | $html .= "<br>\n"; |
74 | - $html .= constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
74 | + $html .= constant('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC')."\n"; |
|
75 | 75 | $html .= '</div>'; |
76 | 76 | $html .= '</fieldset><br>'; |
77 | 77 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | throw new \RuntimeException(\sprintf('Unable to create the %s directory', $folder)); |
33 | 33 | } |
34 | 34 | |
35 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
35 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
36 | 36 | } |
37 | 37 | } catch (\Exception $e) { |
38 | 38 | echo 'Caught exception: ', $e->getMessage(), "\n", '<br>'; |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | $dir = \opendir($src); |
59 | 59 | // @mkdir($dst); |
60 | 60 | if (!@\mkdir($dst) && !\is_dir($dst)) { |
61 | - throw new \RuntimeException('The directory ' . $dst . ' could not be created.'); |
|
61 | + throw new \RuntimeException('The directory '.$dst.' could not be created.'); |
|
62 | 62 | } |
63 | 63 | while (false !== ($file = \readdir($dir))) { |
64 | 64 | if (('.' !== $file) && ('..' !== $file)) { |
65 | - if (\is_dir($src . '/' . $file)) { |
|
66 | - self::recurseCopy($src . '/' . $file, $dst . '/' . $file); |
|
65 | + if (\is_dir($src.'/'.$file)) { |
|
66 | + self::recurseCopy($src.'/'.$file, $dst.'/'.$file); |
|
67 | 67 | } else { |
68 | - \copy($src . '/' . $file, $dst . '/' . $file); |
|
68 | + \copy($src.'/'.$file, $dst.'/'.$file); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | self::rrmdir($fObj->getPathname()); |
156 | 156 | } |
157 | 157 | } |
158 | - $iterator = null; // clear iterator Obj to close file/directory |
|
158 | + $iterator = null; // clear iterator Obj to close file/directory |
|
159 | 159 | return \rmdir($src); // remove the directory & return results |
160 | 160 | } |
161 | 161 | |
@@ -188,14 +188,14 @@ discard block |
||
188 | 188 | $iterator = new \DirectoryIterator($src); |
189 | 189 | foreach ($iterator as $fObj) { |
190 | 190 | if ($fObj->isFile()) { |
191 | - \rename($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
191 | + \rename($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
192 | 192 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
193 | 193 | // Try recursively on directory |
194 | - self::rmove($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
194 | + self::rmove($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
195 | 195 | // rmdir($fObj->getPath()); // now delete the directory |
196 | 196 | } |
197 | 197 | } |
198 | - $iterator = null; // clear iterator Obj to close file/directory |
|
198 | + $iterator = null; // clear iterator Obj to close file/directory |
|
199 | 199 | return \rmdir($src); // remove the directory & return results |
200 | 200 | } |
201 | 201 | |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | $iterator = new \DirectoryIterator($src); |
232 | 232 | foreach ($iterator as $fObj) { |
233 | 233 | if ($fObj->isFile()) { |
234 | - \copy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
234 | + \copy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
235 | 235 | } elseif (!$fObj->isDot() && $fObj->isDir()) { |
236 | - self::rcopy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename()); |
|
236 | + self::rcopy($fObj->getPathname(), "{$dest}/".$fObj->getFilename()); |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
44 | 44 | $moduleDirNameUpper = mb_strtoupper($moduleDirName); |
45 | 45 | |
46 | - $config = require \dirname(__DIR__, 2) . '/config/config.php'; |
|
46 | + $config = require \dirname(__DIR__, 2).'/config/config.php'; |
|
47 | 47 | |
48 | 48 | $this->name = $config->name; |
49 | 49 | $this->paths = $config->paths; |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | //check for minimum XOOPS version |
66 | 66 | $currentVer = mb_substr(XOOPS_VERSION, 6); // get the numeric part of string |
67 | 67 | if (null === $requiredVer) { |
68 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
68 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
69 | 69 | } |
70 | 70 | $success = true; |
71 | 71 | |
72 | 72 | if (version_compare($currentVer, $requiredVer, '<')) { |
73 | 73 | $success = false; |
74 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
74 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $success; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | if (false !== $reqVer && '' !== $reqVer) { |
104 | 104 | if (version_compare($verNum, $reqVer, '<')) { |
105 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
105 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
106 | 106 | $success = false; |
107 | 107 | } |
108 | 108 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
127 | 127 | $moduleDirNameUpper = mb_strtoupper($moduleDirName); |
128 | 128 | $update = ''; |
129 | - $repository = 'XoopsModules25x/' . $moduleDirName; |
|
129 | + $repository = 'XoopsModules25x/'.$moduleDirName; |
|
130 | 130 | // $repository = 'XoopsModules25x/publisher'; //for testing only |
131 | 131 | $ret = ''; |
132 | 132 | $infoReleasesUrl = "https://api.github.com/repos/$repository/releases"; |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | if (false === $curlReturn) { |
141 | 141 | trigger_error(curl_error($curlHandle)); |
142 | 142 | } elseif (false !== strpos($curlReturn, 'Not Found')) { |
143 | - trigger_error('Repository Not Found: ' . $infoReleasesUrl); |
|
143 | + trigger_error('Repository Not Found: '.$infoReleasesUrl); |
|
144 | 144 | } else { |
145 | 145 | $file = json_decode($curlReturn, false); |
146 | 146 | $latestVersionLink = sprintf("https://github.com/$repository/archive/%s.zip", $file ? reset($file)->tag_name : $default); |
147 | 147 | $latestVersion = $file[0]->tag_name; |
148 | 148 | $prerelease = $file[0]->prerelease; |
149 | 149 | if ('master' !== $latestVersionLink) { |
150 | - $update = constant('CO_' . $moduleDirNameUpper . '_' . 'NEW_VERSION') . $latestVersion; |
|
150 | + $update = constant('CO_'.$moduleDirNameUpper.'_'.'NEW_VERSION').$latestVersion; |
|
151 | 151 | } |
152 | 152 | //"PHP-standardized" version |
153 | 153 | $latestVersion = mb_strtolower($latestVersion); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $latestVersion = str_replace('_', '', mb_strtolower($latestVersion)); |
156 | 156 | $latestVersion = str_replace('final', '', mb_strtolower($latestVersion)); |
157 | 157 | } |
158 | - $moduleVersion = ($helper->getModule()->getInfo('version') . '_' . $helper->getModule()->getInfo('module_status')); |
|
158 | + $moduleVersion = ($helper->getModule()->getInfo('version').'_'.$helper->getModule()->getInfo('module_status')); |
|
159 | 159 | //"PHP-standardized" version |
160 | 160 | $moduleVersion = str_replace(' ', '', mb_strtolower($moduleVersion)); |
161 | 161 | // $moduleVersion = '1.0'; //for testing only |