/** * Writes the contents of the Sqon. * * @param FileInterface $sqon The Sqon file manager. * @param FileInterface $bootstrap The PHP bootstrap script file manager. * @param FileInterface $database The database file manager. */ public function write(FileInterface $sqon, FileInterface $bootstrap, FileInterface $database) { $sqon->stream($bootstrap); $sqon->stream($database); $sqon->seek(0); $sqon->write((new Signature())->generate($sqon)); }
/** * Extracts the database to a file manager. * * @param FileInterface $file The database file manager. * * @throws ReaderException If the database could not be extracted. */ public function getDatabase(FileInterface $file) { $this->file->seek($this->getBootstrapSize()); $file->stream($this->file, $this->getSize() - $this->getBootstrapSize() - 20); }