You are here

public function PHPExcel_Shared_OLE_PPS_Root::_saveBigData in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE/PPS/Root.php \PHPExcel_Shared_OLE_PPS_Root::_saveBigData()

* Saving big data (PPS's with data bigger than PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) * * @access public *

Parameters

integer $iStBlk: * @param array &$raList Reference to array of PPS's

1 call to PHPExcel_Shared_OLE_PPS_Root::_saveBigData()
PHPExcel_Shared_OLE_PPS_Root::save in vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE/PPS/Root.php
* Method for saving the whole OLE container (including files). * In fact, if called with an empty argument (or '-'), it saves to a * temporary file and then outputs it's contents to stdout. * If a resource pointer to a stream created…

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE/PPS/Root.php, line 258

Class

PHPExcel_Shared_OLE_PPS_Root
Class for creating Root PPS's for OLE containers

Code

public function _saveBigData($iStBlk, &$raList) {
  $FILE = $this->_FILEH_;

  // cycle through PPS's
  $iCount = count($raList);
  for ($i = 0; $i < $iCount; ++$i) {
    if ($raList[$i]->Type != PHPExcel_Shared_OLE::OLE_PPS_TYPE_DIR) {
      $raList[$i]->Size = $raList[$i]
        ->_DataLen();
      if ($raList[$i]->Size >= PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL || $raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_ROOT && isset($raList[$i]->_data)) {

        // Write Data

        //if (isset($raList[$i]->_PPS_FILE)) {

        //	$iLen = 0;
        //	fseek($raList[$i]->_PPS_FILE, 0); // To The Top
        //	while($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
        //		$iLen += strlen($sBuff);
        //		fwrite($FILE, $sBuff);
        //	}

        //} else {
        fwrite($FILE, $raList[$i]->_data);

        //}
        if ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) {
          fwrite($FILE, str_repeat("\0", $this->_BIG_BLOCK_SIZE - $raList[$i]->Size % $this->_BIG_BLOCK_SIZE));
        }

        // Set For PPS
        $raList[$i]->_StartBlock = $iStBlk;
        $iStBlk += floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE ? 1 : 0);
      }

      // Close file for each PPS, and unlink it

      //if (isset($raList[$i]->_PPS_FILE)) {

      //	fclose($raList[$i]->_PPS_FILE);
      //	$raList[$i]->_PPS_FILE = null;
      //	unlink($raList[$i]->_tmp_filename);

      //}
    }
  }
}