68 public static function register() {
69 @stream_wrapper_unregister(
"zip");
70 @stream_wrapper_register(
"zip", __CLASS__);
84 if ($mode{0} !=
'r') {
88 $pos = strrpos(
$path,
'#');
89 $url[
'host'] = substr(
$path, 6, $pos - 6);
90 $url[
'fragment'] = substr(
$path, $pos + 1);
93 $this->_archive =
new ZipArchive();
94 $this->_archive->open(
$url[
'host']);
96 $this->_fileNameInArchive =
$url[
'fragment'];
98 $this->_data = $this->_archive->getFromName( $this->_fileNameInArchive );
118 return $this->
statName( $this->_fileNameInArchive );
127 return $this->_archive->statName( $this->_fileNameInArchive );
137 $ret = substr($this->_data, $this->_position, $count);
138 $this->_position += strlen(
$ret);
158 return $this->_position >= strlen($this->_data);
171 if ($offset < strlen($this->_data) && $offset >= 0) {
172 $this->_position = $offset;
181 $this->_position += $offset;
189 if (strlen($this->_data) + $offset >= 0) {
190 $this->_position = strlen($this->_data) + $offset;
stream_read($count)
Implements support for fread(), fgets() etc.
stream_stat()
Implements support for fstat().
stream_open($path, $mode, $options, &$opened_path)
Implements support for fopen().
stream_tell()
Returns the position of the file pointer, i.e.
if(!is_array($argv)) $options
stream_seek($offset, $whence)
Seek stream.
url_stat()
Implements support for fstat().
statName()
Implements support for fstat().