/** * Restore from backup * @param string $filename * @return bool */ public function restore($filename) { if (file_exists($file = $this->getConfig('warehouse') . $filename)) { $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); if ($ext === 'sql') { return $this->database->restore($file); } elseif ($ext === 'zip') { return $this->filesystem->restore($file); } return false; } return false; }