| @@ -48,9 +48,8 @@ | ||
| 48 | 48 | $tables = $this->getResult("SHOW TABLES", ARRAY_N); |
| 49 | 49 | return array_map(array($this, 'tableName'), $tables); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - | |
| 53 | 52 | public function showTableStatus() { |
| 54 | 53 | return $this->getResult("SHOW TABLE STATUS"); |
| 55 | 54 | } |
| 56 | 55 | |
| @@ -57,24 +56,11 @@ | ||
| 57 | 56 | public function tableKeys($table) { |
| 58 | 57 | return $this->getResult("SHOW KEYS FROM $table;"); |
| 59 | 58 | } |
| 60 | 59 | |
| 61 | - public function showDbVariables($variable) { | |
| 62 | - $variables = $this->getResult("Show variables like '%$variable%' ;"); | |
| 63 | - $result = array(); | |
| 64 | - foreach ($variables as $variable) { | |
| 65 | - $result[$variable["Variable_name"]] = $variable["Value"]; | |
| 66 | - } | |
| 67 | - return $result; | |
| 68 | - } | |
| 69 | - | |
| 70 | 60 | public function describeTable($table) { |
| 71 | 61 | return $this->getResult("DESCRIBE $table;"); |
| 72 | 62 | } |
| 73 | - | |
| 74 | - public function showTableIndex($table) { | |
| 75 | - return $this->getResult("SHOW INDEX FROM $table"); | |
| 76 | - } | |
| 77 | 63 | |
| 78 | 64 | public function checkTable($table, $type) { |
| 79 | 65 | return $this->getResult("CHECK TABLE $table $type;"); |
| 80 | 66 | } |
| @@ -229,8 +215,9 @@ | ||
| 229 | 215 | return $result; |
| 230 | 216 | } |
| 231 | 217 | |
| 232 | 218 | public function getMysqlVersion() { |
| 233 | - return $this->showDbVariables('version')['version']; | |
| 219 | + global $wpdb; | |
| 220 | + return $wpdb->db_version(); | |
| 234 | 221 | } |
| 235 | 222 | } |
| 236 | 223 | endif; |