Ejemplo n.º 1
0
 private function getTableInfo($table)
 {
     $context = mwp_context();
     $db = $context->getDb();
     $dbName = $context->getDbName();
     $tableStatusResult = $db->get_results(sprintf('SHOW TABLE STATUS FROM `%s` WHERE Name = "%s"', $this->escapeTableName($dbName), $context->escapeParameter($table)), ARRAY_A);
     $charsetResult = $db->get_results(sprintf('SELECT CCSA.character_set_name FROM information_schema.`TABLES` T, information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA WHERE CCSA.collation_name = T.table_collation AND T.table_schema = "%s" AND T.table_name = "%s"', $context->escapeParameter($dbName), $context->escapeParameter($table)), ARRAY_A);
     $engine = $tableStatusResult[0]['Engine'];
     $autoIncrement = $tableStatusResult[0]['Auto_increment'];
     $collation = $tableStatusResult[0]['Collation'];
     $charset = $charsetResult[0]['character_set_name'];
     return array('engine' => $engine, 'autoIncrement' => $autoIncrement, 'collation' => $collation, 'charset' => $charset);
 }
 /**
  * @param string $method
  *
  * @param array  $options
  *
  * @throws MWP_Worker_Exception
  * @return MWP_IncrementalBackup_Database_DumperInterface
  */
 protected function createDumper($method, array $options = array())
 {
     $dumperOptions = MWP_IncrementalBackup_Database_DumpOptions::createFromArray($options);
     switch ($method) {
         case self::METHOD_MYSQLDUMP:
             $configuration = MWP_IncrementalBackup_Database_Configuration::createFromWordPressContext(mwp_context());
             $dumper = new MWP_IncrementalBackup_Database_MysqlDumpDumper($configuration, $dumperOptions);
             return $dumper;
         case self::METHOD_PHPDUMPER:
             $configuration = MWP_IncrementalBackup_Database_Configuration::createFromWordPressContext(mwp_context());
             $dumper = new MWP_IncrementalBackup_Database_PhpDumper($configuration, mwp_container()->getSystemEnvironment(), $dumperOptions);
             return $dumper;
         default:
             throw new MWP_Worker_Exception(MWP_Worker_Exception::BACKUP_DATABASE_METHOD_NOT_AVAILABLE);
             break;
     }
 }
Ejemplo n.º 3
0
function mmb_get_autoupdate_plugins_themes($params)
{
    mwp_context()->requireTheme();
    $return = MMB_Updater::getSettings($params);
    mmb_response($return, true);
}