ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Shared_ZipStreamWrapper Class Reference
+ Collaboration diagram for PHPExcel_Shared_ZipStreamWrapper:

Public Member Functions

 stream_open ($path, $mode, $options, &$opened_path)
 Open stream.
 stream_stat ()
 Stat stream.
 stream_read ($count)
 Read stream.
 stream_tell ()
 Tell stream.
 stream_eof ()
 EOF stream.
 stream_seek ($offset, $whence)
 Seek stream.

Static Public Member Functions

static register ()
 Register wrapper.

Private Attributes

 $_archive
 $_fileNameInArchive = ''
 $_position = 0
 $_data = ''

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.

{
// Check for mode
if ($mode{0} != 'r') {
throw new Exception('Mode ' . $mode . ' is not supported. Only read mode is supported.');
}
$pos = strrpos($path, '#');
$url['host'] = substr($path, 6, $pos - 6); // 6: strlen('zip://')
$url['fragment'] = substr($path, $pos + 1);
// Open archive
$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);
return $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 ( )

Tell stream.

Definition at line 116 of file ZipStreamWrapper.php.

References $_position.

{
}

Field Documentation

PHPExcel_Shared_ZipStreamWrapper::$_archive
private

Definition at line 42 of file ZipStreamWrapper.php.

PHPExcel_Shared_ZipStreamWrapper::$_data = ''
private

Definition at line 63 of file ZipStreamWrapper.php.

PHPExcel_Shared_ZipStreamWrapper::$_fileNameInArchive = ''
private

Definition at line 49 of file ZipStreamWrapper.php.

PHPExcel_Shared_ZipStreamWrapper::$_position = 0
private

Definition at line 56 of file ZipStreamWrapper.php.

Referenced by stream_tell().


The documentation for this class was generated from the following file: