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