Static Public Member Functions |
static | register () |
| Register wrapper.
|
Detailed Description
Definition at line 36 of file ZipStreamWrapper.php.
Member Function Documentation
static PHPExcel_Shared_ZipStreamWrapper::register |
( |
| ) |
|
|
static |
Register wrapper.
Definition at line 68 of file ZipStreamWrapper.php.
{
@stream_wrapper_unregister("zip");
@stream_wrapper_register("zip", __CLASS__);
}
PHPExcel_Shared_ZipStreamWrapper::stream_eof |
( |
| ) |
|
EOF stream.
Definition at line 123 of file ZipStreamWrapper.php.
{
return $this->_position >= strlen($this->_data);
}
PHPExcel_Shared_ZipStreamWrapper::stream_open |
( |
|
$path, |
|
|
|
$mode, |
|
|
|
$options, |
|
|
& |
$opened_path |
|
) |
| |
Open stream.
Definition at line 76 of file ZipStreamWrapper.php.
References $path, and $pos.
{
if ($mode{0} != 'r') {
throw new Exception(
'Mode ' . $mode .
' is not supported. Only read mode is supported.');
}
$this->_archive = new ZipArchive();
$this->_archive->open($url['host']);
$this->_fileNameInArchive = $url['fragment'];
$this->_position = 0;
$this->_data = $this->_archive->getFromName( $this->_fileNameInArchive );
return true;
}
PHPExcel_Shared_ZipStreamWrapper::stream_read |
( |
|
$count | ) |
|
Read stream.
Definition at line 107 of file ZipStreamWrapper.php.
References $ret.
{
$ret = substr($this->_data, $this->_position, $count);
$this->_position += strlen(
$ret);
}
PHPExcel_Shared_ZipStreamWrapper::stream_seek |
( |
|
$offset, |
|
|
|
$whence |
|
) |
| |
Seek stream.
Definition at line 130 of file ZipStreamWrapper.php.
{
switch ($whence) {
case SEEK_SET:
if ($offset < strlen($this->_data) && $offset >= 0) {
$this->_position = $offset;
return true;
} else {
return false;
}
break;
case SEEK_CUR:
if ($offset >= 0) {
$this->_position += $offset;
return true;
} else {
return false;
}
break;
case SEEK_END:
if (strlen($this->_data) + $offset >= 0) {
$this->_position = strlen($this->_data) + $offset;
return true;
} else {
return false;
}
break;
default:
return false;
}
}
PHPExcel_Shared_ZipStreamWrapper::stream_stat |
( |
| ) |
|
Stat stream.
Definition at line 100 of file ZipStreamWrapper.php.
{
return $this->_archive->statName( $this->_fileNameInArchive );
}
PHPExcel_Shared_ZipStreamWrapper::stream_tell |
( |
| ) |
|
Field Documentation
PHPExcel_Shared_ZipStreamWrapper::$_archive |
|
private |
PHPExcel_Shared_ZipStreamWrapper::$_data = '' |
|
private |
PHPExcel_Shared_ZipStreamWrapper::$_fileNameInArchive = '' |
|
private |
PHPExcel_Shared_ZipStreamWrapper::$_position = 0 |
|
private |
The documentation for this class was generated from the following file: