You are here

public function PHPExcel_CachedObjectStorage_PHPTemp::copyCellCollection in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/PHPTemp.php \PHPExcel_CachedObjectStorage_PHPTemp::copyCellCollection()

* Clone the cell collection * *

Parameters

PHPExcel_Worksheet $parent The new worksheet: * @return void

Overrides PHPExcel_CachedObjectStorage_CacheBase::copyCellCollection

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/CachedObjectStorage/PHPTemp.php, line 147

Class

PHPExcel_CachedObjectStorage_PHPTemp
PHPExcel_CachedObjectStorage_PHPTemp

Code

public function copyCellCollection(PHPExcel_Worksheet $parent) {
  parent::copyCellCollection($parent);

  //	Open a new stream for the cell cache data
  $newFileHandle = fopen('php://temp/maxmemory:' . $this->_memoryCacheSize, 'a+');

  //	Copy the existing cell cache data to the new stream
  fseek($this->_fileHandle, 0);
  while (!feof($this->_fileHandle)) {
    fwrite($newFileHandle, fread($this->_fileHandle, 1024));
  }
  $this->_fileHandle = $newFileHandle;
}