You are here

public function PHPExcel_Shared_OLE::getStream in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php \PHPExcel_Shared_OLE::getStream()

* Returns a stream for use with fread() etc. External callers should * use PHPExcel_Shared_OLE_PPS_File::getStream(). *

Parameters

int|PPS block id or PPS: * @return resource read-only stream

3 calls to PHPExcel_Shared_OLE::getStream()
PHPExcel_Shared_OLE::getData in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php
* Gets data from a PPS * If there is no PPS for the index given, it will return an empty string. * * @access public *
PHPExcel_Shared_OLE::read in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php
* Reads an OLE container from the contents of the file given. * * @acces public *
PHPExcel_Shared_OLE::_readPpsWks in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php
* Gets information about all PPS's on the OLE container from the PPS WK's * creates an OLE_PPS object for each one. * * @access public *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php, line 197

Class

PHPExcel_Shared_OLE
OLE package base class.

Code

public function getStream($blockIdOrPps) {
  static $isRegistered = false;
  if (!$isRegistered) {
    stream_wrapper_register('ole-chainedblockstream', 'PHPExcel_Shared_OLE_ChainedBlockStream');
    $isRegistered = true;
  }

  // Store current instance in global array, so that it can be accessed
  // in OLE_ChainedBlockStream::stream_open().
  // Object is removed from self::$instances in OLE_Stream::close().
  $GLOBALS['_OLE_INSTANCES'][] = $this;
  $instanceId = end(array_keys($GLOBALS['_OLE_INSTANCES']));
  $path = 'ole-chainedblockstream://oleInstanceId=' . $instanceId;
  if ($blockIdOrPps instanceof PHPExcel_Shared_OLE_PPS) {
    $path .= '&blockId=' . $blockIdOrPps->_StartBlock;
    $path .= '&size=' . $blockIdOrPps->Size;
  }
  else {
    $path .= '&blockId=' . $blockIdOrPps;
  }
  return fopen($path, 'r');
}