10 defined(
'JPATH_PLATFORM') or die;
43 protected $_locktest = null;
55 public function start($id, $group = null)
58 $data = $this->cache->get($id, $group);
60 $this->_locktest =
new stdClass;
61 $this->_locktest->locked = null;
62 $this->_locktest->locklooped = null;
66 $this->_locktest = $this->cache->lock($id, $group);
67 if ($this->_locktest->locked ==
true && $this->_locktest->locklooped ==
true)
69 $data = $this->cache->get($id, $group);
75 $data = unserialize(trim($data));
77 if ($this->_locktest->locked ==
true)
79 $this->cache->unlock($id, $group);
86 if ($this->_locktest->locked ==
false)
88 $this->_locktest = $this->cache->lock($id, $group);
91 ob_implicit_flush(
false);
95 $this->_group = $group;
108 public function end()
111 $data = ob_get_contents();
117 $group = $this->_group;
119 $this->_group = null;
122 $ret = $this->cache->store(serialize($data), $id, $group);
124 if ($this->_locktest->locked ==
true)
126 $this->cache->unlock($id, $group);