/** */ protected function _get($keys) { $out = array(); foreach ($keys as $key) { try { $out[$key] = $this->_vfs->read($this->_params['vfspath'], $key); } catch (Horde_Vfs_Exception $e) { $out[$key] = false; } } return $out; }
/** * Retrieves user preferences from the backend. * * @throws Sam_Exception */ public function retrieve() { /* Get preference file(s). */ try { $content = $this->_vfs->read(dirname($this->_params['system_prefs']), basename($this->_params['system_prefs'])); $conf = $this->_parse($content); $content = $this->_vfs->read(dirname($this->_params['user_prefs']), basename($this->_params['user_prefs'])); $conf = array_merge($conf, $this->_parse($content)); } catch (Horde_Vfs_Exception $e) { throw new Sam_Exception($e); } foreach ($conf as $option => $value) { $this->_options[$this->_mapOptionToAttribute($option)] = $value; } }
/** */ protected function _read() { try { if (method_exists($this->_vfs, 'readStream')) { $stream = new Horde_Stream_Existing(array('stream' => $this->_vfs->readStream($this->_vfspath, $this->_id))); $stream->rewind(); } else { $stream = new Horde_Stream_Temp(); $stream->add($this->_vfs->read($this->_vfspath, $this->_id), true); } return $stream; } catch (Horde_Vfs_Exception $e) { throw new IMP_Compose_Exception($e); } }