68 public static function register() {
69 @stream_wrapper_unregister(
"zip");
70 @stream_wrapper_register(
"zip", __CLASS__);
78 if ($mode{0} !=
'r') {
79 throw new Exception(
'Mode ' . $mode .
' is not supported. Only read mode is supported.');
83 $url[
'host'] = substr(
$path, 6,
$pos - 6);
84 $url[
'fragment'] = substr(
$path,
$pos + 1);
87 $this->_archive =
new ZipArchive();
88 $this->_archive->open($url[
'host']);
90 $this->_fileNameInArchive = $url[
'fragment'];
92 $this->_data = $this->_archive->getFromName( $this->_fileNameInArchive );
101 return $this->_archive->statName( $this->_fileNameInArchive );
108 $ret = substr($this->_data, $this->_position, $count);
109 $this->_position += strlen(
$ret);
124 return $this->_position >= strlen($this->_data);
133 if ($offset < strlen($this->_data) && $offset >= 0) {
134 $this->_position = $offset;
143 $this->_position += $offset;
151 if (strlen($this->_data) + $offset >= 0) {
152 $this->_position = strlen($this->_data) + $offset;