src/Cornford/Backup/Backup.php
public function restore($filepath)
	{
		if (!$this->getEnabled()) {
			return false;
		}

		if (!$this->getBackupFilesystemInstance()->checkFileExists($filepath)) {
			throw new BackupRestoreException('Unable to restore file "' . $filepath . '" as it doesn\'t exist.');
		}

		$this->setWorkingFilepath($filepath);

		if ($this->getBackupFilesystemInstance()->checkFileEmpty($filepath)) {
			$this->getBackupFilesystemInstance()->removeFile($filepath);

			return false;
		}

		if ($this->isCompressed($filepath)) {
			$filepath = $this->decompressFile($filepath);
		}

		$result = $this->getBackupEngineInstance()->restore($filepath);

		$this->removeTemporaryFiles($this->getWorkingFilepath());

		return $result;
	}
public function restore($filepath)
	{
		if (!$this->getEnabled()) {
			return false;
		}

		if (!$this->getBackupFilesystemInstance()->checkFileExists($filepath)) {
			throw new BackupRestoreException('Unable to restore file "' . $filepath . '" as it doesn\'t exist.');
		}

		$this->setWorkingFilepath($filepath);

		if ($this->getBackupFilesystemInstance()->checkFileEmpty($filepath)) {
			$this->getBackupFilesystemInstance()->removeFile($filepath);

			return false;
		}

		if ($this->isCompressed($filepath)) {
			$filepath = $this->decompressFile($filepath);
		}

		$result = $this->getBackupEngineInstance()->restore($filepath);

		$this->removeTemporaryFiles($this->getWorkingFilepath());

		return $result;
	}
public function restore ( $ filepath ) { if ( ! $ this -> getEnabled ( ) ) { return false ; } if ( ! $ this -> getBackupFilesystemInstance ( ) -> checkFileExists ( $ filepath ) ) { throw new BackupRestoreException ( 'Unable to restore file "' . $ filepath . '" as it doesn\'t exist.' ) ; } $ this -> setWorkingFilepath ( $ filepath ) ; if ( $ this -> getBackupFilesystemInstance ( ) -> checkFileEmpty ( $ filepath ) ) { $ this -> getBackupFilesystemInstance ( ) -> removeFile ( $ filepath ) ; return false ; } if ( $ this -> isCompressed ( $ filepath ) ) { $ filepath = $ this -> decompressFile ( $ filepath ) ; } $ result = $ this -> getBackupEngineInstance ( ) -> restore ( $ filepath ) ; $ this -> removeTemporaryFiles ( $ this -> getWorkingFilepath ( ) ) ; return $ result ; }
Restore database from file path.

@param string $filepath

@throws BackupRestoreException

@return boolean
Restore database from file path .