Exemplo n.º 1
0
 /**
  */
 public function rename($oldpath, $oldname, $newpath, $newname)
 {
     if (!($res = $this->_getFile($oldpath, $oldname))) {
         throw new Horde_Vfs_Exception('Unable to rename VFS file.');
     }
     $this->autocreatePath($newpath);
     $res->file[self::MD][self::FNAME] = $newname;
     $res->file[self::MD][self::PATH] = $newpath;
     try {
         $this->_files->save($res->file);
     } catch (MongoException $e) {
         throw new Horde_Vfs_Exception(sprintf('Unable to rename VFS file %s/%s.', $oldpath, $oldname));
     }
 }
Exemplo n.º 2
0
 /**
  * save.
  */
 public function save($a, array $options = array())
 {
     $this->time->start();
     $return = parent::save($a, $options);
     $time = $this->time->stop();
     $this->log(array('type' => 'save', 'a' => $a, 'options' => $options, 'time' => $time));
     return $return;
 }