68 if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
69 $this->_currentObject->detach();
71 fseek($this->_fileHandle,0,SEEK_END);
74 'ptr' => ftell($this->_fileHandle),
75 'sz' => fwrite($this->_fileHandle, serialize($this->_currentObject))
77 $this->_currentCellIsDirty =
false;
79 $this->_currentObjectID = $this->_currentObject = null;
92 if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
96 $this->_currentObjectID = $pCoord;
97 $this->_currentObject = $cell;
98 $this->_currentCellIsDirty =
true;
112 if ($pCoord === $this->_currentObjectID) {
118 if (!isset($this->_cellCache[$pCoord])) {
124 $this->_currentObjectID = $pCoord;
125 fseek($this->_fileHandle, $this->_cellCache[$pCoord][
'ptr']);
126 $this->_currentObject = unserialize(fread($this->_fileHandle, $this->_cellCache[$pCoord][
'sz']));
128 $this->_currentObject->attach($this);
141 if ($this->_currentObjectID !== null) {
145 return parent::getCellList();
156 parent::copyCellCollection($parent);
159 $newFileName = $this->_cacheDirectory.
'/PHPExcel.'.$baseUnique.
'.cache';
161 copy ($this->_fileName,$newFileName);
162 $this->_fileName = $newFileName;
164 $this->_fileHandle = fopen($this->_fileName,
'a+');
174 if(!is_null($this->_currentObject)) {
175 $this->_currentObject->detach();
176 $this->_currentObject = $this->_currentObjectID = null;
178 $this->_cellCache =
array();
181 $this->_parent = null;
195 $this->_cacheDirectory = ((isset($arguments[
'dir'])) && ($arguments[
'dir'] !== NULL))
199 parent::__construct($parent);
200 if (is_null($this->_fileHandle)) {
202 $this->_fileName = $this->_cacheDirectory.
'/PHPExcel.'.$baseUnique.
'.cache';
203 $this->_fileHandle = fopen($this->_fileName,
'a+');
212 if (!is_null($this->_fileHandle)) {
213 fclose($this->_fileHandle);
214 unlink($this->_fileName);
216 $this->_fileHandle = null;
_storeData()
Store cell data in cache for the current cell object if it's "dirty", and the 'nullify' the current c...
__destruct()
Destroy this cell collection.
getCacheData($pCoord)
Get cell at a specific coordinate.
__construct(PHPExcel_Worksheet $parent, $arguments)
Initialise this new cell collection.
getCellList()
Get a list of all cell addresses currently held in cache.
_getUniqueID()
Generate a unique ID for cache referencing.
static sys_get_temp_dir()
Get the systems temporary directory.
unsetWorksheetCells()
Clear the cell collection and disconnect from our parent.
Create styles array
The data for the language used.
copyCellCollection(PHPExcel_Worksheet $parent)
Clone the cell collection.
addCacheData($pCoord, PHPExcel_Cell $cell)
Add or Update a cell in cache identified by coordinate address.