@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | public $u_action; |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | - * Constructor |
|
| 47 | - */ |
|
| 46 | + * Constructor |
|
| 47 | + */ |
|
| 48 | 48 | public function __construct() |
| 49 | 49 | { |
| 50 | 50 | global $cache, $config, $db, $phpbb_log, $request, $template, $user; |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | - * Main ACP module |
|
| 66 | - * |
|
| 67 | - * @param int $id |
|
| 68 | - * @param string $mode |
|
| 69 | - * @access public |
|
| 70 | - */ |
|
| 65 | + * Main ACP module |
|
| 66 | + * |
|
| 67 | + * @param int $id |
|
| 68 | + * @param string $mode |
|
| 69 | + * @access public |
|
| 70 | + */ |
|
| 71 | 71 | public function main($id, $mode) |
| 72 | 72 | { |
| 73 | 73 | $this->tpl_name = 'acp_dbtool'; |
@@ -87,11 +87,11 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | - * Run database tool |
|
| 91 | - * |
|
| 92 | - * @return null |
|
| 93 | - * @access protected |
|
| 94 | - */ |
|
| 90 | + * Run database tool |
|
| 91 | + * |
|
| 92 | + * @return null |
|
| 93 | + * @access protected |
|
| 94 | + */ |
|
| 95 | 95 | protected function run_tool() |
| 96 | 96 | { |
| 97 | 97 | $operation = $this->request->variable('operation', ''); |
@@ -126,14 +126,14 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
| 129 | - * Perform table SQL query and return any messages |
|
| 130 | - * |
|
| 131 | - * @param string $operation OPTIMIZE, REPAIR, or CHECK |
|
| 132 | - * @param string $tables Comma delineated string of all tables to be processed |
|
| 133 | - * @param int $disable_board The user's option to disable the board during run time |
|
| 134 | - * @return string Any errors or status information |
|
| 135 | - * @access protected |
|
| 136 | - */ |
|
| 129 | + * Perform table SQL query and return any messages |
|
| 130 | + * |
|
| 131 | + * @param string $operation OPTIMIZE, REPAIR, or CHECK |
|
| 132 | + * @param string $tables Comma delineated string of all tables to be processed |
|
| 133 | + * @param int $disable_board The user's option to disable the board during run time |
|
| 134 | + * @return string Any errors or status information |
|
| 135 | + * @access protected |
|
| 136 | + */ |
|
| 137 | 137 | protected function process($operation, $tables, $disable_board = 0) |
| 138 | 138 | { |
| 139 | 139 | $this->extend_execution_limits(); |
@@ -163,11 +163,11 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
| 166 | - * Generate Show Table Data |
|
| 167 | - * |
|
| 168 | - * @return null |
|
| 169 | - * @access protected |
|
| 170 | - */ |
|
| 166 | + * Generate Show Table Data |
|
| 167 | + * |
|
| 168 | + * @return null |
|
| 169 | + * @access protected |
|
| 170 | + */ |
|
| 171 | 171 | protected function display_tables() |
| 172 | 172 | { |
| 173 | 173 | $table_data = array(); |
@@ -210,47 +210,47 @@ discard block |
||
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | /** |
| 213 | - * Is the database using MySQL |
|
| 214 | - * |
|
| 215 | - * @return bool True if MySQL, false otherwise |
|
| 216 | - * @access protected |
|
| 217 | - */ |
|
| 213 | + * Is the database using MySQL |
|
| 214 | + * |
|
| 215 | + * @return bool True if MySQL, false otherwise |
|
| 216 | + * @access protected |
|
| 217 | + */ |
|
| 218 | 218 | protected function is_mysql() |
| 219 | 219 | { |
| 220 | 220 | return $this->db->get_sql_layer() == 'mysql4' || $this->db->get_sql_layer() == 'mysqli'; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | /** |
| 224 | - * Is requested operation to optimize, repair or check tables |
|
| 225 | - * |
|
| 226 | - * @param string $operation The name of the operation |
|
| 227 | - * @return bool True if valid operation, false otherwise |
|
| 228 | - * @access public |
|
| 229 | - */ |
|
| 224 | + * Is requested operation to optimize, repair or check tables |
|
| 225 | + * |
|
| 226 | + * @param string $operation The name of the operation |
|
| 227 | + * @return bool True if valid operation, false otherwise |
|
| 228 | + * @access public |
|
| 229 | + */ |
|
| 230 | 230 | public function is_valid_operation($operation) |
| 231 | 231 | { |
| 232 | 232 | return in_array($operation, array('OPTIMIZE', 'REPAIR', 'CHECK')); |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | /** |
| 236 | - * Only allow tables using MyISAM, InnoDB or Archive storage engines |
|
| 237 | - * |
|
| 238 | - * @param string $engine The name of the engine |
|
| 239 | - * @return bool True if valid engine, false otherwise |
|
| 240 | - * @access public |
|
| 241 | - */ |
|
| 236 | + * Only allow tables using MyISAM, InnoDB or Archive storage engines |
|
| 237 | + * |
|
| 238 | + * @param string $engine The name of the engine |
|
| 239 | + * @return bool True if valid engine, false otherwise |
|
| 240 | + * @access public |
|
| 241 | + */ |
|
| 242 | 242 | public function is_valid_engine($engine) |
| 243 | 243 | { |
| 244 | 244 | return in_array(strtolower($engine), array('myisam', 'innodb', 'archive')); |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
| 248 | - * Is the storage engine InnoDB |
|
| 249 | - * |
|
| 250 | - * @param string $engine The name of the engine |
|
| 251 | - * @return bool True if InnoDB engine, false otherwise |
|
| 252 | - * @access public |
|
| 253 | - */ |
|
| 248 | + * Is the storage engine InnoDB |
|
| 249 | + * |
|
| 250 | + * @param string $engine The name of the engine |
|
| 251 | + * @return bool True if InnoDB engine, false otherwise |
|
| 252 | + * @access public |
|
| 253 | + */ |
|
| 254 | 254 | public function is_innodb($engine) |
| 255 | 255 | { |
| 256 | 256 | return strtolower($engine) == 'innodb'; |
@@ -275,12 +275,12 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
| 278 | - * Display file size in the proper units |
|
| 279 | - * |
|
| 280 | - * @param int $size Number representing bytes |
|
| 281 | - * @return string $size with the correct units symbol appended |
|
| 282 | - * @access public |
|
| 283 | - */ |
|
| 278 | + * Display file size in the proper units |
|
| 279 | + * |
|
| 280 | + * @param int $size Number representing bytes |
|
| 281 | + * @return string $size with the correct units symbol appended |
|
| 282 | + * @access public |
|
| 283 | + */ |
|
| 284 | 284 | public function file_size($size) |
| 285 | 285 | { |
| 286 | 286 | $file_size_units = array(' B', ' KB', ' MB', ' GB', ' TB', ' PB', ' EB', ' ZB', ' YB'); |
@@ -288,11 +288,11 @@ discard block |
||
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | /** |
| 291 | - * Extend execution limits to mitigate timeouts |
|
| 292 | - * |
|
| 293 | - * @return null |
|
| 294 | - * @access protected |
|
| 295 | - */ |
|
| 291 | + * Extend execution limits to mitigate timeouts |
|
| 292 | + * |
|
| 293 | + * @return null |
|
| 294 | + * @access protected |
|
| 295 | + */ |
|
| 296 | 296 | protected function extend_execution_limits() |
| 297 | 297 | { |
| 298 | 298 | // Disable safe mode to allow set_time_limit to work |