示例#1
0
 /**
  * Create a tar or zip I/O driver
  *
  * @param string      $filename     Path to database file
  * @param ArchiveType $archive_type Tar or zip archive
  * @param Compression $compression  Compression not supported by zip archives
  */
 public function __construct($filename, ArchiveType $archive_type, Compression $compression = null)
 {
     $this->filename = $filename;
     $this->archive = new \PharData($filename, null, null, $archive_type->value());
     $this->compression = $compression ?: Compression::NONE();
     if ($archive_type == ArchiveType::ZIP() && $this->compression != Compression::NONE()) {
         throw new NotSupportedException("You cannot use compression with zip databases");
     }
 }