read() public method

Retrieves a file from the VFS.
public read ( string $path, string $name ) : string
$path string The pathname to the file.
$name string The filename to retrieve.
return string The file data.
示例#1
0
文件: Vfs.php 项目: jubinpatel/horde
 /**
  */
 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;
 }
示例#2
0
文件: Ftp.php 项目: raz0rsdge/horde
 /**
  * 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;
     }
 }
示例#3
0
文件: Vfs.php 项目: DSNS-LAB/Dmail
 /**
  */
 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);
     }
 }