예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function setFromStorage($json)
 {
     list($cache, $complete, $expire) = json_decode($json, true);
     if (!$expire || $expire > $this->getTime()) {
         $this->cache = $cache;
         $this->complete = $complete;
     } else {
         $this->adapter->delete($this->file);
     }
 }
예제 #2
0
 /**
  * Delete a file on the source and replica
  *
  * @param   string $path
  *
  * @return  boolean
  */
 public function delete($path)
 {
     if (!$this->source->delete($path)) {
         return false;
     }
     return $this->replica->delete($path);
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function delete($path)
 {
     $result = $this->adapter->delete($path);
     if ($result !== false) {
         $this->cache->delete($path);
     }
     return $result;
 }
 /**
  * {@inheritDoc}
  */
 public function delete($path)
 {
     $success = $this->adapter->delete($path);
     if ($success) {
         $this->cache->delete($this->getCacheKey($path));
     }
     return $success;
 }
예제 #5
0
 /**
  * Delete a file.
  *
  * @param string $path path to file
  *
  * @throws FileNotFoundException
  *
  * @return bool success boolean
  */
 public function delete($path)
 {
     $path = Util::normalizePath($path);
     $this->assertPresent($path);
     if ($this->adapter->delete($path) === false) {
         return false;
     }
     $this->cache->delete($path);
     return true;
 }
예제 #6
0
 /**
  * {@inheritDoc}
  */
 public function delete($pathOrUuid)
 {
     $path = $this->convertToPath($pathOrUuid);
     $this->guardNoInvalidUuid($pathOrUuid, $path);
     $this->guardInUploadPath($path);
     if ($this->adapter->delete($path)) {
         \Dbafs::deleteResource($path);
         return true;
     }
     return false;
 }
예제 #7
0
 /**
  * {@inheritdoc}
  */
 public function delete(array $paths) : bool
 {
     $success = true;
     foreach ($paths as $path) {
         try {
             if (!$this->driver->delete($path)) {
                 $success = false;
             }
         } catch (FileNotFoundException $e) {
             $success = false;
         }
     }
     return $success;
 }
 /**
  * {@inheritdoc}
  */
 public function delete($path)
 {
     $found = false;
     if ($this->fallback->has($path)) {
         $fallbackResult = $this->fallback->delete($path);
         $found = true;
     } else {
         $fallbackResult = true;
     }
     if ($this->mainAdapter->has($path)) {
         $mainResult = $this->mainAdapter->delete($path);
         $found = true;
     } else {
         $mainResult = true;
     }
     if (!$found) {
         throw new FileNotFoundException($path);
     }
     return $fallbackResult && $mainResult;
 }
예제 #9
0
 /**
  * {@inheritdoc}
  */
 public function delete($path)
 {
     return $this->adapter->delete($this->getPath($path));
 }
예제 #10
0
 /**
  * Delete a file.
  *
  * @param string $path path to file
  *
  * @throws FileNotFoundException
  *
  * @return bool success boolean
  */
 public function delete($path)
 {
     $path = Util::normalizePath($path);
     $this->assertPresent($path);
     return $this->adapter->delete($path);
 }
 public function it_should_ignore_delete_fails()
 {
     $delete = 'delete.txt';
     $this->adapter->delete($delete)->willReturn(false);
     $this->delete($delete)->shouldBe(false);
 }
예제 #12
0
 function it_deletes_file(AdapterInterface $adapter)
 {
     $adapter->delete('filename')->willReturn(true);
     $this->delete('filename')->shouldReturn(true);
 }
예제 #13
0
 /**
  * {@inheritdoc}
  */
 public function delete($key)
 {
     return $this->adapter->delete($key);
 }