44 $this->_currentObject->detach();
46 $obj = serialize($this->_currentObject);
47 if (wincache_ucache_exists($this->_cachePrefix.$this->_currentObjectID.
'.cache')) {
48 if (!wincache_ucache_set($this->_cachePrefix.$this->_currentObjectID.
'.cache', $obj, $this->_cacheTime)) {
50 throw new Exception(
'Failed to store cell '.$cellID.
' in WinCache');
53 if (!wincache_ucache_add($this->_cachePrefix.$this->_currentObjectID.
'.cache', $obj, $this->_cacheTime)) {
55 throw new Exception(
'Failed to store cell '.$cellID.
' in WinCache');
59 $this->_currentObjectID = $this->_currentObject = null;
72 if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
75 $this->_cellCache[$pCoord] =
true;
77 $this->_currentObjectID = $pCoord;
78 $this->_currentObject = $cell;
93 if (parent::isDataSet($pCoord)) {
94 if ($this->_currentObjectID == $pCoord) {
98 $success = wincache_ucache_exists($this->_cachePrefix.$pCoord.
'.cache');
99 if ($success ===
false) {
102 throw new Exception(
'Cell entry '.$cellID.
' no longer exists in WinCache');
118 if ($pCoord === $this->_currentObjectID) {
125 if (parent::isDataSet($pCoord)) {
127 $obj = wincache_ucache_get($this->_cachePrefix.$pCoord.
'.cache', $success);
128 if ($success ===
false) {
131 throw new Exception(
'Cell entry '.$cellID.
' no longer exists in WinCache');
139 $this->_currentObjectID = $pCoord;
140 $this->_currentObject = unserialize($obj);
142 $this->_currentObject->attach($this->_parent);
157 wincache_ucache_delete($this->_cachePrefix.$pCoord.
'.cache');
173 $newCachePrefix = substr(md5($baseUnique),0,8).
'.';
175 foreach($cacheList as $cellID) {
176 if ($cellID != $this->_currentObjectID) {
178 $obj = wincache_ucache_get($this->_cachePrefix.$cellID.
'.cache', $success);
179 if ($success ===
false) {
182 throw new Exception(
'Cell entry '.$cellID.
' no longer exists in Wincache');
184 if (!wincache_ucache_add($newCachePrefix.$cellID.
'.cache', $obj, $this->_cacheTime)) {
186 throw new Exception(
'Failed to store cell '.$cellID.
' in Wincache');
190 $this->_cachePrefix = $newCachePrefix;
195 if(!is_null($this->_currentObject)) {
196 $this->_currentObject->detach();
197 $this->_currentObject = $this->_currentObjectID = null;
203 $this->_cellCache = array();
206 $this->_parent = null;
211 $cacheTime = (isset($arguments[
'cacheTime'])) ? $arguments[
'cacheTime'] : 600;
213 if (is_null($this->_cachePrefix)) {
215 $this->_cachePrefix = substr(md5($baseUnique),0,8).
'.';
216 $this->_cacheTime = $cacheTime;
225 foreach($cacheList as $cellID) {
226 wincache_ucache_delete($this->_cachePrefix.$cellID.
'.cache');