credentials->getUser(), ]); $process->setEnv(['MYSQL_PWD' => $this->credentials->getPassword()]); $process->run(); $filesystem->dumpFile($fileName, $process->getOutput()); return $fileName; } public function restore(string $db, string $fileName): void { $process = new Process([ 'mysql', '-u', $this->credentials->getUser(), $db, ]); $process->setEnv(['MYSQL_PWD' => $this->credentials->getPassword()]); $process->setInput(file_get_contents($fileName)); $process->run(); } }