library/Garp/Content/Db/Server/Abstract.php
public function restore(&$dump) {
        $this->_adjustDumpToEnvironment($dump);
        //$dump         = $this->_lowerCaseTableAndViewNames($dump);
        $this->_removeDefinerCalls($dump);
        $dbConfig       = $this->getDbConfigParams();
        $restoreFile    = $this->getRestoreFilePath();
        $restoreDir     = $this->getBackupDir();

        $executeFile    = new Garp_Shell_Command_CreateDatabase($dbConfig);
        $this->shellExec($executeFile);

        if (!$this->_validateDump($dump)) {
            throw new Exception("The fetched database seems invalid.");
        }

        $createRestoreDir = new Garp_Shell_Command_CreateDir($restoreDir);
        $this->shellExec($createRestoreDir);

        if ($this->store($restoreFile, $dump)) {
            $executeFile = new Garp_Shell_Command_ExecuteDatabaseDumpFile($dbConfig, $restoreFile);
            $this->shellExec($executeFile);

            $removeFile = new Garp_Shell_Command_RemoveFile($restoreFile);
            $this->shellExec($removeFile);
        }
    }
public function restore(&$dump) {
        $this->_adjustDumpToEnvironment($dump);
        //$dump         = $this->_lowerCaseTableAndViewNames($dump);
        $this->_removeDefinerCalls($dump);
        $dbConfig       = $this->getDbConfigParams();
        $restoreFile    = $this->getRestoreFilePath();
        $restoreDir     = $this->getBackupDir();

        $executeFile    = new Garp_Shell_Command_CreateDatabase($dbConfig);
        $this->shellExec($executeFile);

        if (!$this->_validateDump($dump)) {
            throw new Exception("The fetched database seems invalid.");
        }

        $createRestoreDir = new Garp_Shell_Command_CreateDir($restoreDir);
        $this->shellExec($createRestoreDir);

        if ($this->store($restoreFile, $dump)) {
            $executeFile = new Garp_Shell_Command_ExecuteDatabaseDumpFile($dbConfig, $restoreFile);
            $this->shellExec($executeFile);

            $removeFile = new Garp_Shell_Command_RemoveFile($restoreFile);
            $this->shellExec($removeFile);
        }
    }
public function restore ( & $ dump ) { $ this -> _adjustDumpToEnvironment ( $ dump ) ; //$dump         = $this->_lowerCaseTableAndViewNames($dump); $ this -> _removeDefinerCalls ( $ dump ) ; $ dbConfig = $ this -> getDbConfigParams ( ) ; $ restoreFile = $ this -> getRestoreFilePath ( ) ; $ restoreDir = $ this -> getBackupDir ( ) ; $ executeFile = new Garp_Shell_Command_CreateDatabase ( $ dbConfig ) ; $ this -> shellExec ( $ executeFile ) ; if ( ! $ this -> _validateDump ( $ dump ) ) { throw new Exception ( "The fetched database seems invalid." ) ; } $ createRestoreDir = new Garp_Shell_Command_CreateDir ( $ restoreDir ) ; $ this -> shellExec ( $ createRestoreDir ) ; if ( $ this -> store ( $ restoreFile , $ dump ) ) { $ executeFile = new Garp_Shell_Command_ExecuteDatabaseDumpFile ( $ dbConfig , $ restoreFile ) ; $ this -> shellExec ( $ executeFile ) ; $ removeFile = new Garp_Shell_Command_RemoveFile ( $ restoreFile ) ; $ this -> shellExec ( $ removeFile ) ; } }
Restores a database from a MySQL dump result, executing the contained SQL queries.
@param String $dump The MySQL dump output
Restores a database from a MySQL dump result executing the contained SQL queries .