예제 #1
0
 public function file_put_contents($path, $data)
 {
     $info = ['target' => $this->getMountPoint() . '/' . $path, 'source' => $this->getSourcePath($path)];
     \OCP\Util::emitHook('\\OC\\Files\\Storage\\Shared', 'file_put_contents', $info);
     return parent::file_put_contents($path, $data);
 }
예제 #2
0
 /**
  * see http://php.net/manual/en/function.rename.php
  *
  * @param string $path1
  * @param string $path2
  * @return bool
  */
 public function rename($path1, $path2)
 {
     $isPartFile = pathinfo($path1, PATHINFO_EXTENSION) === 'part';
     $targetExists = $this->file_exists($path2);
     $sameFodler = dirname($path1) === dirname($path2);
     if ($targetExists || $sameFodler && !$isPartFile) {
         if (!$this->isUpdatable('')) {
             return false;
         }
     } else {
         if (!$this->isCreatable('')) {
             return false;
         }
     }
     return parent::rename($path1, $path2);
 }