47 $this->_stream = $stream;
58 public function setString($nsKey, $itemKey, $string, $mode)
63 case self::MODE_WRITE:
64 $this->_contents[$nsKey][$itemKey] = $string;
66 case self::MODE_APPEND:
67 if (!$this->
hasKey($nsKey, $itemKey))
69 $this->_contents[$nsKey][$itemKey] =
'';
71 $this->_contents[$nsKey][$itemKey] .= $string;
75 'Invalid mode [' . $mode .
'] used to set nsKey='.
76 $nsKey .
', itemKey=' . $itemKey
95 case self::MODE_WRITE:
97 case self::MODE_APPEND:
98 if (!$this->
hasKey($nsKey, $itemKey))
100 $this->_contents[$nsKey][$itemKey] =
'';
102 while (
false !== $bytes = $os->
read(8192))
104 $this->_contents[$nsKey][$itemKey] .= $bytes;
109 'Invalid mode [' . $mode .
'] used to set nsKey='.
110 $nsKey .
', itemKey=' . $itemKey
126 $is->setKeyCache($this);
127 $is->setNsKey($nsKey);
128 $is->setItemKey($itemKey);
129 if (isset($writeThrough))
131 $is->setWriteThroughStream($writeThrough);
145 if ($this->
hasKey($nsKey, $itemKey))
147 return $this->_contents[$nsKey][$itemKey];
172 return array_key_exists($itemKey, $this->_contents[$nsKey]);
182 unset($this->_contents[$nsKey][$itemKey]);
191 unset($this->_contents[$nsKey]);
203 if (!array_key_exists($nsKey, $this->_contents))
205 $this->_contents[$nsKey] = array();