64 if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
65 $this->_currentObject->detach();
67 if (!apc_store($this->_cachePrefix.$this->_currentObjectID.
'.cache',serialize($this->_currentObject),$this->_cacheTime)) {
69 throw new PHPExcel_Exception(
'Failed to store cell '.$this->_currentObjectID.
' in APC');
71 $this->_currentCellIsDirty =
false;
73 $this->_currentObjectID = $this->_currentObject = null;
87 if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
90 $this->_cellCache[$pCoord] =
true;
92 $this->_currentObjectID = $pCoord;
93 $this->_currentObject = $cell;
94 $this->_currentCellIsDirty =
true;
110 if (parent::isDataSet($pCoord)) {
111 if ($this->_currentObjectID == $pCoord) {
115 $success = apc_fetch($this->_cachePrefix.$pCoord.
'.cache');
118 parent::deleteCacheData($pCoord);
136 if ($pCoord === $this->_currentObjectID) {
142 if (parent::isDataSet($pCoord)) {
143 $obj = apc_fetch($this->_cachePrefix.$pCoord.
'.cache');
144 if ($obj === FALSE) {
146 parent::deleteCacheData($pCoord);
155 $this->_currentObjectID = $pCoord;
156 $this->_currentObject = unserialize($obj);
158 $this->_currentObject->attach($this);
171 if ($this->_currentObjectID !== null) {
175 return parent::getCellList();
188 apc_delete($this->_cachePrefix.$pCoord.
'.cache');
191 parent::deleteCacheData($pCoord);
204 parent::copyCellCollection($parent);
207 $newCachePrefix = substr(md5($baseUnique),0,8).
'.';
209 foreach($cacheList as $cellID) {
210 if ($cellID != $this->_currentObjectID) {
211 $obj = apc_fetch($this->_cachePrefix.$cellID.
'.cache');
212 if ($obj === FALSE) {
214 parent::deleteCacheData($cellID);
217 if (!apc_store($newCachePrefix.$cellID.
'.cache',$obj,$this->_cacheTime)) {
223 $this->_cachePrefix = $newCachePrefix;
233 if ($this->_currentObject !== NULL) {
234 $this->_currentObject->detach();
235 $this->_currentObject = $this->_currentObjectID = null;
241 $this->_cellCache =
array();
244 $this->_parent = null;
255 $cacheTime = (isset($arguments[
'cacheTime'])) ? $arguments[
'cacheTime'] : 600;
257 if ($this->_cachePrefix === NULL) {
259 $this->_cachePrefix = substr(md5($baseUnique),0,8).
'.';
260 $this->_cacheTime = $cacheTime;
262 parent::__construct($parent);
272 foreach($cacheList as $cellID) {
273 apc_delete($this->_cachePrefix.$cellID.
'.cache');
285 if (!function_exists(
'apc_store')) {
288 if (apc_sma_info() === FALSE) {
copyCellCollection(PHPExcel_Worksheet $parent)
Clone the cell collection.
addCacheData($pCoord, PHPExcel_Cell $cell)
Add or Update a cell in cache identified by coordinate address.
unsetWorksheetCells()
Clear the cell collection and disconnect from our parent.
getCellList()
Get a list of all cell addresses currently held in cache.
static cacheMethodIsAvailable()
Identify whether the caching method is currently available Some methods are dependent on the availabi...
__destruct()
Destroy this cell collection.
_getUniqueID()
Generate a unique ID for cache referencing.
__construct(PHPExcel_Worksheet $parent, $arguments)
Initialise this new cell collection.
Create styles array
The data for the language used.
_storeData()
Store cell data in cache for the current cell object if it's "dirty", and the 'nullify' the current c...
deleteCacheData($pCoord)
Delete a cell in cache identified by coordinate address.
isDataSet($pCoord)
Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
getCacheData($pCoord)
Get cell at a specific coordinate.