/** * Construct an archive writer. * * @param string $filename * @param string $compression */ public function __construct($filename, $compression) { parent::__construct($filename, $compression); }
/** * Get the contents of the file and return as string. * * @return string */ public function getContents() { if (!$this->isFile()) { throw new Exception('Cannot extract non-file'); } if (!$this->size) { return ''; } if (!($this->sourceReader && $this->sourcePosition)) { throw new Exception('Unable to extract file: ' . $this->filename); } return $this->sourceReader->extractFromPosition($this->sourcePosition, $this->size); }
/** * Create iterator instance. * * @param Curry_Archive $archive * @param array $options */ public function __construct(Curry_Archive $archive, $options = array()) { parent::__construct($archive->getFilename(), $archive->getCompression()); $this->options = $options; }