Removes cached files for all or a certain image style
@param integer|null $imagestyle_id
@return boolean
351070
public function clearCache($imagestyle_id = null)
    {
        $result = null;
        $this->hook->attach('image.style.clear.cache.before', $imagestyle_id, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $result = gplcart_file_delete_recursive($this->getDirectory($imagestyle_id));
        $this->hook->attach('image.style.clear.cache.after', $imagestyle_id, $result, $this);
        return (bool) $result;
    }
1086556
private function removeFromMetaData($id) {
        $storageFileName = $this->directory . $id . '.info';
        if (file_exists($storageFileName) && is_writable($storageFileName)) {
            unset($storageFileName);
            return true;
        }
        return false;
    }
329987
protected function setImageStyle($style_id)
    {
        $this->data_imagestyle = array();

        if (is_numeric($style_id)) {

            $this->data_imagestyle = $this->image_style->get($style_id);

            if (empty($this->data_imagestyle)) {
                $this->outputHttpStatus(404);
            }
        }

        $this->prepareImageStyle($this->data_imagestyle);
    }
213415
public function update($imagestyle_id, array $data)
    {
        $result = null;
        $this->hook->attach('image.style.update.before', $imagestyle_id, $data, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $existing = $this->getList();

        if (empty($existing[$imagestyle_id])) {
            return false;
        }

        $saved = $this->config->select('imagestyles', array());

        if (empty($saved[$imagestyle_id])) {
            $data += $existing[$imagestyle_id];
        } else {
            $data += $saved[$imagestyle_id];
        }

        $default = $this->getDefaultData();
        $saved[$imagestyle_id] = array_intersect_key($data, $default);

        $result = $this->config->set('imagestyles', $saved);
        $this->hook->attach('image.style.update.after', $imagestyle_id, $data, $result, $this);
        return (bool) $result;
    }
319973
public function callbackRemove($imageId)
    {
        $image = Yii::$app->storage->getImage($imageId);
        
        if ($image) {
            $this->model->flowDeleteImage($image);
            if (Storage::removeImage($image->id, true)) {
                return $this->sendSuccess('image has been removed');
            }
        }
        
        return $this->sendError('Unable to remove this image');
    }
833885
public function delete($id = null)
    {
        $this->request->allowMethod(['post', 'delete']);

        $position = $this->BannersPositions->get($id);

        //Before deleting, it checks if the position has some banners
        if (!$position->banner_count) {
            $this->BannersPositions->deleteOrFail($position);
            $this->Flash->success(I18N_OPERATION_OK);
        } else {
            $this->Flash->alert(I18N_BEFORE_DELETE);
        }

        return $this->redirect(['action' => 'index']);
    }
376514
public function removeItem($cacheId)
    {
        $path = $this->keyPath($cacheId);

        if (!FileUtils::exists($path)) {
            return true;
        }

        return unlink($path);
    }
1217098
public function deleteRemoteImageCaches()
    {
        $path = Craft::$app->getPath()->getRuntimePath().'/imager/';

        try {
            FileHelper::clearDirectory(FileHelper::normalizePath($path));
        } catch (ErrorException $e) {
            Craft::error('Could not clear directory "'.$path.'" ('.$e->getMessage().')', __METHOD__);
        } catch (InvalidParamException $e) {
            Craft::error('Could not clear directory "'.$path.'" ('.$e->getMessage().')', __METHOD__);
        }
    }
113667
static function clearContentCacheIfNeededBySectionID( $sectionID )
    {
        // fetch all objects of this section
        $objectList = eZContentObject::fetchList( false, array( 'section_id' => "$sectionID" ) );
        // Clear cache
        $objectIDList = array();
        foreach ( $objectList as $object )
        {
            $objectIDList[] = $object['id'];
        }
        self::clearContentCacheIfNeeded( $objectIDList );
        return true;
    }
88110
public static function remove($id)
    {
        $asset = self::find($id)->first();
        $media = $asset->media;

        foreach ($media as $file) {
            if (! is_file(public_path($file->getUrl())) || ! is_writable(public_path($file->getUrl()))) {
                return;
            }
        }

        $asset->delete();
    }
638064
public function remove($id)
    {
        if (true === $result = @unlink($this->getCacheFile($id))) {
            $this->log('debug', sprintf('Cache data removed for id `%s`.', $id));
        }

        return $result;
    }
1188831
public function delete($id, $image = null)
    {
        // This check is extremely important!!
        // Otherwise it might remove a directory recursively
        if (!is_numeric($id)) {
            throw new LogicException(sprintf('Warning: Invalid Id "%s" provided. This might remove a whole target directory recursively!', $id));
        }

        $path = sprintf('%s/%s', $this->dir, $id);

        if ($image !== null) {
            try {
                $tree = FileManager::getDirTree($path);

                foreach ($tree as $file) {
                    if (FileManager::getBaseName($file) == $image && is_file($file)) {
                        FileManager::rmfile($file);
                    }
                }
                
            } catch(RuntimeException $e){
                return false;
            }

        } else {
            // Target directory might not exist, so we'd better check it
            if (is_dir($path)) {
                // Remove id directory with its content recursively
                FileManager::rmdir($path);
            }
        }

        return true;
    }
629945
public function remove($id)
    {
        if (!$this->_verifyPath($id)) {
            Zend_Cache::throwException('Invalid cache id: does not match expected public_dir path');
        }
        $fileName = basename($id);
        if ($this->_tagged === null && $tagged = $this->getInnerCache()->load(self::INNER_CACHE_NAME)) {
            $this->_tagged = $tagged;
        } elseif (!$this->_tagged) {
            return false;
        }
        if (isset($this->_tagged[$id])) {
            $extension = $this->_tagged[$id]['extension'];
        } else {
            $extension = $this->_options['file_extension'];
        }
        if ($fileName === '') {
            $fileName = $this->_options['index_filename'];
        }
        $pathName = $this->_options['public_dir'] . dirname($id);
        $file     = realpath($pathName) . '/' . $fileName . $extension;
        if (!file_exists($file)) {
            return false;
        }
        return unlink($file);
    }
954635
public function destroy($session_id = null)
    {
        @session_unset();
        if ($session_id === null) {
            $session_id = $this->getId();
        }
        return $this->cache->delete($this->prefix.$session_id);
    }
1176691
public void remove(Id id){
        String dir = getBaseDirectory(id.getDatabase(),id.getCollection());
        boolean i1 = new File(dir+File.separator+id.getEntity()).delete();
        boolean i2 = new File(dir+File.separator+id.getEntity()+".json").delete();
        if(LOG.isDebugEnabled())
            LOG.debug("File removed successfully("+(i1&&i2)+") id: "+id);
    }
749474
public function destroy(/*# string */ $session_id)/*# : bool */
    {
        $file = $this->getSessionFile($session_id);
        return $this->storage->del($file);
    }
1211242
public function sectionStylesDelete()
	{
		$filename = Eresus_CMS::getLegacyKernel()->froot . 'style/'.arg('delete');
		if (file_exists($filename))
		{
			unlink($filename);
		}
		HTTP::redirect(Eresus_Kernel::app()->getPage()->url());
	}