public function it_should_ignore_rename_fails()
 {
     $old = 'old.txt';
     $new = 'new.txt';
     $this->adapter->rename($old, $new)->willReturn(false);
     $this->rename($old, $new)->shouldBe(false);
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function rename($path, $newpath)
 {
     if (!$this->source->rename($path, $newpath)) {
         return false;
     }
     return $this->replica->rename($path, $newpath);
 }
Ejemplo n.º 3
0
 /**
  * Rename a file.
  *
  * @param string $path    path to file
  * @param string $newpath new path
  *
  * @throws FileExistsException
  * @throws FileNotFoundException
  *
  * @return bool success boolean
  */
 public function rename($path, $newpath)
 {
     $path = Util::normalizePath($path);
     $newpath = Util::normalizePath($newpath);
     $this->assertPresent($path);
     $this->assertAbsent($newpath);
     return (bool) $this->adapter->rename($path, $newpath);
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function rename($path, $newPath)
 {
     $result = $this->adapter->rename($path, $newPath);
     if ($result !== false) {
         $this->cache->rename($path, $newPath);
     }
     return $result;
 }
 /**
  * {@inheritDoc}
  */
 public function rename($path, $newpath)
 {
     $success = $this->adapter->rename($path, $newpath);
     if ($success) {
         $this->cache->delete($this->getCacheKey($path));
     }
     return $success;
 }
 /**
  * {@inheritdoc}
  */
 public function rename($path, $newpath)
 {
     if ($this->mainAdapter->has($path)) {
         return $this->mainAdapter->rename($path, $newpath);
     }
     if (false !== $this->portFromFallback($path, $newpath)) {
         return $this->fallback->delete($path);
     }
     return false;
 }
Ejemplo n.º 7
0
 /**
  * Rename a file.
  *
  * @param string $path    path to file
  * @param string $newpath new path
  *
  * @throws FileExistsException
  * @throws FileNotFoundException
  *
  * @return bool success boolean
  */
 public function rename($path, $newpath)
 {
     $path = Util::normalizePath($path);
     $newpath = Util::normalizePath($newpath);
     $this->assertPresent($path);
     $this->assertAbsent($newpath);
     if ($this->adapter->rename($path, $newpath) === false) {
         return false;
     }
     $this->cache->rename($path, $newpath);
     return true;
 }
Ejemplo n.º 8
0
 /**
  * {@inheritDoc}
  */
 public function rename($pathOrUuid, $newpath)
 {
     $path = $this->convertToPath($pathOrUuid);
     $this->guardNoInvalidUuid($pathOrUuid, $path);
     $this->guardInUploadPath($path);
     $this->guardInUploadPath($newpath);
     if ($this->adapter->rename($path, $newpath)) {
         \Dbafs::moveResource($path, $newpath);
         return true;
     }
     return false;
 }
Ejemplo n.º 9
0
 /**
  * {@inheritdoc}
  */
 public function rename($path, $newpath)
 {
     return $this->adapter->rename($this->getPath($path), $this->getPath($newpath));
 }
Ejemplo n.º 10
0
 function it_renames_file(AdapterInterface $adapter)
 {
     $adapter->rename('oldfilename', 'newfilename')->willReturn(true);
     $this->rename('oldfilename', 'newfilename')->shouldReturn(true);
 }
Ejemplo n.º 11
0
 /**
  * {@inheritdoc}
  */
 public function move(string $from, string $to) : bool
 {
     return $this->driver->rename($from, $to);
 }
Ejemplo n.º 12
0
 /**
  * {@inheritdoc}
  */
 public function rename($sourceKey, $targetKey)
 {
     return $this->adapter->rename($sourceKey, $targetKey);
 }
 /**
  * @inheritdoc
  */
 public function rename($path, $newpath)
 {
     return $this->adapter->rename($path, $newpath);
 }