" . $backupFile; try { system($command); return $backupFile; } catch (Exception $ex) { return FALSE; } } public static function dumpMysqlRestore(string $_backupFile) { $command = "mysql -h " . DB_HOST . " -u " . DB_USER . " -p" . DB_PASS . " " . DB_NAME . " < " . $_backupFile; try { system($command); } catch (Exception $ex) { return FALSE; } } public static function filesRestore() { json::create("salaries"); json::create("excel"); json::create("excel-proweb"); json::create("events"); json::create("users"); json::create("salaries-proweb"); } public static function zip(string $_dir, string $_name) { $zip = new ZipArchive(); $zip_name = $_name . ".zip"; $zip->open($zip_name, ZipArchive::CREATE); $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($_dir), RecursiveIteratorIterator::LEAVES_ONLY); foreach ($files as $file) { if (!$file->isDir()) { $filePath = $file->getRealPath(); $relativePath = substr($filePath, strlen($_dir)); $zip->addFile($filePath, $relativePath); } } $zip->close(); return $zip_name; } }