Neos\Flow\ResourceManagement\Storage\WritableFileSystemStorage::deleteResource PHP Method

deleteResource() public method

Deletes the storage data related to the given PersistentResource object
public deleteResource ( PersistentResource $resource ) : boolean
$resource Neos\Flow\ResourceManagement\PersistentResource The PersistentResource to delete the storage data of
return boolean TRUE if removal was successful
    public function deleteResource(PersistentResource $resource)
    {
        $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());
        if (!file_exists($pathAndFilename)) {
            return true;
        }
        if (unlink($pathAndFilename) === false) {
            return false;
        }
        Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));
        return true;
    }