@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | public $u_action; |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * Constructor |
|
| 44 | - */ |
|
| 43 | + * Constructor |
|
| 44 | + */ |
|
| 45 | 45 | public function __construct() |
| 46 | 46 | { |
| 47 | 47 | global $cache, $config, $db, $phpbb_log, $request, $template, $user; |
@@ -59,12 +59,12 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * Main ACP module |
|
| 63 | - * |
|
| 64 | - * @param int $id |
|
| 65 | - * @param string $mode |
|
| 66 | - * @access public |
|
| 67 | - */ |
|
| 62 | + * Main ACP module |
|
| 63 | + * |
|
| 64 | + * @param int $id |
|
| 65 | + * @param string $mode |
|
| 66 | + * @access public |
|
| 67 | + */ |
|
| 68 | 68 | public function main($id, $mode) |
| 69 | 69 | { |
| 70 | 70 | $this->tpl_name = 'acp_dbtool'; |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | - * Run database tool |
|
| 88 | - * |
|
| 89 | - * @return null |
|
| 90 | - * @access protected |
|
| 91 | - */ |
|
| 87 | + * Run database tool |
|
| 88 | + * |
|
| 89 | + * @return null |
|
| 90 | + * @access protected |
|
| 91 | + */ |
|
| 92 | 92 | protected function run_tool() |
| 93 | 93 | { |
| 94 | 94 | $operation = $this->request->variable('operation', ''); |
@@ -123,14 +123,14 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | - * Perform table SQL query and return any messages |
|
| 127 | - * |
|
| 128 | - * @param string $operation OPTIMIZE, REPAIR, or CHECK |
|
| 129 | - * @param string $tables Comma delineated string of all tables to be processed |
|
| 130 | - * @param int $disable_board The user's option to disable the board during run time |
|
| 131 | - * @return string Any errors or status information |
|
| 132 | - * @access protected |
|
| 133 | - */ |
|
| 126 | + * Perform table SQL query and return any messages |
|
| 127 | + * |
|
| 128 | + * @param string $operation OPTIMIZE, REPAIR, or CHECK |
|
| 129 | + * @param string $tables Comma delineated string of all tables to be processed |
|
| 130 | + * @param int $disable_board The user's option to disable the board during run time |
|
| 131 | + * @return string Any errors or status information |
|
| 132 | + * @access protected |
|
| 133 | + */ |
|
| 134 | 134 | protected function table_maintenance($operation, $tables, $disable_board = 0) |
| 135 | 135 | { |
| 136 | 136 | $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 | $total_data_size = $total_data_free = 0; |
@@ -208,60 +208,60 @@ 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'; |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /** |
| 258 | - * Set disable board config state |
|
| 259 | - * |
|
| 260 | - * @param int $disable The users option to disable the board during run time |
|
| 261 | - * @param bool $switch True to disable board, false to enable board |
|
| 262 | - * @return null |
|
| 263 | - * @access public |
|
| 264 | - */ |
|
| 258 | + * Set disable board config state |
|
| 259 | + * |
|
| 260 | + * @param int $disable The users option to disable the board during run time |
|
| 261 | + * @param bool $switch True to disable board, false to enable board |
|
| 262 | + * @return null |
|
| 263 | + * @access public |
|
| 264 | + */ |
|
| 265 | 265 | public function disable_board($disable, $switch = true) |
| 266 | 266 | { |
| 267 | 267 | if ($disable) |
@@ -271,12 +271,12 @@ discard block |
||
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | /** |
| 274 | - * Display file size in the proper units |
|
| 275 | - * |
|
| 276 | - * @param int $size Number representing bytes |
|
| 277 | - * @return string $size with the correct units symbol appended |
|
| 278 | - * @access public |
|
| 279 | - */ |
|
| 274 | + * Display file size in the proper units |
|
| 275 | + * |
|
| 276 | + * @param int $size Number representing bytes |
|
| 277 | + * @return string $size with the correct units symbol appended |
|
| 278 | + * @access public |
|
| 279 | + */ |
|
| 280 | 280 | public function file_size($size) |
| 281 | 281 | { |
| 282 | 282 | $file_size_units = array(' B', ' KB', ' MB', ' GB', ' TB', ' PB', ' EB', ' ZB', ' YB'); |
@@ -284,11 +284,11 @@ discard block |
||
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /** |
| 287 | - * Extend execution limits to mitigate timeouts |
|
| 288 | - * |
|
| 289 | - * @return null |
|
| 290 | - * @access protected |
|
| 291 | - */ |
|
| 287 | + * Extend execution limits to mitigate timeouts |
|
| 288 | + * |
|
| 289 | + * @return null |
|
| 290 | + * @access protected |
|
| 291 | + */ |
|
| 292 | 292 | protected function extend_execution_limits() |
| 293 | 293 | { |
| 294 | 294 | // Disable safe mode to allow set_time_limit to work |