40 $this->_stream = $stream;
53 public function setString($nsKey, $itemKey, $string, $mode)
57 case self::MODE_WRITE:
58 $this->_contents[$nsKey][$itemKey] = $string;
60 case self::MODE_APPEND:
61 if (!$this->
hasKey($nsKey, $itemKey)) {
62 $this->_contents[$nsKey][$itemKey] =
'';
64 $this->_contents[$nsKey][$itemKey] .= $string;
68 'Invalid mode ['.$mode.
'] used to set nsKey='.
69 $nsKey.
', itemKey='.$itemKey
88 case self::MODE_WRITE:
90 case self::MODE_APPEND:
91 if (!$this->
hasKey($nsKey, $itemKey)) {
92 $this->_contents[$nsKey][$itemKey] =
'';
94 while (
false !== $bytes = $os->
read(8192)) {
95 $this->_contents[$nsKey][$itemKey] .= $bytes;
100 'Invalid mode ['.$mode.
'] used to set nsKey='.
101 $nsKey.
', itemKey='.$itemKey
120 $is->setKeyCache($this);
121 $is->setNsKey($nsKey);
122 $is->setItemKey($itemKey);
123 if (isset($writeThrough)) {
124 $is->setWriteThroughStream($writeThrough);
141 if ($this->
hasKey($nsKey, $itemKey)) {
142 return $this->_contents[$nsKey][$itemKey];
171 return array_key_exists($itemKey, $this->_contents[$nsKey]);
182 unset($this->_contents[$nsKey][$itemKey]);
192 unset($this->_contents[$nsKey]);
202 if (!array_key_exists($nsKey, $this->_contents)) {
203 $this->_contents[$nsKey] = array();