Exemple #1
0
 /**
  * Restore a database dump
  * 
  * @param string $sourceFile
  * @return boolean
  */
 public function restore($sourceFile)
 {
     $command = sprintf('%smysql --user=%s --password=%s --host=%s --port=%s %s < %s', $this->getRestoreCommandPath(), escapeshellarg($this->user), escapeshellarg($this->password), escapeshellarg($this->host), escapeshellarg($this->port), escapeshellarg($this->database), escapeshellarg($sourceFile));
     return $this->console->run($command);
 }
 /**
  * Restore a database dump
  * 
  * @param string $sourceFile
  * @return boolean
  */
 public function restore($sourceFile)
 {
     $command = sprintf('PGPASSWORD=%s pg_restore --verbose --clean --no-acl --no-owner -h %s -U %s -d %s %s', escapeshellarg($this->password), escapeshellarg($this->host), escapeshellarg($this->user), escapeshellarg($this->database), escapeshellarg($sourceFile));
     return $this->console->run($command);
 }
Exemple #3
0
 /**
  * Restore a database dump
  * 
  * @param string $sourceFile
  * @return boolean
  */
 public function restore($sourceFile)
 {
     $command = sprintf('cp -f %s %s', escapeshellarg($sourceFile), escapeshellarg($this->databaseFile));
     return $this->console->run($command);
 }