Exemple #1
0
 protected function _syncDb()
 {
     $mediator = new Garp_Content_Db_Mediator($this->_sourceEnv, $this->_targetEnv);
     $source = $mediator->getSource();
     $target = $mediator->getTarget();
     $this->_enableHighMemory();
     $progress = Garp_Cli_Ui_ProgressBar::getInstance();
     $progress->init(3);
     //  1.
     $progress->display("Backing up");
     $target->backup();
     $progress->advance();
     //  2.
     $progress->display("Fetching data");
     $dump = $source->fetchDump();
     $progress->advance();
     //  3.
     $progress->display("Injecting data");
     $target->restore($dump);
     $progress->advance();
     $progress->display("√ Database in sync");
 }
Exemple #2
0
 public function createDataDump()
 {
     if (!$this->_useDatabase) {
         return true;
     }
     $mediator = new Garp_Content_Db_Mediator($this->_dbEnv, $this->_dbEnv);
     $dbServer = $mediator->getSource();
     $dump = $dbServer->fetchDump();
     return file_put_contents($this->_getDataDumpLocation(), $dump);
 }