@@ -71,18 +71,18 @@ |
||
| 71 | 71 | 'bannerfinish', |
| 72 | 72 | ]; |
| 73 | 73 | $footer = '<div class="adminfooter">' |
| 74 | - . "\n" |
|
| 75 | - . '<div style="text-align: center;">' |
|
| 76 | - . "\n" |
|
| 77 | - . ' <a href="https://www.xoops.org" rel="external"><img src="' |
|
| 78 | - . $pathIcon32 |
|
| 79 | - . '/xoopsmicrobutton.gif" alt="XOOPS" title="XOOPS"></a>' |
|
| 80 | - . "\n" |
|
| 81 | - . ' </div>' |
|
| 82 | - . "\n" |
|
| 83 | - . ' <div class="center smallsmall italic pad5"> this module is maintained by <a href="https://store.chg-web.com" rel="external">Cedric MONTUY CHG-WEB</a>' |
|
| 84 | - . "\n" |
|
| 85 | - . '</div>'; |
|
| 74 | + . "\n" |
|
| 75 | + . '<div style="text-align: center;">' |
|
| 76 | + . "\n" |
|
| 77 | + . ' <a href="https://www.xoops.org" rel="external"><img src="' |
|
| 78 | + . $pathIcon32 |
|
| 79 | + . '/xoopsmicrobutton.gif" alt="XOOPS" title="XOOPS"></a>' |
|
| 80 | + . "\n" |
|
| 81 | + . ' </div>' |
|
| 82 | + . "\n" |
|
| 83 | + . ' <div class="center smallsmall italic pad5"> this module is maintained by <a href="https://store.chg-web.com" rel="external">Cedric MONTUY CHG-WEB</a>' |
|
| 84 | + . "\n" |
|
| 85 | + . '</div>'; |
|
| 86 | 86 | |
| 87 | 87 | // Whether the os php is running on is windows or not |
| 88 | 88 | if (!defined('PMA_IS_WINDOWS')) { |
@@ -22,16 +22,16 @@ discard block |
||
| 22 | 22 | define('MAX_DUMPSIZE', 1024); |
| 23 | 23 | |
| 24 | 24 | // For the export features... |
| 25 | -$cfg['ZipDump'] = true; // Allow the use of zip/gzip/bzip |
|
| 26 | -$cfg['GZipDump'] = true; // compression for |
|
| 27 | -$cfg['BZipDump'] = true; // dump files |
|
| 25 | +$cfg['ZipDump'] = true; // Allow the use of zip/gzip/bzip |
|
| 26 | +$cfg['GZipDump'] = true; // compression for |
|
| 27 | +$cfg['BZipDump'] = true; // dump files |
|
| 28 | 28 | //Check for php.ini |
| 29 | 29 | //memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) |
| 30 | 30 | //; Maximum size of POST data that PHP will accept. |
| 31 | 31 | //post_max_size = 8M |
| 32 | 32 | //; Maximum allowed size for uploaded files. |
| 33 | 33 | //upload_max_filesize = 2M |
| 34 | -$maxbyte = '8000000'; // Upload Max FileSize ( Dipend on php.ini def = 2M ) |
|
| 34 | +$maxbyte = '8000000'; // Upload Max FileSize ( Dipend on php.ini def = 2M ) |
|
| 35 | 35 | // |
| 36 | 36 | // Start a session and get variables |
| 37 | 37 | // |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | 'banner', |
| 71 | 71 | 'bannerfinish', |
| 72 | 72 | ]; |
| 73 | -$footer = '<div class="adminfooter">' |
|
| 73 | +$footer = '<div class="adminfooter">' |
|
| 74 | 74 | . "\n" |
| 75 | 75 | . '<div style="text-align: center;">' |
| 76 | 76 | . "\n" |
@@ -13,11 +13,11 @@ |
||
| 13 | 13 | |
| 14 | 14 | /** @var Admin $adminObject */ |
| 15 | 15 | |
| 16 | -require __DIR__ . '/admin_header.php'; |
|
| 16 | +require __DIR__.'/admin_header.php'; |
|
| 17 | 17 | xoops_cp_header(); |
| 18 | 18 | |
| 19 | 19 | $adminObject->displayNavigation(basename(__FILE__)); |
| 20 | 20 | $adminObject::setPaypal('2MHAG2L3NZG8G'); |
| 21 | 21 | $adminObject->displayAbout(false); |
| 22 | 22 | |
| 23 | -require __DIR__ . '/admin_footer.php'; |
|
| 23 | +require __DIR__.'/admin_footer.php'; |
|
@@ -51,14 +51,14 @@ |
||
| 51 | 51 | $checkall = Request::getString('checkall', '', 'GET'); |
| 52 | 52 | |
| 53 | 53 | $tr_comp = '<tr><td class="odd"><strong>' |
| 54 | - . _AM_COMPRESSION |
|
| 55 | - . '</strong></td>' |
|
| 56 | - . '<td><input type="radio" id="gzip" name="file_compression" value="gzip" checked>' |
|
| 57 | - . '<label for="gz">gzip</label> ' |
|
| 58 | - . '<input type="radio" id="zip" name="file_compression" value="zip">' |
|
| 59 | - . '<label for="sql">zip</label>  ' |
|
| 60 | - . '<input type="radio" id="plain" name="file_compression" value="none">' |
|
| 61 | - . '<label for="sql">text</label>  </td></tr>'; |
|
| 54 | + . _AM_COMPRESSION |
|
| 55 | + . '</strong></td>' |
|
| 56 | + . '<td><input type="radio" id="gzip" name="file_compression" value="gzip" checked>' |
|
| 57 | + . '<label for="gz">gzip</label> ' |
|
| 58 | + . '<input type="radio" id="zip" name="file_compression" value="zip">' |
|
| 59 | + . '<label for="sql">zip</label>  ' |
|
| 60 | + . '<input type="radio" id="plain" name="file_compression" value="none">' |
|
| 61 | + . '<label for="sql">text</label>  </td></tr>'; |
|
| 62 | 62 | $tr_strd = '<tr><td class="odd" style="width:30%;"><strong>' . _AM_DETAILSTOBACKUP . '</strong></td>' . '<td><input type="checkbox" name="structure" checked> ' . _AM_TABLESTRUCTURE . ' ' . '<input type="checkbox" name="data" checked> ' . _AM_TABLEDATA . ' </td></tr>'; |
| 63 | 63 | |
| 64 | 64 | // Handle URL actions |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | /** @var Admin $adminObject */ |
| 16 | 16 | |
| 17 | -require_once __DIR__ . '/admin_header.php'; |
|
| 17 | +require_once __DIR__.'/admin_header.php'; |
|
| 18 | 18 | xoops_cp_header(); |
| 19 | 19 | $adminObject = Admin::getInstance(); |
| 20 | 20 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | . '<label for="sql">zip</label>  ' |
| 60 | 60 | . '<input type="radio" id="plain" name="file_compression" value="none">' |
| 61 | 61 | . '<label for="sql">text</label>  </td></tr>'; |
| 62 | -$tr_strd = '<tr><td class="odd" style="width:30%;"><strong>' . _AM_DETAILSTOBACKUP . '</strong></td>' . '<td><input type="checkbox" name="structure" checked> ' . _AM_TABLESTRUCTURE . ' ' . '<input type="checkbox" name="data" checked> ' . _AM_TABLEDATA . ' </td></tr>'; |
|
| 62 | +$tr_strd = '<tr><td class="odd" style="width:30%;"><strong>'._AM_DETAILSTOBACKUP.'</strong></td>'.'<td><input type="checkbox" name="structure" checked> '._AM_TABLESTRUCTURE.' '.'<input type="checkbox" name="data" checked> '._AM_TABLEDATA.' </td></tr>'; |
|
| 63 | 63 | |
| 64 | 64 | // Handle URL actions |
| 65 | 65 | switch ($mode) { |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | { |
| 68 | 68 | $select_dirname = isset($_GET['dirname']) ? filter_input(INPUT_GET, 'dirname', FILTER_SANITIZE_STRING) : 0; |
| 69 | 69 | $mod_selections = $bp->make_module_selection($select_dirname); |
| 70 | - echo '<form method="post" action="index2.php?mode=' . POST_SELECT_TABLES_FORM . '&alltables=on">'; |
|
| 71 | - echo '<table class="outer" style="width:100%;"><tr><td class="head" colspan=2>' . _AM_MODULEBACKUP . '</td></tr>'; |
|
| 72 | - echo '<tr><td class="odd"><strong>' . _AM_SELECTMODULE . '</strong></td><td>' . $mod_selections . '</td></tr>'; |
|
| 70 | + echo '<form method="post" action="index2.php?mode='.POST_SELECT_TABLES_FORM.'&alltables=on">'; |
|
| 71 | + echo '<table class="outer" style="width:100%;"><tr><td class="head" colspan=2>'._AM_MODULEBACKUP.'</td></tr>'; |
|
| 72 | + echo '<tr><td class="odd"><strong>'._AM_SELECTMODULE.'</strong></td><td>'.$mod_selections.'</td></tr>'; |
|
| 73 | 73 | echo $tr_strd; |
| 74 | 74 | echo $tr_comp; |
| 75 | - echo '<tr><td colspan=2 style="text-align: center;"><input type="submit" value="' . _AM_BACKUP . '"></td></tr></table>'; |
|
| 75 | + echo '<tr><td colspan=2 style="text-align: center;"><input type="submit" value="'._AM_BACKUP.'"></td></tr></table>'; |
|
| 76 | 76 | echo '</form>'; |
| 77 | 77 | //echo '</p>'; |
| 78 | 78 | echo '<br>'; |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | $num_tables = count($result); |
| 89 | 89 | $checkall = true; |
| 90 | 90 | } else { |
| 91 | - $result = $xoopsDB->queryF('SHOW TABLES FROM ' . $db_selected); |
|
| 91 | + $result = $xoopsDB->queryF('SHOW TABLES FROM '.$db_selected); |
|
| 92 | 92 | $num_tables = $xoopsDB->getRowsNum($result); |
| 93 | 93 | } |
| 94 | 94 | echo '<table class="outer" style="width:100%">'; |
| 95 | - echo '<form method="post" action="index2.php?mode=' . POST_SELECT_TABLES_FORM . '&num_tables=' . $num_tables . '">'; |
|
| 96 | - echo '<tr><td class="head" colspan="2"><strong>' . _AM_SELECTTABLES . '</strong></td></tr>'; |
|
| 97 | - echo '<tr><td class="main_left" colspan="2"><p>' . _AM_BACKUPNOTICE . '</p>'; |
|
| 98 | - echo '<p><strong>' . _AM_SELECTTABLE . '</strong></p>'; |
|
| 95 | + echo '<form method="post" action="index2.php?mode='.POST_SELECT_TABLES_FORM.'&num_tables='.$num_tables.'">'; |
|
| 96 | + echo '<tr><td class="head" colspan="2"><strong>'._AM_SELECTTABLES.'</strong></td></tr>'; |
|
| 97 | + echo '<tr><td class="main_left" colspan="2"><p>'._AM_BACKUPNOTICE.'</p>'; |
|
| 98 | + echo '<p><strong>'._AM_SELECTTABLE.'</strong></p>'; |
|
| 99 | 99 | $checked = (!empty($checkall) ? ' checked' : ''); |
| 100 | 100 | for ($i = 0; $i < $num_tables; ++$i) { |
| 101 | 101 | if ('module' == $action && $dirname) { |
@@ -111,18 +111,18 @@ discard block |
||
| 111 | 111 | $tablename, |
| 112 | 112 | $tablename |
| 113 | 113 | ); |
| 114 | - echo '<tr><td class="main_left" colspan="2">' . $checkbox_string . '</td></tr>'; |
|
| 114 | + echo '<tr><td class="main_left" colspan="2">'.$checkbox_string.'</td></tr>'; |
|
| 115 | 115 | } |
| 116 | 116 | if ('module' == $action && $dirname) { |
| 117 | - echo '<input type="hidden" name="dirname" value="' . $dirname . '>'; |
|
| 117 | + echo '<input type="hidden" name="dirname" value="'.$dirname.'>'; |
|
| 118 | 118 | } |
| 119 | 119 | echo '<tr><td colspan="2">'; |
| 120 | - echo '<a href="' . XOOPS_URL . '/modules/backpack/admin/index.php?mode=' . POST_DB_SELECT_FORM . '&action=backup&checkall=1">' . _AM_CHECKALL . '</a></td></tr>'; |
|
| 120 | + echo '<a href="'.XOOPS_URL.'/modules/backpack/admin/index.php?mode='.POST_DB_SELECT_FORM.'&action=backup&checkall=1">'._AM_CHECKALL.'</a></td></tr>'; |
|
| 121 | 121 | echo $tr_strd; |
| 122 | 122 | echo $tr_comp; |
| 123 | 123 | echo '<tr><td colspan="2">'; |
| 124 | - echo '<p><input type="submit" value="' . _AM_BACKUP . '">'; |
|
| 125 | - echo '<input type="reset" value="' . _AM_RESET . '">'; |
|
| 124 | + echo '<p><input type="submit" value="'._AM_BACKUP.'">'; |
|
| 125 | + echo '<input type="reset" value="'._AM_RESET.'">'; |
|
| 126 | 126 | echo '</p></td></tr></form></table>'; |
| 127 | 127 | break; |
| 128 | 128 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | $num_tables = count($result); |
| 155 | 155 | } else { |
| 156 | - $result = $xoopsDB->queryF('SHOW TABLES FROM ' . $db_selected); |
|
| 156 | + $result = $xoopsDB->queryF('SHOW TABLES FROM '.$db_selected); |
|
| 157 | 157 | $num_tables = $xoopsDB->getRowsNum($result); |
| 158 | 158 | } |
| 159 | 159 | $j = 0; |
@@ -180,27 +180,27 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | if ($dirname) { |
| 183 | - $filename = $dirname . date('YmdHis', time()); |
|
| 183 | + $filename = $dirname.date('YmdHis', time()); |
|
| 184 | 184 | } elseif ($alltables) { |
| 185 | - $filename = 'xdb' . date('YmdHis', time()); |
|
| 185 | + $filename = 'xdb'.date('YmdHis', time()); |
|
| 186 | 186 | } else { |
| 187 | - $filename = 'xtbl' . date('YmdHis', time()); |
|
| 187 | + $filename = 'xtbl'.date('YmdHis', time()); |
|
| 188 | 188 | } |
| 189 | 189 | $cfgZipType = filter_input(INPUT_POST, 'file_compression', FILTER_SANITIZE_STRING); //$_POST['file_compression'] ; |
| 190 | 190 | $bp->backup_data($tablename_array, $backup_structure, $backup_data, $filename, $cfgZipType); |
| 191 | 191 | $download_fname = $bp->download_fname(); |
| 192 | 192 | if (1 == $bp->download_count) { |
| 193 | 193 | //redirect_header("./download.php?url=".$download_fname[0]['filename'], 1, _AM_READY_TO_DOWNLOAD); |
| 194 | - $url = './download.php?url=' . $download_fname[0]['filename']; |
|
| 194 | + $url = './download.php?url='.$download_fname[0]['filename']; |
|
| 195 | 195 | $time = 1; |
| 196 | 196 | $message = _AM_READY_TO_DOWNLOAD; |
| 197 | 197 | $url = preg_replace('/&/i', '&', htmlspecialchars($url, ENT_QUOTES)); |
| 198 | 198 | echo ' |
| 199 | 199 | <html> |
| 200 | 200 | <head> |
| 201 | - <title>' . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES | ENT_HTML5) . '</title> |
|
| 202 | - <meta http-equiv="Content-Type" content="text/html; charset=' . _CHARSET . '"> |
|
| 203 | - <meta http-equiv="Refresh" content="' . $time . '; url=' . $url . '"> |
|
| 201 | + <title>' . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES | ENT_HTML5).'</title> |
|
| 202 | + <meta http-equiv="Content-Type" content="text/html; charset=' . _CHARSET.'"> |
|
| 203 | + <meta http-equiv="Refresh" content="' . $time.'; url='.$url.'"> |
|
| 204 | 204 | <style type="text/css"> |
| 205 | 205 | body {background-color : #fcfcfc; font-size: 12px; font-family: Trebuchet MS,Verdana, Arial, Helvetica, sans-serif; margin: 0px;} |
| 206 | 206 | .redirect {width: 70%; margin: 110px; text-align: center; padding: 15px; border: #e0e0e0 1px solid; color: #666666; background-color: #f6f6f6;} |
@@ -212,9 +212,9 @@ discard block |
||
| 212 | 212 | <body> |
| 213 | 213 | <div align="center"> |
| 214 | 214 | <div class="redirect"> |
| 215 | - <span style="font-size: 16px; font-weight: bold;">' . $message . '</span> |
|
| 215 | + <span style="font-size: 16px; font-weight: bold;">' . $message.'</span> |
|
| 216 | 216 | <hr style="height: 3px; border: 3px #E18A00 solid; width: 95%;"> |
| 217 | - <p>' . sprintf(_AM_IFNOTRELOAD, $url) . '</p> |
|
| 217 | + <p>' . sprintf(_AM_IFNOTRELOAD, $url).'</p> |
|
| 218 | 218 | </div> |
| 219 | 219 | </div> |
| 220 | 220 | </body> |
@@ -223,8 +223,8 @@ discard block |
||
| 223 | 223 | $form = new XoopsThemeForm(_AM_DOWNLOAD_LIST, 'download', $_SERVER['PHP_SELF']); |
| 224 | 224 | $iMax = count($download_fname); |
| 225 | 225 | for ($i = 0; $i < $iMax; ++$i) { |
| 226 | - $url = '<a href="download.php?url=' . $download_fname[$i]['filename'] . '" target="_blank">' . $download_fname[$i]['filename'] . '</a>'; |
|
| 227 | - $url .= $download_fname[$i]['line'] . 'lines ' . $download_fname[$i]['size'] . 'bytes<br>'; |
|
| 226 | + $url = '<a href="download.php?url='.$download_fname[$i]['filename'].'" target="_blank">'.$download_fname[$i]['filename'].'</a>'; |
|
| 227 | + $url .= $download_fname[$i]['line'].'lines '.$download_fname[$i]['size'].'bytes<br>'; |
|
| 228 | 228 | $form->addElement(new XoopsFormLabel($i, $url)); |
| 229 | 229 | } |
| 230 | 230 | $form->addElement(new XoopsFormButton('', 'purgeallfiles', _AM_PURGE_FILES, 'submit')); |
@@ -237,11 +237,11 @@ discard block |
||
| 237 | 237 | { |
| 238 | 238 | echo '<table cellspacing="0" cellpadding="3">'; |
| 239 | 239 | if ('backup' == $action) { |
| 240 | - echo '<tr><td class="title">' . _AM_TITLE_BCK . '</td></tr>'; |
|
| 241 | - echo '<tr><td class="main_left"><p><b>' . _AM_SELECT_DATABASE . '</b>'; |
|
| 240 | + echo '<tr><td class="title">'._AM_TITLE_BCK.'</td></tr>'; |
|
| 241 | + echo '<tr><td class="main_left"><p><b>'._AM_SELECT_DATABASE.'</b>'; |
|
| 242 | 242 | } |
| 243 | 243 | if ('backup' == $action) { |
| 244 | - echo '<form method="post" action="index2.php?mode=' . POST_DB_SELECT_FORM . '">'; |
|
| 244 | + echo '<form method="post" action="index2.php?mode='.POST_DB_SELECT_FORM.'">'; |
|
| 245 | 245 | } |
| 246 | 246 | echo '<input type="submit" value="Restore">'; |
| 247 | 247 | echo '</form></p></td></tr></table>'; |
@@ -249,14 +249,14 @@ discard block |
||
| 249 | 249 | } |
| 250 | 250 | default: |
| 251 | 251 | { |
| 252 | - $result = $xoopsDB->queryF('SHOW TABLES FROM ' . $db_selected); |
|
| 252 | + $result = $xoopsDB->queryF('SHOW TABLES FROM '.$db_selected); |
|
| 253 | 253 | $num_tables = $xoopsDB->getRowsNum($result); |
| 254 | - echo '<form method="post" action="index2.php?mode=' . POST_SELECT_TABLES_FORM . '&num_tables=' . $num_tables . '&alltables=on">'; |
|
| 255 | - echo '<table class="outer" style="width:100%;"><tr><td class="head" colspan="2">' . _AM_BACKUPTITLE . '</td></tr>'; |
|
| 254 | + echo '<form method="post" action="index2.php?mode='.POST_SELECT_TABLES_FORM.'&num_tables='.$num_tables.'&alltables=on">'; |
|
| 255 | + echo '<table class="outer" style="width:100%;"><tr><td class="head" colspan="2">'._AM_BACKUPTITLE.'</td></tr>'; |
|
| 256 | 256 | echo $tr_strd; |
| 257 | 257 | echo $tr_comp; |
| 258 | - echo '<tr><td colspan="2" style="text-align: center;"><input type="submit" value="' . _AM_BACKUP . '"></td></tr></table></form>'; |
|
| 258 | + echo '<tr><td colspan="2" style="text-align: center;"><input type="submit" value="'._AM_BACKUP.'"></td></tr></table></form>'; |
|
| 259 | 259 | echo '<br>'; |
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | -require __DIR__ . '/admin_footer.php'; |
|
| 262 | +require __DIR__.'/admin_footer.php'; |
|
@@ -12,14 +12,14 @@ discard block |
||
| 12 | 12 | defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
| 13 | 13 | |
| 14 | 14 | $path = dirname(__DIR__, 3); |
| 15 | -require_once $path . '/mainfile.php'; |
|
| 15 | +require_once $path.'/mainfile.php'; |
|
| 16 | 16 | |
| 17 | 17 | $dirname = basename(dirname(__DIR__)); |
| 18 | 18 | $moduleHandler = xoops_getHandler('module'); |
| 19 | 19 | $module = $moduleHandler->getByDirname($dirname); |
| 20 | 20 | $pathIcon32 = $module->getInfo('icons32'); |
| 21 | 21 | $pathModuleAdmin = $module->getInfo('dirmoduleadmin'); |
| 22 | -$pathLanguage = $path . $pathModuleAdmin; |
|
| 22 | +$pathLanguage = $path.$pathModuleAdmin; |
|
| 23 | 23 | //$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); |
| 24 | 24 | $moduleDirName = basename(dirname(__DIR__)); |
| 25 | 25 | $moduleDirNameUpper = mb_strtoupper($moduleDirName); |
@@ -30,29 +30,29 @@ discard block |
||
| 30 | 30 | $i = 1; |
| 31 | 31 | $adminmenu[$i]['title'] = _MI_ACCUEIL; |
| 32 | 32 | $adminmenu[$i]['link'] = 'admin/index.php'; |
| 33 | -$adminmenu[$i]['icon'] = $pathIcon32 . '/index.png'; |
|
| 33 | +$adminmenu[$i]['icon'] = $pathIcon32.'/index.png'; |
|
| 34 | 34 | $i++; |
| 35 | 35 | $adminmenu[$i]['title'] = _MI_BACKUPTITLE; |
| 36 | 36 | $adminmenu[$i]['link'] = 'admin/index2.php'; |
| 37 | -$adminmenu[$i]['icon'] = $pathIcon32 . '/list.png'; |
|
| 37 | +$adminmenu[$i]['icon'] = $pathIcon32.'/list.png'; |
|
| 38 | 38 | $i++; |
| 39 | 39 | $adminmenu[$i]['title'] = _MI_MODULEBACKUP; |
| 40 | 40 | $adminmenu[$i]['link'] = 'admin/index2.php?mode=7'; |
| 41 | -$adminmenu[$i]['icon'] = $pathIcon32 . '/export.png'; |
|
| 41 | +$adminmenu[$i]['icon'] = $pathIcon32.'/export.png'; |
|
| 42 | 42 | $i++; |
| 43 | 43 | $adminmenu[$i]['title'] = _MI_SELECTTABLES; |
| 44 | 44 | $adminmenu[$i]['link'] = 'admin/index2.php?mode=2&action=backup'; |
| 45 | -$adminmenu[$i]['icon'] = $pathIcon32 . '/list.png'; |
|
| 45 | +$adminmenu[$i]['icon'] = $pathIcon32.'/list.png'; |
|
| 46 | 46 | $i++; |
| 47 | 47 | $adminmenu[$i]['title'] = _MI_RESTORE; |
| 48 | 48 | $adminmenu[$i]['link'] = 'admin/restore.php'; |
| 49 | -$adminmenu[$i]['icon'] = $pathIcon32 . '/download.png'; |
|
| 49 | +$adminmenu[$i]['icon'] = $pathIcon32.'/download.png'; |
|
| 50 | 50 | $i++; |
| 51 | 51 | $adminmenu[$i]['title'] = _MI_OPTIMIZE; |
| 52 | 52 | $adminmenu[$i]['link'] = 'admin/optimizer.php'; |
| 53 | -$adminmenu[$i]['icon'] = $pathIcon32 . '/synchronized.png'; |
|
| 53 | +$adminmenu[$i]['icon'] = $pathIcon32.'/synchronized.png'; |
|
| 54 | 54 | $i++; |
| 55 | 55 | $adminmenu[$i]['title'] = _MI_ABOUT; |
| 56 | 56 | $adminmenu[$i]['link'] = 'admin/about.php'; |
| 57 | -$adminmenu[$i]['icon'] = $pathIcon32 . '/about.png'; |
|
| 57 | +$adminmenu[$i]['icon'] = $pathIcon32.'/about.png'; |
|
| 58 | 58 | unset($i); |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | use Xmf\Module\Admin; |
| 13 | 13 | /** @var Admin $adminObject */ |
| 14 | 14 | |
| 15 | -require_once __DIR__ . '/admin_header.php'; |
|
| 15 | +require_once __DIR__.'/admin_header.php'; |
|
| 16 | 16 | xoops_cp_header(); |
| 17 | 17 | $adminObject = Admin::getInstance(); |
| 18 | 18 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -45,25 +45,25 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $bp = new backpack(); |
| 47 | 47 | if ($bp->err_msg) { |
| 48 | - echo '<span style="color: red; ">' . $bp->err_msg . '</span>'; |
|
| 48 | + echo '<span style="color: red; ">'.$bp->err_msg.'</span>'; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | // Handle URL actions |
| 52 | 52 | switch ($mode) { |
| 53 | 53 | case RESTORE_DATA: |
| 54 | 54 | { |
| 55 | - echo '<p><strong>' . _AM_RESTORE_OK . '</strong><br>' . _AM_RESTORE_MESS1 . '</p>'; |
|
| 55 | + echo '<p><strong>'._AM_RESTORE_OK.'</strong><br>'._AM_RESTORE_MESS1.'</p>'; |
|
| 56 | 56 | $fnamedotpos = strrpos($filename, '.'); |
| 57 | 57 | $fext = substr($filename, $fnamedotpos + 1); |
| 58 | 58 | $sql_str = ''; |
| 59 | 59 | switch ($fext) { |
| 60 | 60 | case 'gz': |
| 61 | 61 | $mime_type = 'application/x-gzip'; |
| 62 | - $sql_str = PMA_readFile($bp->backup_dir . $filename, $mime_type); |
|
| 62 | + $sql_str = PMA_readFile($bp->backup_dir.$filename, $mime_type); |
|
| 63 | 63 | break; |
| 64 | 64 | case 'bz': |
| 65 | 65 | $mime_type = 'application/x-bzip'; |
| 66 | - $sql_str = PMA_readFile($bp->backup_dir . $filename, $mime_type); |
|
| 66 | + $sql_str = PMA_readFile($bp->backup_dir.$filename, $mime_type); |
|
| 67 | 67 | break; |
| 68 | 68 | case 'sql': |
| 69 | 69 | $mime_type = 'text/plain'; |
@@ -72,15 +72,15 @@ discard block |
||
| 72 | 72 | $mime_type = ''; |
| 73 | 73 | break; |
| 74 | 74 | } |
| 75 | - if (!file_exists($bp->backup_dir . $filename)) { |
|
| 76 | - echo _AM_NO_FILE . $bp->backup_dir . $filename; |
|
| 75 | + if (!file_exists($bp->backup_dir.$filename)) { |
|
| 76 | + echo _AM_NO_FILE.$bp->backup_dir.$filename; |
|
| 77 | 77 | break; |
| 78 | 78 | } |
| 79 | 79 | if ($sql_str) { |
| 80 | - unlink($bp->backup_dir . $filename); |
|
| 80 | + unlink($bp->backup_dir.$filename); |
|
| 81 | 81 | //$filename = eregi_replace( ".gz|.bz" , "" , $filename); |
| 82 | 82 | $filename = preg_replace('/.gz|.bz/i', '', $filename); |
| 83 | - $fp = fopen($bp->backup_dir . $filename, 'wb'); |
|
| 83 | + $fp = fopen($bp->backup_dir.$filename, 'wb'); |
|
| 84 | 84 | fwrite($fp, $sql_str); |
| 85 | 85 | fclose($fp); |
| 86 | 86 | } |
@@ -88,24 +88,24 @@ discard block |
||
| 88 | 88 | //$result = $GLOBALS['xoopsDB']->queryF( "SET NAMES 'ujis'" ); |
| 89 | 89 | $result = $xoopsDB->queryF('SET NAMES \'ujis\''); |
| 90 | 90 | } |
| 91 | - $bp->restore_data($bp->backup_dir . $filename, $restore_structure, $restore_data, $db_selected, $replace_url); |
|
| 92 | - unlink($bp->backup_dir . $filename); |
|
| 91 | + $bp->restore_data($bp->backup_dir.$filename, $restore_structure, $restore_data, $db_selected, $replace_url); |
|
| 92 | + unlink($bp->backup_dir.$filename); |
|
| 93 | 93 | break; |
| 94 | 94 | } |
| 95 | 95 | case DB_SELECT_FORM: |
| 96 | 96 | { |
| 97 | 97 | echo '<table cellspacing="0" cellpadding="3">'; |
| 98 | 98 | if ('backup' == $action) { |
| 99 | - echo '<tr><td class="title">' . _AM_TITLE_BCK . '</td></tr>'; |
|
| 100 | - echo '<tr><td class="main_left"><p><b>' . _AM_SELECT_DATABASE . '</b>'; |
|
| 99 | + echo '<tr><td class="title">'._AM_TITLE_BCK.'</td></tr>'; |
|
| 100 | + echo '<tr><td class="main_left"><p><b>'._AM_SELECT_DATABASE.'</b>'; |
|
| 101 | 101 | } |
| 102 | 102 | if ('restore' == $action) { |
| 103 | 103 | $upload = $_FILES['filename']; |
| 104 | - $upload_tmp = $_FILES['filename']['tmp_name']; // Temp File name |
|
| 105 | - $upload_name = $_FILES['filename']['name']; // Local File Name |
|
| 106 | - $upload_size = $_FILES['filename']['size']; // Size |
|
| 107 | - $upload_type = $_FILES['filename']['type']; // Type |
|
| 108 | - $upfile_error = $_FILES['filename']['error']; //upload file error no |
|
| 104 | + $upload_tmp = $_FILES['filename']['tmp_name']; // Temp File name |
|
| 105 | + $upload_name = $_FILES['filename']['name']; // Local File Name |
|
| 106 | + $upload_size = $_FILES['filename']['size']; // Size |
|
| 107 | + $upload_type = $_FILES['filename']['type']; // Type |
|
| 108 | + $upfile_error = $_FILES['filename']['error']; //upload file error no |
|
| 109 | 109 | if ($upfile_error > 0) { |
| 110 | 110 | switch ($upfile_error) { |
| 111 | 111 | case UPLOAD_ERR_INI_SIZE: |
@@ -125,27 +125,27 @@ discard block |
||
| 125 | 125 | break; |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | - echo '<tr><td class="title">' . _AM_TITLE_RESTORE . '</td></tr>'; |
|
| 128 | + echo '<tr><td class="title">'._AM_TITLE_RESTORE.'</td></tr>'; |
|
| 129 | 129 | if (!$upload_name && isset($_POST['uploadedfilename'])) { |
| 130 | 130 | $upload_name = filter_input(INPUT_POST, 'uploadedfilename', FILTER_SANITIZE_STRING); //$_POST['uploadedfilename']; |
| 131 | 131 | } else { |
| 132 | 132 | // Upload file |
| 133 | - $ret_val = move_uploaded_file($upload_tmp, $bp->backup_dir . $upload_name); |
|
| 133 | + $ret_val = move_uploaded_file($upload_tmp, $bp->backup_dir.$upload_name); |
|
| 134 | 134 | if (!$ret_val) { |
| 135 | - echo '<br><br>' . _AM_MESS_ERROR_6 . '<br>' . _AM_MESS_ERROR_7 . '</p></td></tr></table>'; |
|
| 135 | + echo '<br><br>'._AM_MESS_ERROR_6.'<br>'._AM_MESS_ERROR_7.'</p></td></tr></table>'; |
|
| 136 | 136 | break; |
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | - echo '<tr><td class="main_left"><p><b>restore from ' . $upload_name . '</b>'; |
|
| 140 | - echo '<tr><td class="main_left"><p><b>replace URL from http://' . $replace_url . '</b>'; |
|
| 139 | + echo '<tr><td class="main_left"><p><b>restore from '.$upload_name.'</b>'; |
|
| 140 | + echo '<tr><td class="main_left"><p><b>replace URL from http://'.$replace_url.'</b>'; |
|
| 141 | 141 | //$restore_structure = ($_POST['structure'] == "on") ? 1 : 0; |
| 142 | 142 | $restore_structure = ('on' == filter_input(INPUT_POST, 'structure', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE)) ? 1 : 0; |
| 143 | 143 | //$restore_data = ($_POST['data'] == "on") ? 1 : 0; |
| 144 | 144 | $restore_data = ('on' == filter_input(INPUT_POST, 'data', FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE)) ? 1 : 0; |
| 145 | - echo '<form method="post" action="restore.php?mode=' . RESTORE_DATA . '&filename=$upload_name&restore_structure=$restore_structure&restore_data=$restore_data\">\n'; |
|
| 145 | + echo '<form method="post" action="restore.php?mode='.RESTORE_DATA.'&filename=$upload_name&restore_structure=$restore_structure&restore_data=$restore_data\">\n'; |
|
| 146 | 146 | sprintf('<form method="post" action="restore.php?mode=%s&filename=%s&restore_structure=%s&restore_data=%s">', RESTORE_DATA, $upload_name, $restore_structure, $restore_data); |
| 147 | 147 | } |
| 148 | - echo '<input type="submit" value="' . _AM_RESTORE . '"></form>'; |
|
| 148 | + echo '<input type="submit" value="'._AM_RESTORE.'"></form>'; |
|
| 149 | 149 | echo '</p></td></tr></table>'; |
| 150 | 150 | break; |
| 151 | 151 | } |
@@ -163,24 +163,24 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | unset($filesize); |
| 165 | 165 | unset($postsize); |
| 166 | - echo '<h2>' . _AM_RESTORETITLE . '</h2>'; |
|
| 166 | + echo '<h2>'._AM_RESTORETITLE.'</h2>'; |
|
| 167 | 167 | /* |
| 168 | 168 | ** for file upload |
| 169 | 169 | */ |
| 170 | 170 | //echo "<form method=\"post\" enctype=\"multipart/form-data\" action=\"" |
| 171 | 171 | // .XOOPS_URL."/modules/backpack/admin/restore.php?mode=".DB_SELECT_FORM."&action=restore\">"; |
| 172 | 172 | sprintf('<form method="post" enctype="multipart/form-data" action="%s/modules/backpack/admin/restore.php?mode=%s&action=restore">', XOOPS_URL, DB_SELECT_FORM); |
| 173 | - echo '<table class="outer" style="width: 100%"><tr><td class=head colspan="2">' . _AM_RESTORETITLE1 . '</td></tr>'; |
|
| 174 | - echo '<tr><td class="odd" style="width: 30%"><b>' . _AM_SELECTAFILE . '</b> (gz, bz, sql)</td>'; |
|
| 175 | - echo '<td><input type="hidden" name="MAX_FILE_SIZE" value="' . $maxbyte . '">'; |
|
| 176 | - echo '<input type="file" name="filename">' . $bp->PMA_displayMaximumUploadSize($max_upload_size) . '</td></tr>'; |
|
| 177 | - echo '<tr><td class="odd"><b>' . _AM_DETAILSTORESTORE . '</b></td>'; |
|
| 178 | - echo '<td><input type="checkbox" name="structure" checked> ' . _AM_TABLESTRUCTURE . ' <input type="checkbox" name="data" checked> ' . _AM_TABLEDATA . '</td></tr>'; |
|
| 173 | + echo '<table class="outer" style="width: 100%"><tr><td class=head colspan="2">'._AM_RESTORETITLE1.'</td></tr>'; |
|
| 174 | + echo '<tr><td class="odd" style="width: 30%"><b>'._AM_SELECTAFILE.'</b> (gz, bz, sql)</td>'; |
|
| 175 | + echo '<td><input type="hidden" name="MAX_FILE_SIZE" value="'.$maxbyte.'">'; |
|
| 176 | + echo '<input type="file" name="filename">'.$bp->PMA_displayMaximumUploadSize($max_upload_size).'</td></tr>'; |
|
| 177 | + echo '<tr><td class="odd"><b>'._AM_DETAILSTORESTORE.'</b></td>'; |
|
| 178 | + echo '<td><input type="checkbox" name="structure" checked> '._AM_TABLESTRUCTURE.' <input type="checkbox" name="data" checked> '._AM_TABLEDATA.'</td></tr>'; |
|
| 179 | 179 | // preg_replace URL |
| 180 | - echo '<tr><td class="odd" style="width: 30%"><b>' . _AM_REPLACEURL . '</b> </td>'; |
|
| 181 | - echo '<td><input type="text" name="replace_url"> ' . _AM_REPLACEURL_DESC . '</td></tr>'; |
|
| 180 | + echo '<tr><td class="odd" style="width: 30%"><b>'._AM_REPLACEURL.'</b> </td>'; |
|
| 181 | + echo '<td><input type="text" name="replace_url"> '._AM_REPLACEURL_DESC.'</td></tr>'; |
|
| 182 | 182 | // submit |
| 183 | - echo '<tr><td colspan="2" style="text-align: center;"><input type="submit" value="' . _AM_RESTORE . '"></td></tr></table></form>'; |
|
| 183 | + echo '<tr><td colspan="2" style="text-align: center;"><input type="submit" value="'._AM_RESTORE.'"></td></tr></table></form>'; |
|
| 184 | 184 | echo '</p>'; |
| 185 | 185 | /* |
| 186 | 186 | ** for import only |
@@ -188,17 +188,17 @@ discard block |
||
| 188 | 188 | //echo "<form method=\"post\" action=\"" |
| 189 | 189 | // .XOOPS_URL."/modules/backpack/admin/restore.php?mode=".DB_SELECT_FORM."&action=restore\">"; |
| 190 | 190 | sprintf('<form method="post" action="%s/modules/backpack/admin/restore.php?mode=%s&action=restore">', XOOPS_URL, DB_SELECT_FORM); |
| 191 | - echo '<table class="outer" style="width: 100%"><tr><td class="head" colspan="2">' . sprintf(_AM_RESTORETITLE2, $bp->backup_dir) . '</td></tr>'; |
|
| 192 | - echo '<tr><td class="odd" style="width: 30%"><b>' . _AM_UPLOADEDFILENAME . '</b> (gz, bz, sql)</td>'; |
|
| 193 | - echo '<td><input type="text" name="uploadedfilename">' . _AM_UPLOADEDFILENAME_DESC . '</td></tr>'; |
|
| 194 | - echo '<tr><td class="odd"><b>' . _AM_DETAILSTORESTORE . '</b></td>'; |
|
| 195 | - echo '<td><input type="checkbox" name="structure" checked> ' . _AM_TABLESTRUCTURE . ' <input type="checkbox" name="data" checked> ' . _AM_TABLEDATA . '</td></tr>'; |
|
| 191 | + echo '<table class="outer" style="width: 100%"><tr><td class="head" colspan="2">'.sprintf(_AM_RESTORETITLE2, $bp->backup_dir).'</td></tr>'; |
|
| 192 | + echo '<tr><td class="odd" style="width: 30%"><b>'._AM_UPLOADEDFILENAME.'</b> (gz, bz, sql)</td>'; |
|
| 193 | + echo '<td><input type="text" name="uploadedfilename">'._AM_UPLOADEDFILENAME_DESC.'</td></tr>'; |
|
| 194 | + echo '<tr><td class="odd"><b>'._AM_DETAILSTORESTORE.'</b></td>'; |
|
| 195 | + echo '<td><input type="checkbox" name="structure" checked> '._AM_TABLESTRUCTURE.' <input type="checkbox" name="data" checked> '._AM_TABLEDATA.'</td></tr>'; |
|
| 196 | 196 | // preg_replace URL |
| 197 | - echo '<tr><td class="odd" style="width: 30%"><b>' . _AM_REPLACEURL . '</b></td>'; |
|
| 198 | - echo '<td><input type="text" name="replace_url"> ' . _AM_REPLACEURL_DESC . '</td></tr>'; |
|
| 197 | + echo '<tr><td class="odd" style="width: 30%"><b>'._AM_REPLACEURL.'</b></td>'; |
|
| 198 | + echo '<td><input type="text" name="replace_url"> '._AM_REPLACEURL_DESC.'</td></tr>'; |
|
| 199 | 199 | // submit |
| 200 | - echo '<tr><td colspan="2" style="text-align: center;"><input type="submit" value="' . _AM_RESTORE . '"></td></tr></table></form>'; |
|
| 200 | + echo '<tr><td colspan="2" style="text-align: center;"><input type="submit" value="'._AM_RESTORE.'"></td></tr></table></form>'; |
|
| 201 | 201 | echo '</p>'; |
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | -require __DIR__ . '/admin_footer.php'; |
|
| 204 | +require __DIR__.'/admin_footer.php'; |
|
@@ -109,9 +109,9 @@ |
||
| 109 | 109 | $ctrldir = implode('', $this->ctrl_dir); |
| 110 | 110 | |
| 111 | 111 | return $data . $ctrldir . $this->eof_ctrl_dir . pack('v', count($this->ctrl_dir)) . // total # of entries "on this disk" |
| 112 | - pack('v', count($this->ctrl_dir)) . // total # of entries overall |
|
| 113 | - pack('V', strlen($ctrldir)) . // size of central dir |
|
| 114 | - pack('V', strlen($data)) . // offset to start of central dir |
|
| 115 | - "\x00\x00"; // .zip file comment length |
|
| 112 | + pack('v', count($this->ctrl_dir)) . // total # of entries overall |
|
| 113 | + pack('V', strlen($ctrldir)) . // size of central dir |
|
| 114 | + pack('V', strlen($data)) . // offset to start of central dir |
|
| 115 | + "\x00\x00"; // .zip file comment length |
|
| 116 | 116 | } // end of the 'file()' method |
| 117 | 117 | } // end of the 'zipfile' class |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | $name = str_replace('\\', '/', $name); |
| 42 | 42 | |
| 43 | 43 | $dtime = dechex($this->unix2DosTime($time)); |
| 44 | - $hexdtime = '\x' . $dtime[6] . $dtime[7] . '\x' . $dtime[4] . $dtime[5] . '\x' . $dtime[2] . $dtime[3] . '\x' . $dtime[0] . $dtime[1]; |
|
| 45 | - eval('$hexdtime = \'' . $hexdtime . '\';'); |
|
| 44 | + $hexdtime = '\x'.$dtime[6].$dtime[7].'\x'.$dtime[4].$dtime[5].'\x'.$dtime[2].$dtime[3].'\x'.$dtime[0].$dtime[1]; |
|
| 45 | + eval('$hexdtime = \''.$hexdtime.'\';'); |
|
| 46 | 46 | |
| 47 | 47 | $fr = "\x50\x4b\x03\x04"; |
| 48 | - $fr .= "\x14\x00"; // ver needed to extract |
|
| 49 | - $fr .= "\x00\x00"; // gen purpose bit flag |
|
| 50 | - $fr .= "\x08\x00"; // compression method |
|
| 51 | - $fr .= $hexdtime; // last mod time and date |
|
| 48 | + $fr .= "\x14\x00"; // ver needed to extract |
|
| 49 | + $fr .= "\x00\x00"; // gen purpose bit flag |
|
| 50 | + $fr .= "\x08\x00"; // compression method |
|
| 51 | + $fr .= $hexdtime; // last mod time and date |
|
| 52 | 52 | |
| 53 | 53 | // "local file header" segment |
| 54 | 54 | $unc_len = strlen($data); |
@@ -56,11 +56,11 @@ discard block |
||
| 56 | 56 | $zdata = gzcompress($data); |
| 57 | 57 | $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug |
| 58 | 58 | $c_len = strlen($zdata); |
| 59 | - $fr .= pack('V', $crc); // crc32 |
|
| 60 | - $fr .= pack('V', $c_len); // compressed filesize |
|
| 61 | - $fr .= pack('V', $unc_len); // uncompressed filesize |
|
| 62 | - $fr .= pack('v', strlen($name)); // length of filename |
|
| 63 | - $fr .= pack('v', 0); // extra field length |
|
| 59 | + $fr .= pack('V', $crc); // crc32 |
|
| 60 | + $fr .= pack('V', $c_len); // compressed filesize |
|
| 61 | + $fr .= pack('V', $unc_len); // uncompressed filesize |
|
| 62 | + $fr .= pack('v', strlen($name)); // length of filename |
|
| 63 | + $fr .= pack('v', 0); // extra field length |
|
| 64 | 64 | $fr .= $name; |
| 65 | 65 | |
| 66 | 66 | // "file data" segment |
@@ -68,9 +68,9 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | // "data descriptor" segment (optional but necessary if archive is not |
| 70 | 70 | // served as file) |
| 71 | - $fr .= pack('V', $crc); // crc32 |
|
| 72 | - $fr .= pack('V', $c_len); // compressed filesize |
|
| 73 | - $fr .= pack('V', $unc_len); // uncompressed filesize |
|
| 71 | + $fr .= pack('V', $crc); // crc32 |
|
| 72 | + $fr .= pack('V', $c_len); // compressed filesize |
|
| 73 | + $fr .= pack('V', $unc_len); // uncompressed filesize |
|
| 74 | 74 | |
| 75 | 75 | // add this entry to array |
| 76 | 76 | $this->datasec[] = $fr; |
@@ -78,22 +78,22 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | // now add to central directory record |
| 80 | 80 | $cdrec = "\x50\x4b\x01\x02"; |
| 81 | - $cdrec .= "\x00\x00"; // version made by |
|
| 82 | - $cdrec .= "\x14\x00"; // version needed to extract |
|
| 83 | - $cdrec .= "\x00\x00"; // gen purpose bit flag |
|
| 84 | - $cdrec .= "\x08\x00"; // compression method |
|
| 85 | - $cdrec .= $hexdtime; // last mod time & date |
|
| 86 | - $cdrec .= pack('V', $crc); // crc32 |
|
| 87 | - $cdrec .= pack('V', $c_len); // compressed filesize |
|
| 88 | - $cdrec .= pack('V', $unc_len); // uncompressed filesize |
|
| 81 | + $cdrec .= "\x00\x00"; // version made by |
|
| 82 | + $cdrec .= "\x14\x00"; // version needed to extract |
|
| 83 | + $cdrec .= "\x00\x00"; // gen purpose bit flag |
|
| 84 | + $cdrec .= "\x08\x00"; // compression method |
|
| 85 | + $cdrec .= $hexdtime; // last mod time & date |
|
| 86 | + $cdrec .= pack('V', $crc); // crc32 |
|
| 87 | + $cdrec .= pack('V', $c_len); // compressed filesize |
|
| 88 | + $cdrec .= pack('V', $unc_len); // uncompressed filesize |
|
| 89 | 89 | $cdrec .= pack('v', strlen($name)); // length of filename |
| 90 | - $cdrec .= pack('v', 0); // extra field length |
|
| 91 | - $cdrec .= pack('v', 0); // file comment length |
|
| 92 | - $cdrec .= pack('v', 0); // disk number start |
|
| 93 | - $cdrec .= pack('v', 0); // internal file attributes |
|
| 94 | - $cdrec .= pack('V', 32); // external file attributes - 'archive' bit set |
|
| 90 | + $cdrec .= pack('v', 0); // extra field length |
|
| 91 | + $cdrec .= pack('v', 0); // file comment length |
|
| 92 | + $cdrec .= pack('v', 0); // disk number start |
|
| 93 | + $cdrec .= pack('v', 0); // internal file attributes |
|
| 94 | + $cdrec .= pack('V', 32); // external file attributes - 'archive' bit set |
|
| 95 | 95 | |
| 96 | - $cdrec .= pack('V', $this->old_offset); // relative offset of local header |
|
| 96 | + $cdrec .= pack('V', $this->old_offset); // relative offset of local header |
|
| 97 | 97 | $this->old_offset = $new_offset; |
| 98 | 98 | |
| 99 | 99 | $cdrec .= $name; |
@@ -108,10 +108,10 @@ discard block |
||
| 108 | 108 | $data = implode('', $this->datasec); |
| 109 | 109 | $ctrldir = implode('', $this->ctrl_dir); |
| 110 | 110 | |
| 111 | - return $data . $ctrldir . $this->eof_ctrl_dir . pack('v', count($this->ctrl_dir)) . // total # of entries "on this disk" |
|
| 112 | - pack('v', count($this->ctrl_dir)) . // total # of entries overall |
|
| 113 | - pack('V', strlen($ctrldir)) . // size of central dir |
|
| 114 | - pack('V', strlen($data)) . // offset to start of central dir |
|
| 115 | - "\x00\x00"; // .zip file comment length |
|
| 111 | + return $data.$ctrldir.$this->eof_ctrl_dir.pack('v', count($this->ctrl_dir)).// total # of entries "on this disk" |
|
| 112 | + pack('v', count($this->ctrl_dir)).// total # of entries overall |
|
| 113 | + pack('V', strlen($ctrldir)).// size of central dir |
|
| 114 | + pack('V', strlen($data)).// offset to start of central dir |
|
| 115 | + "\x00\x00"; // .zip file comment length |
|
| 116 | 116 | } // end of the 'file()' method |
| 117 | 117 | } // end of the 'zipfile' class |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | // We are in a string, check for not escaped end of strings except for |
| 26 | 26 | // backquotes that can't be escaped |
| 27 | 27 | if ($in_string) { |
| 28 | - for (; ;) { |
|
| 28 | + for (;;) { |
|
| 29 | 29 | $i = strpos($sql, $string_start, $i); |
| 30 | 30 | // No end of string found -> add the current substring to the |
| 31 | 31 | // returned array |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | class backpack |
| 13 | 13 | { |
| 14 | - private $debug = 0; // Define this to enable debugging |
|
| 14 | + private $debug = 0; // Define this to enable debugging |
|
| 15 | 15 | public $backup_dir; |
| 16 | 16 | public $dump_size = 0; |
| 17 | 17 | public $dump_line = 0; |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | global $xoopsModuleConfig, $xoopsModule; |
| 30 | 30 | if (defined('XOOPS_VAR_PATH')) { |
| 31 | - $backup_dir = XOOPS_VAR_PATH . '/caches/'; |
|
| 31 | + $backup_dir = XOOPS_VAR_PATH.'/caches/'; |
|
| 32 | 32 | } else { |
| 33 | - $backup_dir = XOOPS_ROOT_PATH . '/cache/'; |
|
| 33 | + $backup_dir = XOOPS_ROOT_PATH.'/cache/'; |
|
| 34 | 34 | } |
| 35 | 35 | $this->xoopsModuleConfig = $xoopsModuleConfig; |
| 36 | 36 | $this->backup_dir = $backup_dir; |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | public function set_backup_dir($dirname) |
| 57 | 57 | { |
| 58 | 58 | if (defined('XOOPS_VAR_PATH')) { |
| 59 | - $backup_dir = XOOPS_VAR_PATH . '/caches/'; |
|
| 59 | + $backup_dir = XOOPS_VAR_PATH.'/caches/'; |
|
| 60 | 60 | } else { |
| 61 | - $backup_dir = XOOPS_ROOT_PATH . '/cache/'; |
|
| 61 | + $backup_dir = XOOPS_ROOT_PATH.'/cache/'; |
|
| 62 | 62 | } |
| 63 | 63 | $this->backup_dir = $backup_dir; |
| 64 | 64 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | && PMA_MYSQL_INT_VERSION >= 32306 |
| 79 | 79 | && !empty($a_name) |
| 80 | 80 | && '*' != $a_name) { |
| 81 | - return '`' . $a_name . '`'; |
|
| 81 | + return '`'.$a_name.'`'; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | return $a_name; |
@@ -90,31 +90,31 @@ discard block |
||
| 90 | 90 | $crlf = "\r\n"; |
| 91 | 91 | |
| 92 | 92 | // Start the SQL string for this table |
| 93 | - $field_header = 'CREATE TABLE `' . $tablename . '` ('; |
|
| 93 | + $field_header = 'CREATE TABLE `'.$tablename.'` ('; |
|
| 94 | 94 | $field_string = ''; |
| 95 | 95 | |
| 96 | 96 | // Get the field info and output to a string in the correct MySQL syntax |
| 97 | - $result = $xoopsDB->queryF('DESCRIBE ' . $tablename); |
|
| 97 | + $result = $xoopsDB->queryF('DESCRIBE '.$tablename); |
|
| 98 | 98 | if ($this->debug) { |
| 99 | - echo $tablename . " .field_info\n\n"; |
|
| 99 | + echo $tablename." .field_info\n\n"; |
|
| 100 | 100 | } |
| 101 | 101 | while (false !== ($field_info = $xoopsDB->fetchBoth($result))) { |
| 102 | 102 | if ($this->debug) { |
| 103 | 103 | $iMax = count($field_info); |
| 104 | - for ($i = 0; $i < $iMax; ++$i) { |
|
| 105 | - echo $i . ': ' . $field_info[$i] . "\n"; |
|
| 104 | + for ($i = 0; $i < $iMax; ++$i) { |
|
| 105 | + echo $i.': '.$field_info[$i]."\n"; |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | $field_name = $field_info[0]; |
| 109 | 109 | $field_type = $field_info[1]; |
| 110 | 110 | $field_not_null = ('YES' == $field_info[2]) ? '' : ' NOT NULL'; |
| 111 | - $field_default = (null === $field_info[4]) ? '' : sprintf(' default \'%s\'', $field_info[4]);; |
|
| 111 | + $field_default = (null === $field_info[4]) ? '' : sprintf(' default \'%s\'', $field_info[4]); ; |
|
| 112 | 112 | $field_auto_increment = (null === $field_info[5]) ? '' : sprintf(' %s', $field_info[5]); |
| 113 | 113 | $field_string .= $field_string ? ',' : $field_header; |
| 114 | - $field_string .= $crlf . sprintf(' `%s` %s%s%s%s', $field_name, $field_type, $field_not_null, $field_auto_increment, $field_default); |
|
| 114 | + $field_string .= $crlf.sprintf(' `%s` %s%s%s%s', $field_name, $field_type, $field_not_null, $field_auto_increment, $field_default); |
|
| 115 | 115 | } |
| 116 | 116 | // Get the index info and output to a string in the correct MySQL syntax |
| 117 | - $result = $xoopsDB->queryF('SHOW KEYS FROM ' . $tablename); |
|
| 117 | + $result = $xoopsDB->queryF('SHOW KEYS FROM '.$tablename); |
|
| 118 | 118 | if ($this->debug) { |
| 119 | 119 | echo "\nindex_info\n\n"; |
| 120 | 120 | } |
@@ -126,16 +126,16 @@ discard block |
||
| 126 | 126 | } // For Under MySQL v4.0.2 |
| 127 | 127 | $sub_part = $row['Sub_part'] ?? ''; |
| 128 | 128 | if ('PRIMARY' != $kname && 0 == $row['Non_unique']) { |
| 129 | - $kname = 'UNIQUE KEY `' . $kname . '`'; |
|
| 129 | + $kname = 'UNIQUE KEY `'.$kname.'`'; |
|
| 130 | 130 | } |
| 131 | 131 | if ('FULLTEXT' == $ktype) { |
| 132 | - $kname = 'FULLTEXT KEY `' . $kname . '`'; |
|
| 132 | + $kname = 'FULLTEXT KEY `'.$kname.'`'; |
|
| 133 | 133 | } |
| 134 | 134 | if (!isset($index[$kname])) { |
| 135 | 135 | $index[$kname] = []; |
| 136 | 136 | } |
| 137 | 137 | if ($sub_part > 1) { |
| 138 | - $index[$kname][] = $this->PMA_backquote($row['Column_name'], 0) . '(' . $sub_part . ')'; |
|
| 138 | + $index[$kname][] = $this->PMA_backquote($row['Column_name'], 0).'('.$sub_part.')'; |
|
| 139 | 139 | } else { |
| 140 | 140 | $index[$kname][] = $this->PMA_backquote($row['Column_name'], 0); |
| 141 | 141 | } |
@@ -143,17 +143,17 @@ discard block |
||
| 143 | 143 | $xoopsDB->freeRecordSet($result); |
| 144 | 144 | $index_string = ''; |
| 145 | 145 | foreach ($index as $x => $columns) { |
| 146 | - $index_string .= ',' . $crlf; |
|
| 146 | + $index_string .= ','.$crlf; |
|
| 147 | 147 | if ('PRIMARY' == $x) { |
| 148 | 148 | $index_string .= ' PRIMARY KEY ('; |
| 149 | 149 | } elseif (0 === strpos($x, 'UNIQUE')) { |
| 150 | - $index_string .= ' UNIQUE ' . substr($x, 7) . ' ('; |
|
| 150 | + $index_string .= ' UNIQUE '.substr($x, 7).' ('; |
|
| 151 | 151 | } elseif (0 === strpos($x, 'FULLTEXT')) { |
| 152 | - $index_string .= ' FULLTEXT ' . substr($x, 9) . ' ('; |
|
| 152 | + $index_string .= ' FULLTEXT '.substr($x, 9).' ('; |
|
| 153 | 153 | } else { |
| 154 | - $index_string .= ' KEY `' . $x . '` ('; |
|
| 154 | + $index_string .= ' KEY `'.$x.'` ('; |
|
| 155 | 155 | } |
| 156 | - $index_string .= implode(', ', $columns) . ')'; |
|
| 156 | + $index_string .= implode(', ', $columns).')'; |
|
| 157 | 157 | } // foreach |
| 158 | 158 | $index_string .= $crlf; |
| 159 | 159 | |
@@ -182,8 +182,8 @@ discard block |
||
| 182 | 182 | $field_string = sprintf('%s)', $field_string); |
| 183 | 183 | |
| 184 | 184 | // Finalise the MySQL create table string |
| 185 | - $field_string .= $table_type . ';'; |
|
| 186 | - $field_string = "-- \r\n-- " . $tablename . " structure.\r\n-- " . $crlf . $field_string . $crlf; |
|
| 185 | + $field_string .= $table_type.';'; |
|
| 186 | + $field_string = "-- \r\n-- ".$tablename." structure.\r\n-- ".$crlf.$field_string.$crlf; |
|
| 187 | 187 | $this->dump_buffer .= $field_string; |
| 188 | 188 | preg_match_all("/\r\n/", $field_string, $c); |
| 189 | 189 | $this->dump_line += count($c[0]); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | $this->query_res = $xoopsDB->query("SELECT * FROM $tablename"); |
| 198 | 198 | |
| 199 | 199 | // Get table data from MySQL and output to a string in the correct MySQL syntax |
| 200 | - $this->dump_buffer .= "-- \r\n-- " . $tablename . " dump.\r\n-- \r\n"; |
|
| 200 | + $this->dump_buffer .= "-- \r\n-- ".$tablename." dump.\r\n-- \r\n"; |
|
| 201 | 201 | $this->dump_line += 3; |
| 202 | 202 | while (false !== ($row = $xoopsDB->fetchRow($this->query_res))) { |
| 203 | 203 | // Initialise the data string |
@@ -211,14 +211,14 @@ discard block |
||
| 211 | 211 | $data_string .= 'NULL'; |
| 212 | 212 | } else { |
| 213 | 213 | //$data_string .= '"'.$GLOBALS['xoopsDB']->escape($row[$i]).'"'; |
| 214 | - $data_string .= '"' . $xoopsDB->escape($row[$i]) . '"'; |
|
| 214 | + $data_string .= '"'.$xoopsDB->escape($row[$i]).'"'; |
|
| 215 | 215 | } |
| 216 | 216 | //$data_string = str_replace("`","\'",$data_string); |
| 217 | 217 | } |
| 218 | 218 | //die($data_string); |
| 219 | 219 | // URL change |
| 220 | 220 | if (0 <> strcmp($xoopsModuleConfig['xoopsurlto'], XOOPS_URL)) { |
| 221 | - $data_string = preg_replace('/' . preg_quote(XOOPS_URL, '/') . '/', $xoopsModuleConfig['xoopsurlto'], $data_string); |
|
| 221 | + $data_string = preg_replace('/'.preg_quote(XOOPS_URL, '/').'/', $xoopsModuleConfig['xoopsurlto'], $data_string); |
|
| 222 | 222 | } |
| 223 | 223 | // Encoding change |
| 224 | 224 | /* |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | // Put the data string in parantheses and prepend "VALUES " |
| 230 | 230 | $data_string = sprintf('VALUES (%s)', $data_string); |
| 231 | 231 | // Finalise the MySQL insert into string for this record |
| 232 | - $field_string = sprintf("INSERT INTO `%s` %s;\r\n", $tablename, $data_string); |
|
| 232 | + $field_string = sprintf("INSERT INTO `%s` %s;\r\n", $tablename, $data_string); |
|
| 233 | 233 | $this->dump_buffer .= $field_string; |
| 234 | 234 | $this->dump_size += strlen(bin2hex($field_string)) / 2; |
| 235 | 235 | $this->dump_line++; |
@@ -240,35 +240,35 @@ discard block |
||
| 240 | 240 | public function make_download($filename, $cfgZipType) |
| 241 | 241 | { |
| 242 | 242 | if (('bzip' == $cfgZipType) && function_exists('bzcompress')) { // (PMA_PHP_INT_VERSION >= 40004 && |
| 243 | - $filename .= $this->download_count > 0 ? '-' . $this->download_count . '.sql' : '.sql'; |
|
| 243 | + $filename .= $this->download_count > 0 ? '-'.$this->download_count.'.sql' : '.sql'; |
|
| 244 | 244 | $ext = 'bz2'; |
| 245 | 245 | $this->mime_type = 'application/x-bzip'; |
| 246 | 246 | $op_buffer = bzcompress($this->dump_buffer); |
| 247 | 247 | } elseif (('gzip' == $cfgZipType) && function_exists('gzencode')) { // (PMA_PHP_INT_VERSION >= 40004 && |
| 248 | - $filename .= $this->download_count > 0 ? '-' . $this->download_count . '.sql' : '.sql'; |
|
| 248 | + $filename .= $this->download_count > 0 ? '-'.$this->download_count.'.sql' : '.sql'; |
|
| 249 | 249 | $ext = 'gz'; |
| 250 | 250 | $content_encoding = 'x-gzip'; |
| 251 | 251 | $this->mime_type = 'application/x-gzip'; |
| 252 | 252 | // without the optional parameter level because it bug |
| 253 | 253 | $op_buffer = gzencode($this->dump_buffer, 9); |
| 254 | 254 | } elseif (('zip' == $cfgZipType) && function_exists('gzcompress')) { // (PMA_PHP_INT_VERSION >= 40000 && |
| 255 | - $filename .= $this->download_count > 0 ? '-' . $this->download_count : ''; |
|
| 255 | + $filename .= $this->download_count > 0 ? '-'.$this->download_count : ''; |
|
| 256 | 256 | $ext = 'zip'; |
| 257 | 257 | $this->mime_type = 'application/x-zip'; |
| 258 | 258 | $extbis = '.sql'; |
| 259 | 259 | $zipfile = new zipfile(); |
| 260 | - $zipfile->addFile($this->dump_buffer, $filename . $extbis); |
|
| 260 | + $zipfile->addFile($this->dump_buffer, $filename.$extbis); |
|
| 261 | 261 | $op_buffer = $zipfile->file(); |
| 262 | 262 | } else { |
| 263 | - $filename .= $this->download_count > 0 ? '-' . $this->download_count : ''; |
|
| 263 | + $filename .= $this->download_count > 0 ? '-'.$this->download_count : ''; |
|
| 264 | 264 | $ext = 'sql'; |
| 265 | 265 | $cfgZipType = 'none'; |
| 266 | 266 | $this->mime_type = 'text/plain'; |
| 267 | 267 | $op_buffer = $this->dump_buffer; |
| 268 | 268 | } |
| 269 | - $fpathname = $this->backup_dir . $filename . '.' . $ext; |
|
| 269 | + $fpathname = $this->backup_dir.$filename.'.'.$ext; |
|
| 270 | 270 | if ($this->debug) { |
| 271 | - echo $fpathname . '<br>'; |
|
| 271 | + echo $fpathname.'<br>'; |
|
| 272 | 272 | } |
| 273 | 273 | $fp = fopen($fpathname, 'w'); |
| 274 | 274 | fwrite($fp, $op_buffer); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | print("Error - $filename does not exist."); |
| 279 | 279 | return false; |
| 280 | 280 | } |
| 281 | - $this->download_fname[$this->download_count]['filename'] = $filename . '.' . $ext; |
|
| 281 | + $this->download_fname[$this->download_count]['filename'] = $filename.'.'.$ext; |
|
| 282 | 282 | $this->download_fname[$this->download_count]['line'] = $this->dump_line; |
| 283 | 283 | $this->download_fname[$this->download_count]['size'] = filesize($fpathname); |
| 284 | 284 | $this->download_count++; |
@@ -292,20 +292,20 @@ discard block |
||
| 292 | 292 | if ($handle = opendir($this->backup_dir)) { |
| 293 | 293 | while (false !== ($file = readdir($handle))) { |
| 294 | 294 | if (preg_match('/sql/', $file)) { |
| 295 | - $fileDate = filemtime($this->backup_dir . $file); |
|
| 295 | + $fileDate = filemtime($this->backup_dir.$file); |
|
| 296 | 296 | if ($beforeDays) { |
| 297 | 297 | $beforeDate = time() - 86400 * (int)$beforeDays; |
| 298 | 298 | if ($fileDate < $beforeDate) { |
| 299 | 299 | if ($this->debug) { |
| 300 | 300 | echo "DELETE - $file $fileDate\n<BR>"; |
| 301 | 301 | } |
| 302 | - unlink($this->backup_dir . $file); |
|
| 302 | + unlink($this->backup_dir.$file); |
|
| 303 | 303 | } |
| 304 | 304 | } else { |
| 305 | 305 | if ($this->debug) { |
| 306 | 306 | echo "DELETE - $file $fileDate\n<BR>"; |
| 307 | 307 | } |
| 308 | - unlink($this->backup_dir . $file); |
|
| 308 | + unlink($this->backup_dir.$file); |
|
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | } |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | public function check_dump_buffer($filename, $cfgZipType) |
| 317 | 317 | { |
| 318 | 318 | //var_dump($this->xoopsModuleConfig); |
| 319 | - $max_dumpsize = $this->xoopsModuleConfig['max_dumpsize'];//max_dumpsize |
|
| 319 | + $max_dumpsize = $this->xoopsModuleConfig['max_dumpsize']; //max_dumpsize |
|
| 320 | 320 | if (!$max_dumpsize) { |
| 321 | 321 | $max_dumpsize = MAX_DUMPSIZE; |
| 322 | 322 | } |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | } |
| 340 | 340 | $q = 'LOCK TABLES'; |
| 341 | 341 | foreach ($tablename_array as $iValue) { |
| 342 | - $q .= ' ' . $iValue . ' read,'; |
|
| 342 | + $q .= ' '.$iValue.' read,'; |
|
| 343 | 343 | } |
| 344 | 344 | $q = substr($q, 0, strlen($q) - 1); |
| 345 | 345 | $xoopsDB->queryF($q); |
@@ -348,9 +348,9 @@ discard block |
||
| 348 | 348 | public function backup_data($tablename_array, $backup_structure, $backup_data, $filename, $cfgZipType) |
| 349 | 349 | { |
| 350 | 350 | global $xoopsDB; |
| 351 | - $field_string = "-- CHG-WEB.Xoops Backup/Restore Module\r\n-- BackPack\r\n-- https://store.chg-web.com/\r\n" . "-- --------------------------------------------\r\n"; |
|
| 351 | + $field_string = "-- CHG-WEB.Xoops Backup/Restore Module\r\n-- BackPack\r\n-- https://store.chg-web.com/\r\n"."-- --------------------------------------------\r\n"; |
|
| 352 | 352 | $this->dump_buffer = $field_string; |
| 353 | - $this->dump_size += strlen(bin2hex($field_string)) / 2; |
|
| 353 | + $this->dump_size += strlen(bin2hex($field_string)) / 2; |
|
| 354 | 354 | preg_match_all("/\r\n/", $this->dump_buffer, $c); |
| 355 | 355 | $this->dump_line += count($c[0]); |
| 356 | 356 | //mysqli_query($xoopsDB->conn,'FLUSH TABLES'); |
@@ -406,10 +406,10 @@ discard block |
||
| 406 | 406 | $prefix = explode('_', $match[2]); |
| 407 | 407 | $prefix = preg_replace('/^`/', '', $prefix[0]); |
| 408 | 408 | } |
| 409 | - $buffer = preg_replace('/' . $prefix . '_/', XOOPS_DB_PREFIX . '_', $buffer); |
|
| 409 | + $buffer = preg_replace('/'.$prefix.'_/', XOOPS_DB_PREFIX.'_', $buffer); |
|
| 410 | 410 | if ($replace_url) { |
| 411 | - $pattern = 'http://' . $replace_url; |
|
| 412 | - $buffer = preg_replace('/' . preg_quote($pattern, '/') . '/', XOOPS_URL, $buffer); |
|
| 411 | + $pattern = 'http://'.$replace_url; |
|
| 412 | + $buffer = preg_replace('/'.preg_quote($pattern, '/').'/', XOOPS_URL, $buffer); |
|
| 413 | 413 | } |
| 414 | 414 | } |
| 415 | 415 | // 20100218 |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | //$rand = substr(md5(time()), 0, 8); |
| 431 | 431 | //$random_tablename = sprintf("%s_bak_%s", $tablename, $rand); |
| 432 | 432 | //mysqli_query("DROP TABLE IF EXISTS $tablename"); |
| 433 | - $xoopsDB->queryF('DROP TABLE IF EXISTS ' . $tablename); |
|
| 433 | + $xoopsDB->queryF('DROP TABLE IF EXISTS '.$tablename); |
|
| 434 | 434 | //mysqli_query("RENAME TABLE $tablename TO $random_tablename"); |
| 435 | 435 | //echo "Backed up $tablename to $random_tablename.<br>\n"; |
| 436 | 436 | } |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | //$result = mysqli_query($buffer); |
| 439 | 439 | $xoopsDB->queryF($buffer); |
| 440 | 440 | if (!$result) { |
| 441 | - echo $GLOBALS['xoopsDB']->error() . "<br>\n"; |
|
| 441 | + echo $GLOBALS['xoopsDB']->error()."<br>\n"; |
|
| 442 | 442 | } else { |
| 443 | 443 | echo "Table '$tablename' successfully recreated.<br>\n"; |
| 444 | 444 | } |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | //$result = mysqli_query($buffer); |
| 449 | 449 | $xoopsDB->queryF($buffer); |
| 450 | 450 | if (!$result) { |
| 451 | - echo $GLOBALS['xoopsDB']->error() . "<br>\n"; |
|
| 451 | + echo $GLOBALS['xoopsDB']->error()."<br>\n"; |
|
| 452 | 452 | } |
| 453 | 453 | } |
| 454 | 454 | } |
@@ -471,13 +471,13 @@ discard block |
||
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | // TABLES (loading mysql.sql) |
| 474 | - $sql_file_path = XOOPS_TRUST_PATH . '/modules/' . $dirname . '/sql/mysql.sql'; |
|
| 474 | + $sql_file_path = XOOPS_TRUST_PATH.'/modules/'.$dirname.'/sql/mysql.sql'; |
|
| 475 | 475 | $prefix_mod = $dirname; |
| 476 | 476 | if (is_file($sql_file_path)) { |
| 477 | 477 | $sql_lines = file($sql_file_path); |
| 478 | 478 | foreach ($sql_lines as $sql_line) { |
| 479 | 479 | if (preg_match('/^CREATE TABLE \`?([a-zA-Z0-9_-]+)\`? /i', $sql_line, $regs)) { |
| 480 | - $modtables[] = $prefix_mod . '_' . $regs[1]; |
|
| 480 | + $modtables[] = $prefix_mod.'_'.$regs[1]; |
|
| 481 | 481 | } |
| 482 | 482 | } |
| 483 | 483 | return $modtables; |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | public function make_module_selection($select_dirname = '', $addblank = 0) |
| 491 | 491 | { |
| 492 | 492 | global $xoopsDB; |
| 493 | - $sql = 'SELECT name,dirname FROM ' . $xoopsDB->prefix('modules'); |
|
| 493 | + $sql = 'SELECT name,dirname FROM '.$xoopsDB->prefix('modules'); |
|
| 494 | 494 | if (!$result = $xoopsDB->queryF($sql)) { |
| 495 | 495 | return false; |
| 496 | 496 | } |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | } else { |
| 503 | 503 | $opt = ''; |
| 504 | 504 | } |
| 505 | - $mod_selections .= '<option value="' . $dirname . '" ' . $opt . '>' . $name . '</option>'; |
|
| 505 | + $mod_selections .= '<option value="'.$dirname.'" '.$opt.'>'.$name.'</option>'; |
|
| 506 | 506 | } |
| 507 | 507 | $mod_selections .= '</select>'; |
| 508 | 508 | return $mod_selections; |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | public function PMA_displayMaximumUploadSize($max_upload_size) |
| 561 | 561 | { |
| 562 | 562 | [$max_size, $max_unit] = $this->PMA_formatByteDown($max_upload_size); |
| 563 | - return '(' . sprintf(_AM_SELECTAFILE_DESC, $max_size, $max_unit) . ')'; |
|
| 563 | + return '('.sprintf(_AM_SELECTAFILE_DESC, $max_size, $max_unit).')'; |
|
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | /** |