| @@ 184-202 (lines=19) @@ | ||
| 181 | public function getString($nsKey, $itemKey) |
|
| 182 | { |
|
| 183 | $this->_prepareCache($nsKey); |
|
| 184 | if ($this->hasKey($nsKey, $itemKey)) { |
|
| 185 | $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START); |
|
| 186 | if ($this->_quotes) { |
|
| 187 | ini_set('magic_quotes_runtime', 0); |
|
| 188 | } |
|
| 189 | ||
| 190 | $str = ''; |
|
| 191 | while (!feof($fp) && false !== $bytes = fread($fp, 8192)) { |
|
| 192 | $str .= $bytes; |
|
| 193 | } |
|
| 194 | ||
| 195 | if ($this->_quotes) { |
|
| 196 | ini_set('magic_quotes_runtime', 1); |
|
| 197 | } |
|
| 198 | ||
| 199 | $this->_freeHandle($nsKey, $itemKey); |
|
| 200 | ||
| 201 | return $str; |
|
| 202 | } |
|
| 203 | } |
|
| 204 | ||
| 205 | /** |
|
| @@ 214-230 (lines=17) @@ | ||
| 211 | */ |
|
| 212 | public function exportToByteStream($nsKey, $itemKey, Swift_InputByteStream $is) |
|
| 213 | { |
|
| 214 | if ($this->hasKey($nsKey, $itemKey)) { |
|
| 215 | $fp = $this->_getHandle($nsKey, $itemKey, self::POSITION_START); |
|
| 216 | ||
| 217 | if ($this->_quotes) { |
|
| 218 | ini_set('magic_quotes_runtime', 0); |
|
| 219 | } |
|
| 220 | ||
| 221 | while (!feof($fp) && false !== $bytes = fread($fp, 8192)) { |
|
| 222 | $is->write($bytes); |
|
| 223 | } |
|
| 224 | ||
| 225 | if ($this->_quotes) { |
|
| 226 | ini_set('magic_quotes_runtime', 1); |
|
| 227 | } |
|
| 228 | ||
| 229 | $this->_freeHandle($nsKey, $itemKey); |
|
| 230 | } |
|
| 231 | } |
|
| 232 | ||
| 233 | /** |
|