public function PHPExcel_Shared_OLE_PPS_Root::_makeSmallData in Loft Data Grids 6.2
Same name and namespace in other branches
- 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE/PPS/Root.php \PHPExcel_Shared_OLE_PPS_Root::_makeSmallData()
* get small data (PPS's with data smaller than PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) * * @access public *
Parameters
array &$raList Reference to array of PPS's:
1 call to PHPExcel_Shared_OLE_PPS_Root::_makeSmallData()
- 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 307
Class
- PHPExcel_Shared_OLE_PPS_Root
- Class for creating Root PPS's for OLE containers
Code
public function _makeSmallData(&$raList) {
$sRes = '';
$FILE = $this->_FILEH_;
$iSmBlk = 0;
$iCount = count($raList);
for ($i = 0; $i < $iCount; ++$i) {
// Make SBD, small data string
if ($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE) {
if ($raList[$i]->Size <= 0) {
continue;
}
if ($raList[$i]->Size < PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) {
$iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) + ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE ? 1 : 0);
// Add to SBD
$jB = $iSmbCnt - 1;
for ($j = 0; $j < $jB; ++$j) {
fwrite($FILE, pack("V", $j + $iSmBlk + 1));
}
fwrite($FILE, pack("V", -2));
//// Add to Data String(this will be written for RootEntry)
//if ($raList[$i]->_PPS_FILE) {
// fseek($raList[$i]->_PPS_FILE, 0); // To The Top
// while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
// $sRes .= $sBuff;
// }
//} else {
$sRes .= $raList[$i]->_data;
//}
if ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) {
$sRes .= str_repeat("\0", $this->_SMALL_BLOCK_SIZE - $raList[$i]->Size % $this->_SMALL_BLOCK_SIZE);
}
// Set for PPS
$raList[$i]->_StartBlock = $iSmBlk;
$iSmBlk += $iSmbCnt;
}
}
}
$iSbCnt = floor($this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE);
if ($iSmBlk % $iSbCnt) {
$iB = $iSbCnt - $iSmBlk % $iSbCnt;
for ($i = 0; $i < $iB; ++$i) {
fwrite($FILE, pack("V", -1));
}
}
return $sRes;
}