public function S3fsStreamWrapper::unlink in S3 File System 7
Same name and namespace in other branches
- 7.3 S3fsStreamWrapper.inc \S3fsStreamWrapper::unlink()
- 7.2 S3fsStreamWrapper.inc \S3fsStreamWrapper::unlink()
Support for unlink().
Parameters
string $uri: A string containing the uri to the resource to delete.
Return value
bool TRUE if resource was successfully deleted, regardless of whether or not the file actually existed. FALSE if the call to S3 failed, in which case the file will not be removed from the cache.
Overrides StreamWrapperInterface::unlink
See also
http://php.net/manual/en/streamwrapper.unlink.php
1 call to S3fsStreamWrapper::unlink()
- S3fsStreamWrapper::rename in ./
S3fsStreamWrapper.inc - Support for rename().
File
- ./
S3fsStreamWrapper.inc, line 781 - Drupal stream wrapper implementation for S3 File System.
Class
- S3fsStreamWrapper
- The stream wrapper class.
Code
public function unlink($uri) {
$this
->_assert_constructor_called();
$this
->_debug("unlink({$uri}) called.");
try {
$this->s3
->deleteObject($this
->_get_params($uri));
$this
->_delete_cache($uri);
clearstatcache(TRUE, $uri);
return TRUE;
} catch (\Exception $e) {
$this
->_debug($e
->getMessage());
return $this
->_trigger_error($e
->getMessage());
}
}