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