| 1 |
<?php |
| 2 |
/* |
| 3 |
* This file is part of the ManageWP Worker plugin. |
| 4 |
* |
| 5 |
* (c) ManageWP LLC <[email protected]> |
| 6 |
* |
| 7 |
* For the full copyright and license information, please view the LICENSE |
| 8 |
* file that was distributed with this source code. |
| 9 |
*/ |
| 10 |
|
| 11 |
class MWP_Action_IncrementalBackup_ListTables extends MWP_Action_IncrementalBackup_Abstract |
| 12 |
{ |
| 13 |
|
| 14 |
public function listTables(array $params = array(), MWP_Worker_Request $request) |
| 15 |
{ |
| 16 |
$wpdb = $this->container->getWordPressContext()->getDb(); |
| 17 |
$db = $this->container->getWordPressContext()->getConstant('DB_NAME'); |
| 18 |
$tables = $wpdb->get_results($wpdb->prepare('SELECT table_name AS "table", data_length as size,table_type as type FROM information_schema.TABLES WHERE table_schema = %s', $db), ARRAY_A); |
| 19 |
|
| 20 |
return $this->createResult(array('tables' => $tables, 'db_prefix' => $wpdb->prefix)); |
| 21 |
} |
| 22 |
} |
| 23 |
|