コード例 #1
0
ファイル: DBCommand.php プロジェクト: francoisfaubert/strata
 /**
  * Dumps the current environment's database to an .sql file in /db/
  * @todo Ensure this works in and outside of Vagrant.
  */
 protected function dumpCurrentDB()
 {
     date_default_timezone_set("Etc/UTC");
     $relativeFilename = sprintf("export_%s_%s.sql", date('Y-m-d'), time());
     $command = sprintf("%s db export %s%s --add-drop-table", $this->getWpCliPath(), Strata::getDbPath(), $relativeFilename);
     $this->output->writeLn("Generating MySQL export dump to ./{$relativeFilename}");
     system($command);
 }