/home/techb158/ileadtechnology.com/vendor/spatie/db-dumper/src/Databases
NameSizeModeActions
MongoDb.php32300644editdlrm
MySql.php82830644editdlrm
PostgreSql.php41050644editdlrm
Sqlite.php14870644editdlrm
Edit: /home/techb158/ileadtechnology.com/vendor/spatie/db-dumper/src/Databases/MongoDb.php (3230B)
guardAgainstIncompleteCredentials(); $process = $this->getProcess($dumpFile); $process->run(); $this->checkIfDumpWasSuccessFul($process, $dumpFile); } /** * Verifies if the dbname and host options are set. * * @throws \Spatie\DbDumper\Exceptions\CannotStartDump * @return void */ public function guardAgainstIncompleteCredentials() { foreach (['dbName', 'host'] as $requiredProperty) { if (strlen($this->$requiredProperty) === 0) { throw CannotStartDump::emptyParameter($requiredProperty); } } } /** * @param string $collection * * @return \Spatie\DbDumper\Databases\MongoDb */ public function setCollection(string $collection) { $this->collection = $collection; return $this; } /** * @param string $authenticationDatabase * * @return \Spatie\DbDumper\Databases\MongoDb */ public function setAuthenticationDatabase(string $authenticationDatabase) { $this->authenticationDatabase = $authenticationDatabase; return $this; } /** * Generate the dump command for MongoDb. * * @param string $filename * * @return string */ public function getDumpCommand(string $filename): string { $quote = $this->determineQuote(); $command = [ "{$quote}{$this->dumpBinaryPath}mongodump{$quote}", "--db {$this->dbName}", '--archive', ]; if ($this->userName) { $command[] = "--username '{$this->userName}'"; } if ($this->password) { $command[] = "--password '{$this->password}'"; } if (isset($this->host)) { $command[] = "--host {$this->host}"; } if (isset($this->port)) { $command[] = "--port {$this->port}"; } if (isset($this->collection)) { $command[] = "--collection {$this->collection}"; } if ($this->authenticationDatabase) { $command[] = "--authenticationDatabase {$this->authenticationDatabase}"; } return $this->echoToFile(implode(' ', $command), $filename); } /** * @param string $dumpFile * @return Process */ public function getProcess(string $dumpFile): Process { $command = $this->getDumpCommand($dumpFile); return Process::fromShellCommandline($command, null, null, null, $this->timeout); } }