44 $this->_currentObject->detach();
46 if (!apc_store($this->_cachePrefix.$this->_currentObjectID.
'.cache',serialize($this->_currentObject),$this->_cacheTime)) {
48 throw new Exception(
'Failed to store cell '.$cellID.
' in APC');
50 $this->_currentObjectID = $this->_currentObject = null;
63 if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
66 $this->_cellCache[$pCoord] =
true;
68 $this->_currentObjectID = $pCoord;
69 $this->_currentObject = $cell;
84 if (parent::isDataSet($pCoord)) {
85 if ($this->_currentObjectID == $pCoord) {
89 $success = apc_fetch($this->_cachePrefix.$pCoord.
'.cache');
90 if ($success ===
false) {
93 throw new Exception(
'Cell entry '.$cellID.
' no longer exists in APC');
109 if ($pCoord === $this->_currentObjectID) {
115 if (parent::isDataSet($pCoord)) {
116 $obj = apc_fetch($this->_cachePrefix.$pCoord.
'.cache');
117 if ($obj ===
false) {
120 throw new Exception(
'Cell entry '.$cellID.
' no longer exists in APC');
128 $this->_currentObjectID = $pCoord;
129 $this->_currentObject = unserialize($obj);
131 $this->_currentObject->attach($this->_parent);
146 apc_delete($this->_cachePrefix.$pCoord.
'.cache');
162 $newCachePrefix = substr(md5($baseUnique),0,8).
'.';
164 foreach($cacheList as $cellID) {
165 if ($cellID != $this->_currentObjectID) {
166 $obj = apc_fetch($this->_cachePrefix.$cellID.
'.cache');
167 if ($obj ===
false) {
170 throw new Exception(
'Cell entry '.$cellID.
' no longer exists in APC');
172 if (!apc_store($newCachePrefix.$cellID.
'.cache',$obj,$this->_cacheTime)) {
174 throw new Exception(
'Failed to store cell '.$cellID.
' in APC');
178 $this->_cachePrefix = $newCachePrefix;
183 if(!is_null($this->_currentObject)) {
184 $this->_currentObject->detach();
185 $this->_currentObject = $this->_currentObjectID = null;
191 $this->_cellCache = array();
194 $this->_parent = null;
199 $cacheTime = (isset($arguments[
'cacheTime'])) ? $arguments[
'cacheTime'] : 600;
201 if (is_null($this->_cachePrefix)) {
203 $this->_cachePrefix = substr(md5($baseUnique),0,8).
'.';
204 $this->_cacheTime = $cacheTime;
213 foreach($cacheList as $cellID) {
214 apc_delete($this->_cachePrefix.$cellID.
'.cache');