@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $skip = false; |
| 95 | 95 | $options = ''; |
| 96 | 96 | // start table definition |
| 97 | - $tableName = $this->getTableName ($line); |
|
| 97 | + $tableName = $this->getTableName($line); |
|
| 98 | 98 | $tables[$tableName] = []; |
| 99 | 99 | $tables[$tableName]['options'] = ''; |
| 100 | 100 | $tables[$tableName]['columns'] = []; |
@@ -140,22 +140,22 @@ discard block |
||
| 140 | 140 | $schema[] = "{$tkey}:\n"; |
| 141 | 141 | foreach ($table as $lkey => $line) { |
| 142 | 142 | if ('keys' == $lkey) { |
| 143 | - $schema[] = $level1 . "keys:\n"; |
|
| 143 | + $schema[] = $level1."keys:\n"; |
|
| 144 | 144 | foreach ($line as $kkey => $kvalue) { |
| 145 | 145 | foreach ($kvalue as $kkey2 => $kvalue2) { |
| 146 | - $schema[] = $level2 . $kkey2 . ":\n"; |
|
| 147 | - $schema[] = $level3 . 'columns: ' . $kvalue2['columns'] . "\n"; |
|
| 148 | - $schema[] = $level3 . 'unique: ' . $kvalue2['unique'] . "\n"; |
|
| 146 | + $schema[] = $level2.$kkey2.":\n"; |
|
| 147 | + $schema[] = $level3.'columns: '.$kvalue2['columns']."\n"; |
|
| 148 | + $schema[] = $level3.'unique: '.$kvalue2['unique']."\n"; |
|
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | } elseif ('options' == $lkey) { |
| 152 | - $schema[] = $level1 . 'options: ' . $line . "\n"; |
|
| 152 | + $schema[] = $level1.'options: '.$line."\n"; |
|
| 153 | 153 | } else { |
| 154 | - $schema[] = $level1 . 'columns: ' . "\n"; |
|
| 154 | + $schema[] = $level1.'columns: '."\n"; |
|
| 155 | 155 | foreach ($line as $kkey => $kvalue) { |
| 156 | - $schema[] = $level2 . '-' . "\n"; |
|
| 156 | + $schema[] = $level2.'-'."\n"; |
|
| 157 | 157 | foreach ($kvalue as $kkey2 => $kvalue2) { |
| 158 | - $schema[] = $level3 . $kkey2 . ": " . $kvalue2 . "\n"; |
|
| 158 | + $schema[] = $level3.$kkey2.": ".$kvalue2."\n"; |
|
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | } |
@@ -183,10 +183,10 @@ discard block |
||
| 183 | 183 | * @param string $line |
| 184 | 184 | * @return string|bool |
| 185 | 185 | */ |
| 186 | - private function getTableName (string $line) |
|
| 186 | + private function getTableName(string $line) |
|
| 187 | 187 | { |
| 188 | 188 | |
| 189 | - $arrLine = \explode( '`', $line); |
|
| 189 | + $arrLine = \explode('`', $line); |
|
| 190 | 190 | if (\count($arrLine) > 0) { |
| 191 | 191 | return $arrLine[1]; |
| 192 | 192 | } |
@@ -201,12 +201,12 @@ discard block |
||
| 201 | 201 | * @param string $line |
| 202 | 202 | * @return array|bool |
| 203 | 203 | */ |
| 204 | - private function getColumns (string $line) |
|
| 204 | + private function getColumns(string $line) |
|
| 205 | 205 | { |
| 206 | 206 | |
| 207 | 207 | $columns = []; |
| 208 | 208 | |
| 209 | - $arrCol = \explode( ' ', \trim($line)); |
|
| 209 | + $arrCol = \explode(' ', \trim($line)); |
|
| 210 | 210 | if (\count($arrCol) > 0) { |
| 211 | 211 | $name = \str_replace(['`'], '', $arrCol[0]); |
| 212 | 212 | } else { |
@@ -217,11 +217,11 @@ discard block |
||
| 217 | 217 | $columns['name'] = $name; |
| 218 | 218 | // update quotes |
| 219 | 219 | if (\strpos($attributes, "''") > 0) { |
| 220 | - $attributes = \trim(\str_replace("''", "''''''''" , $attributes)); |
|
| 220 | + $attributes = \trim(\str_replace("''", "''''''''", $attributes)); |
|
| 221 | 221 | } elseif (\strpos($attributes, "'") > 0) { |
| 222 | - $attributes = \trim(\str_replace("'", "''" , $attributes)); |
|
| 222 | + $attributes = \trim(\str_replace("'", "''", $attributes)); |
|
| 223 | 223 | } |
| 224 | - $columns['attributes'] = "' " . $attributes . " '"; |
|
| 224 | + $columns['attributes'] = "' ".$attributes." '"; |
|
| 225 | 225 | |
| 226 | 226 | return $columns; |
| 227 | 227 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * @param string $options |
| 235 | 235 | * @return void |
| 236 | 236 | */ |
| 237 | - private function getOptions (string $line, string &$options): void |
|
| 237 | + private function getOptions(string $line, string &$options): void |
|
| 238 | 238 | { |
| 239 | 239 | |
| 240 | 240 | $lineText = \trim(\str_replace([')', ';'], '', $line)); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | if ('' != $options) { |
| 244 | 244 | $options .= ' '; |
| 245 | 245 | } |
| 246 | - $options = "'" . $options . $lineText . "'"; |
|
| 246 | + $options = "'".$options.$lineText."'"; |
|
| 247 | 247 | |
| 248 | 248 | } |
| 249 | 249 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | * @param string $line |
| 254 | 254 | * @return array |
| 255 | 255 | */ |
| 256 | - private function getKey (string $line) |
|
| 256 | + private function getKey(string $line) |
|
| 257 | 257 | { |
| 258 | 258 | |
| 259 | 259 | $key = []; |
@@ -276,12 +276,12 @@ discard block |
||
| 276 | 276 | if ('' == $name) { |
| 277 | 277 | $name = $columns; |
| 278 | 278 | } |
| 279 | - if (\strpos($name,' ') > 0) { |
|
| 280 | - $name = "'" . $name . "'"; |
|
| 279 | + if (\strpos($name, ' ') > 0) { |
|
| 280 | + $name = "'".$name."'"; |
|
| 281 | 281 | } |
| 282 | 282 | $key[$name] = []; |
| 283 | - if (\strpos($columns,' ') > 0) { |
|
| 284 | - $columns = "'" . $columns . "'"; |
|
| 283 | + if (\strpos($columns, ' ') > 0) { |
|
| 284 | + $columns = "'".$columns."'"; |
|
| 285 | 285 | } |
| 286 | 286 | $key[$name]['columns'] = $columns; |
| 287 | 287 | $key[$name]['unique'] = $unique; |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | $moduleDirName = \basename(__DIR__); |
| 73 | 73 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
| 74 | 74 | //in order to be accessable from user and admin area this should be place in language common.php |
| 75 | - if (!\defined('CO_' . $moduleDirNameUpper . '_DELETE_CONFIRM')) { |
|
| 76 | - \define('CO_' . $moduleDirNameUpper . '_DELETE_CONFIRM', 'Confirm delete'); |
|
| 77 | - \define('CO_' . $moduleDirNameUpper . '_DELETE_LABEL', 'Do you really want to delete:'); |
|
| 75 | + if (!\defined('CO_'.$moduleDirNameUpper.'_DELETE_CONFIRM')) { |
|
| 76 | + \define('CO_'.$moduleDirNameUpper.'_DELETE_CONFIRM', 'Confirm delete'); |
|
| 77 | + \define('CO_'.$moduleDirNameUpper.'_DELETE_LABEL', 'Do you really want to delete:'); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | // Get Theme Form |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | $this->action = \Xmf\Request::getString('REQUEST_URI', '', 'SERVER'); |
| 83 | 83 | } |
| 84 | 84 | if ('' === $this->title) { |
| 85 | - $this->title = \constant('CO_' . $moduleDirNameUpper . '_DELETE_CONFIRM'); |
|
| 85 | + $this->title = \constant('CO_'.$moduleDirNameUpper.'_DELETE_CONFIRM'); |
|
| 86 | 86 | } |
| 87 | 87 | if ('' === $this->label) { |
| 88 | 88 | |
| 89 | - $this->label = \constant('CO_' . $moduleDirNameUpper . '_DELETE_LABEL'); |
|
| 89 | + $this->label = \constant('CO_'.$moduleDirNameUpper.'_DELETE_LABEL'); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | \xoops_load('XoopsFormLoader'); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | use XoopsModules\Wggithub\Constants; |
| 26 | 26 | use XoopsModules\Wggithub\Common; |
| 27 | 27 | |
| 28 | -require __DIR__ . '/header.php'; |
|
| 28 | +require __DIR__.'/header.php'; |
|
| 29 | 29 | // It recovered the value of argument op in URL$ |
| 30 | 30 | $op = Request::getCmd('op', 'list');
|
| 31 | 31 | $relId = Request::getInt('rel_id');
|
@@ -70,8 +70,8 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | // Display Navigation |
| 72 | 72 | if ($releasesCount > $limit) {
|
| 73 | - include_once \XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 74 | - $pagenav = new \XoopsPageNav($releasesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
| 73 | + include_once \XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 74 | + $pagenav = new \XoopsPageNav($releasesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
| 75 | 75 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
|
| 76 | 76 | } |
| 77 | 77 | } else {
|
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $releasesObj->setVar('rel_submitter', Request::getInt('rel_submitter', 0));
|
| 108 | 108 | // Insert Data |
| 109 | 109 | if ($releasesHandler->insert($releasesObj)) {
|
| 110 | - \redirect_header('releases.php?op=list&start=' . $start . '&limit=' . $limit, 2, \_AM_WGGITHUB_FORM_OK);
|
|
| 110 | + \redirect_header('releases.php?op=list&start='.$start.'&limit='.$limit, 2, \_AM_WGGITHUB_FORM_OK);
|
|
| 111 | 111 | } |
| 112 | 112 | // Get Form |
| 113 | 113 | $GLOBALS['xoopsTpl']->assign('error', $releasesObj->getHtmlErrors());
|
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | $customConfirm = new Common\Confirm( |
| 143 | 143 | ['ok' => 1, 'rel_id' => $relId, 'op' => 'delete'], |
| 144 | 144 | $_SERVER['REQUEST_URI'], |
| 145 | - \sprintf(\_AM_WGGITHUB_FORM_SURE_DELETE, $repositoriesObj->getVar('repo_name') . ' - ' . $releasesObj->getVar('rel_name')));
|
|
| 145 | + \sprintf(\_AM_WGGITHUB_FORM_SURE_DELETE, $repositoriesObj->getVar('repo_name').' - '.$releasesObj->getVar('rel_name')));
|
|
| 146 | 146 | $form = $customConfirm->getFormConfirm(); |
| 147 | 147 | $GLOBALS['xoopsTpl']->assign('form', $form->render());
|
| 148 | 148 | } |
| 149 | 149 | break; |
| 150 | 150 | } |
| 151 | -require __DIR__ . '/footer.php'; |
|
| 151 | +require __DIR__.'/footer.php'; |
|
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | use XoopsModules\Wggithub\Constants; |
| 26 | 26 | use XoopsModules\Wggithub\Common; |
| 27 | 27 | |
| 28 | -require __DIR__ . '/header.php'; |
|
| 28 | +require __DIR__.'/header.php'; |
|
| 29 | 29 | // It recovered the value of argument op in URL$ |
| 30 | 30 | $op = Request::getCmd('op', 'list');
|
| 31 | 31 | $logId = Request::getInt('log_id');
|
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | // Display Navigation |
| 59 | 59 | if ($logsCount > $limit) {
|
| 60 | - include_once \XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 61 | - $pagenav = new \XoopsPageNav($logsCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
| 60 | + include_once \XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 61 | + $pagenav = new \XoopsPageNav($logsCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
| 62 | 62 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
|
| 63 | 63 | } |
| 64 | 64 | } else {
|
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $logsObj->setVar('log_submitter', Request::getInt('log_submitter', 0));
|
| 85 | 85 | // Insert Data |
| 86 | 86 | if ($logsHandler->insert($logsObj)) {
|
| 87 | - \redirect_header('logs.php?op=list&start=' . $start . '&limit=' . $limit, 2, \_AM_WGGITHUB_FORM_OK);
|
|
| 87 | + \redirect_header('logs.php?op=list&start='.$start.'&limit='.$limit, 2, \_AM_WGGITHUB_FORM_OK);
|
|
| 88 | 88 | } |
| 89 | 89 | // Get Form |
| 90 | 90 | $GLOBALS['xoopsTpl']->assign('error', $logsObj->getHtmlErrors());
|
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $customConfirm = new Common\Confirm( |
| 119 | 119 | ['ok' => 1, 'log_id' => $logId, 'op' => 'delete'], |
| 120 | 120 | $_SERVER['REQUEST_URI'], |
| 121 | - \sprintf(\_AM_WGGITHUB_FORM_SURE_DELETE, $logsObj->getVar('log_id') . ': ' . $logsObj->getVar('log_details')));
|
|
| 121 | + \sprintf(\_AM_WGGITHUB_FORM_SURE_DELETE, $logsObj->getVar('log_id').': '.$logsObj->getVar('log_details')));
|
|
| 122 | 122 | $form = $customConfirm->getFormConfirm(); |
| 123 | 123 | $GLOBALS['xoopsTpl']->assign('form', $form->render());
|
| 124 | 124 | } |
@@ -144,4 +144,4 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | break; |
| 146 | 146 | } |
| 147 | -require __DIR__ . '/footer.php'; |
|
| 147 | +require __DIR__.'/footer.php'; |
|
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | use XoopsModules\Wggithub\Constants; |
| 26 | 26 | use XoopsModules\Wggithub\Common; |
| 27 | 27 | |
| 28 | -require __DIR__ . '/header.php'; |
|
| 28 | +require __DIR__.'/header.php'; |
|
| 29 | 29 | // It recovered the value of argument op in URL$ |
| 30 | 30 | $op = Request::getCmd('op', 'list');
|
| 31 | 31 | $rmId = Request::getInt('rm_id');
|
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $in[] = $i; |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | - $crReadmes->add(new \Criteria('rm_repoid', '(' . \implode(',', $in) . ')', 'IN'));
|
|
| 66 | + $crReadmes->add(new \Criteria('rm_repoid', '('.\implode(',', $in).')', 'IN'));
|
|
| 67 | 67 | } |
| 68 | 68 | $crReadmes->setStart($start); |
| 69 | 69 | $crReadmes->setLimit($limit); |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | // Display Navigation |
| 83 | 83 | if ($readmesCount > $limit) {
|
| 84 | - include_once \XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 85 | - $pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
| 84 | + include_once \XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 85 | + $pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
| 86 | 86 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
|
| 87 | 87 | } |
| 88 | 88 | } else {
|
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $readmesObj->setVar('rm_submitter', Request::getInt('rm_submitter', 0));
|
| 119 | 119 | // Insert Data |
| 120 | 120 | if ($readmesHandler->insert($readmesObj)) {
|
| 121 | - \redirect_header('readmes.php?op=list&start=' . $start . '&limit=' . $limit, 2, \_AM_WGGITHUB_FORM_OK);
|
|
| 121 | + \redirect_header('readmes.php?op=list&start='.$start.'&limit='.$limit, 2, \_AM_WGGITHUB_FORM_OK);
|
|
| 122 | 122 | } |
| 123 | 123 | // Get Form |
| 124 | 124 | $GLOBALS['xoopsTpl']->assign('error', $readmesObj->getHtmlErrors());
|
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | $customConfirm = new Common\Confirm( |
| 154 | 154 | ['ok' => 1, 'rm_id' => $rmId, 'op' => 'delete'], |
| 155 | 155 | $_SERVER['REQUEST_URI'], |
| 156 | - \sprintf(\_AM_WGGITHUB_FORM_SURE_DELETE, $repositoriesObj->getVar('repo_name') . ' - ' . $readmesObj->getVar('rm_name')));
|
|
| 156 | + \sprintf(\_AM_WGGITHUB_FORM_SURE_DELETE, $repositoriesObj->getVar('repo_name').' - '.$readmesObj->getVar('rm_name')));
|
|
| 157 | 157 | $form = $customConfirm->getFormConfirm(); |
| 158 | 158 | $GLOBALS['xoopsTpl']->assign('form', $form->render());
|
| 159 | 159 | } |
| 160 | 160 | break; |
| 161 | 161 | } |
| 162 | -require __DIR__ . '/footer.php'; |
|
| 162 | +require __DIR__.'/footer.php'; |
|
@@ -48,8 +48,8 @@ |
||
| 48 | 48 | if ($dirInfo->isDir()) {
|
| 49 | 49 | // The directory exists so rename it |
| 50 | 50 | $date = date('Y-m-d');
|
| 51 | - if (!rename($uploadDirectory, $uploadDirectory . "_bak_$date")) {
|
|
| 52 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $uploadDirectory));
|
|
| 51 | + if (!rename($uploadDirectory, $uploadDirectory."_bak_$date")) {
|
|
| 52 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH'), $uploadDirectory));
|
|
| 53 | 53 | $success = false; |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -54,21 +54,21 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | function xoops_module_update_wggithub($module, $prev_version = null) |
| 56 | 56 | {
|
| 57 | - require \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
| 57 | + require \dirname(__DIR__).'/preloads/autoloader.php'; |
|
| 58 | 58 | |
| 59 | 59 | $moduleDirName = $module->dirname(); |
| 60 | 60 | |
| 61 | 61 | //wggithub_check_db($module); |
| 62 | 62 | |
| 63 | 63 | //check upload directory |
| 64 | - include_once __DIR__ . '/install.php'; |
|
| 64 | + include_once __DIR__.'/install.php'; |
|
| 65 | 65 | xoops_module_install_wggithub($module); |
| 66 | 66 | |
| 67 | 67 | // update DB corresponding to sql/mysql.sql |
| 68 | 68 | $configurator = new Configurator(); |
| 69 | 69 | $migrate = new Migrate($configurator); |
| 70 | 70 | |
| 71 | - $fileSql = \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/sql/mysql.sql'; |
|
| 71 | + $fileSql = \XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/sql/mysql.sql'; |
|
| 72 | 72 | // ToDo: add function setDefinitionFile to .\class\libraries\vendor\xoops\xmf\src\Database\Migrate.php |
| 73 | 73 | // Todo: once we are using setDefinitionFile this part has to be adapted |
| 74 | 74 | //$fileYaml = \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/sql/update_' . $moduleDirName . '_migrate.yml'; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | // as long as this is not done default file has to be created |
| 79 | 79 | $moduleVersionOld = $module->getInfo('version');
|
| 80 | 80 | $moduleVersionNew = \str_replace(['.', '-'], '_', $moduleVersionOld); |
| 81 | - $fileYaml = \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/sql/{$moduleDirName}_{$moduleVersionNew}_migrate.yml";
|
|
| 81 | + $fileYaml = \XOOPS_ROOT_PATH.'/modules/'.$moduleDirName."/sql/{$moduleDirName}_{$moduleVersionNew}_migrate.yml";
|
|
| 82 | 82 | //} |
| 83 | 83 | |
| 84 | 84 | // create a schema file based on sql/mysql.sql |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | //create copy for XOOPS 2.5.11 Beta 1 and older versions |
| 92 | - $fileYaml2 = \XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/sql/{$moduleDirName}_{$moduleVersionOld}_migrate.yml";
|
|
| 92 | + $fileYaml2 = \XOOPS_ROOT_PATH.'/modules/'.$moduleDirName."/sql/{$moduleDirName}_{$moduleVersionOld}_migrate.yml";
|
|
| 93 | 93 | \copy($fileYaml, $fileYaml2); |
| 94 | 94 | |
| 95 | 95 | // run standard procedure for db migration |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | 'license_url' => 'http://www.gnu.org/licenses/gpl-3.0.en.html', |
| 40 | 40 | 'help' => 'page=help', |
| 41 | 41 | 'release_info' => 'release_info', |
| 42 | - 'release_file' => \XOOPS_URL . '/modules/wggithub/docs/release_info file', |
|
| 42 | + 'release_file' => \XOOPS_URL.'/modules/wggithub/docs/release_info file', |
|
| 43 | 43 | 'release_date' => '2022/08/08', |
| 44 | 44 | 'manual' => 'link to manual file', |
| 45 | - 'manual_file' => \XOOPS_URL . '/modules/wggithub/docs/install.txt', |
|
| 45 | + 'manual_file' => \XOOPS_URL.'/modules/wggithub/docs/install.txt', |
|
| 46 | 46 | 'min_php' => '7.4', |
| 47 | 47 | 'min_xoops' => '2.5.11 Stable', |
| 48 | 48 | 'min_admin' => '1.2', |
@@ -299,8 +299,8 @@ discard block |
||
| 299 | 299 | // Make Sample button visible? |
| 300 | 300 | $modversion['config'][] = [ |
| 301 | 301 | 'name' => 'displaySampleButton', |
| 302 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', |
|
| 303 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', |
|
| 302 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON', |
|
| 303 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON_DESC', |
|
| 304 | 304 | 'formtype' => 'yesno', |
| 305 | 305 | 'valuetype' => 'int', |
| 306 | 306 | 'default' => 1, |
@@ -49,13 +49,13 @@ discard block |
||
| 49 | 49 | $currentVer = $versionText; |
| 50 | 50 | } |
| 51 | 51 | if (null === $requiredVer) {
|
| 52 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string
|
|
| 52 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string
|
|
| 53 | 53 | } |
| 54 | 54 | $success = true; |
| 55 | 55 | |
| 56 | 56 | if ($module->versionCompare($currentVer, $requiredVer, '<')) {
|
| 57 | 57 | $success = false; |
| 58 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer));
|
|
| 58 | + $module->setErrors(\sprintf(\constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer));
|
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | return $success; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | if (false !== $reqVer && '' !== $reqVer) {
|
| 86 | 86 | if (\version_compare($verNum, $reqVer, '<')) {
|
| 87 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum));
|
|
| 87 | + $module->setErrors(\sprintf(\constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum));
|
|
| 88 | 88 | $success = false; |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
| 107 | 107 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
| 108 | 108 | $update = ''; |
| 109 | - $repository = 'XoopsModules25x/' . $moduleDirName; |
|
| 109 | + $repository = 'XoopsModules25x/'.$moduleDirName; |
|
| 110 | 110 | // $repository = 'XoopsModules25x/publisher'; //for testing only |
| 111 | 111 | $ret = ''; |
| 112 | 112 | $infoReleasesUrl = "https://api.github.com/repos/$repository/releases"; |
@@ -120,14 +120,14 @@ discard block |
||
| 120 | 120 | if (false === $curlReturn) {
|
| 121 | 121 | \trigger_error(\curl_error($curlHandle)); |
| 122 | 122 | } elseif (\mb_strpos($curlReturn, 'Not Found')) {
|
| 123 | - \trigger_error('Repository Not Found: ' . $infoReleasesUrl);
|
|
| 123 | + \trigger_error('Repository Not Found: '.$infoReleasesUrl);
|
|
| 124 | 124 | } else {
|
| 125 | 125 | $file = \json_decode($curlReturn, false); |
| 126 | 126 | $latestVersionLink = \sprintf("https://github.com/$repository/archive/%s.zip", $file ? reset($file)->tag_name : $default);
|
| 127 | 127 | $latestVersion = $file[0]->tag_name; |
| 128 | 128 | $prerelease = $file[0]->prerelease; |
| 129 | 129 | if ('master' !== $latestVersionLink) {
|
| 130 | - $update = \constant('CO_' . $moduleDirNameUpper . '_' . 'NEW_VERSION') . $latestVersion;
|
|
| 130 | + $update = \constant('CO_'.$moduleDirNameUpper.'_'.'NEW_VERSION').$latestVersion;
|
|
| 131 | 131 | } |
| 132 | 132 | //"PHP-standardized" version |
| 133 | 133 | $latestVersion = \mb_strtolower($latestVersion); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $latestVersion = \str_replace('_', '', \mb_strtolower($latestVersion));
|
| 136 | 136 | $latestVersion = \str_replace('final', '', \mb_strtolower($latestVersion));
|
| 137 | 137 | } |
| 138 | - $moduleVersion = ($helper->getModule()->getInfo('version') . '_' . $helper->getModule()->getInfo('module_status'));
|
|
| 138 | + $moduleVersion = ($helper->getModule()->getInfo('version').'_'.$helper->getModule()->getInfo('module_status'));
|
|
| 139 | 139 | //"PHP-standardized" version |
| 140 | 140 | $moduleVersion = \str_replace(' ', '', \mb_strtolower($moduleVersion));
|
| 141 | 141 | // $moduleVersion = '1.0'; //for testing only |