/** * {@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); } }
/** * 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); }
/** * {@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; }
/** * 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; }
/** * {@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; }
/** * {@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; }
/** * {@inheritdoc} */ public function delete($path) { return $this->adapter->delete($this->getPath($path)); }
/** * 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); }
function it_deletes_file(AdapterInterface $adapter) { $adapter->delete('filename')->willReturn(true); $this->delete('filename')->shouldReturn(true); }
/** * {@inheritdoc} */ public function delete($key) { return $this->adapter->delete($key); }