60 if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
61 $this->_currentObject->detach();
63 fseek($this->_fileHandle,0,SEEK_END);
66 'ptr' => ftell($this->_fileHandle),
67 'sz' => fwrite($this->_fileHandle, serialize($this->_currentObject))
69 $this->_currentCellIsDirty =
false;
71 $this->_currentObjectID = $this->_currentObject = null;
84 if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
88 $this->_currentObjectID = $pCoord;
89 $this->_currentObject = $cell;
90 $this->_currentCellIsDirty =
true;
104 if ($pCoord === $this->_currentObjectID) {
110 if (!isset($this->_cellCache[$pCoord])) {
116 $this->_currentObjectID = $pCoord;
117 fseek($this->_fileHandle,$this->_cellCache[$pCoord][
'ptr']);
118 $this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord][
'sz']));
120 $this->_currentObject->attach($this);
133 if ($this->_currentObjectID !== null) {
137 return parent::getCellList();
148 parent::copyCellCollection($parent);
150 $newFileHandle = fopen(
'php://temp/maxmemory:'.$this->_memoryCacheSize,
'a+');
152 fseek($this->_fileHandle,0);
153 while (!feof($this->_fileHandle)) {
154 fwrite($newFileHandle,fread($this->_fileHandle, 1024));
156 $this->_fileHandle = $newFileHandle;
166 if(!is_null($this->_currentObject)) {
167 $this->_currentObject->detach();
168 $this->_currentObject = $this->_currentObjectID = null;
170 $this->_cellCache =
array();
173 $this->_parent = null;
187 $this->_memoryCacheSize = (isset($arguments[
'memoryCacheSize'])) ? $arguments[
'memoryCacheSize'] :
'1MB';
189 parent::__construct($parent);
190 if (is_null($this->_fileHandle)) {
191 $this->_fileHandle = fopen(
'php://temp/maxmemory:'.$this->_memoryCacheSize,
'a+');
200 if (!is_null($this->_fileHandle)) {
201 fclose($this->_fileHandle);
203 $this->_fileHandle = null;
_storeData()
Store cell data in cache for the current cell object if it's "dirty", and the 'nullify' the current c...
unsetWorksheetCells()
Clear the cell collection and disconnect from our parent.
copyCellCollection(PHPExcel_Worksheet $parent)
Clone the cell collection.
addCacheData($pCoord, PHPExcel_Cell $cell)
Add or Update a cell in cache identified by coordinate address.
__construct(PHPExcel_Worksheet $parent, $arguments)
Initialise this new cell collection.
getCellList()
Get a list of all cell addresses currently held in cache.
__destruct()
Destroy this cell collection.
Create styles array
The data for the language used.
getCacheData($pCoord)
Get cell at a specific coordinate.