Clear cache

@param string $action

@return void
505769
public function make($action)
    {
        if (!in_array($action, ['view', 'cache', 'session', 'log', 'all'])) {
            $this->throwFailsCommand('Clear target not valid', 'clear help');
        }

        $this->clear($action);

        echo Color::green("$action cache clear.");
    }
939354
protected function clearCaches() {
    $config = $this->getConfiguration();
    foreach($config->getSections() as $section) {
      $sectionValues = $config->getSection($section, true);
      if (isset($sectionValues['__class'])) {
        $instance = ObjectFactory::getInstance($section);
        if ($instance instanceof Cache) {
          $instance->clearAll();
        }
        elseif ($instance instanceof View) {
          $instance->clearCache();
        }
      }
    }
  }
262966
public function clear()
    {
        $files=@scandir($this->getCacheDir());
        foreach ($files as $file){
            if($file != "." && $file != ".."){
                $file=$this->getCacheDir().$file;
                @unlink($file);
            }
        }
    }
251867
public function clear_cache( $mode = 'all' ) {
		$mode = $mode ? : 'all';
		$cleared = Command::clear_cache( $mode );
		if ( $cleared ) {
			\WP_CLI::success("Cleared {$mode} cached contents");
		} else {
			\WP_CLI::warning("Failed to clear {$mode} cached contents");
		}
	}
1220149
public function clear()
    {
        $this->controller = null;
        $this->action = null;
        $this->filters = array();
        $this->filter_names = array();
        $this->position = 0;
        $this->has_action_filter = false;
    }
240580
public function load(Action $action)
    {
        if (! is_null($this->argument)) {
            $this->argument->load($action);
        }
    }
14162
public function clearcacheAction() {
        $request = $this->getRequest();
        $tags = array();
        if ($request->getParam('tags')) {
            $tags = explode(',', $request->getParam('tags'));
        }
        $createClusterJob = is_null($request->getParam('createClusterJob')) ? 1 :
            $request->getParam('createClusterJob');

        $this->view->title = 'Clear that cache';
        Garp_Cache_Manager::purge($tags, $createClusterJob);
    }
848345
public function forget(string $token): void
    {
        $this->cache->forget($this->getCacheKey($token));
    }
65025
public function clearCache() {
        $files = glob($this->getConfig('cacheDir') . '/*', GLOB_MARK);
        foreach ($files as $file) {
            unlink($file);
        }
    }
472655
public function clearCache($pages){
        if(!is_array($pages)){
            $pages = [$pages];
        }
        foreach($pages as $page){
            foreach($this->config->getDomain("type") as $type => $cacheLvl){
                $cacheLvl = abs($cacheLvl);
                if($cacheLvl == self::NO_CACHE) continue;
                $type = $this->em->getRepository(PageType::class)->findOneByTitle(str_replace("type.","",$type));
                $pagesToClear = $this->em->getRepository(Page::class)->findByType($type);
                switch($cacheLvl){
                    case self::TEMPORARY:
                        foreach($pagesToClear as $pageToClear){
                            $this->clearPage($pageToClear);
                        }
                        break;
                    case self::CHILDREN_DEPENDENCE:
                        foreach($pagesToClear as $p){
                            if(in_array($page, $p->getSubPages()->toArray())){
                                $this->clearPage($p);
                            }
                        }
                        break;
                }

                $uri = $this->config->get("URIs","uri.".$page->getRootPage()->getId());
                $this->removeUrl($uri, $page->getLink());
            }
        }
    }
888398
private function clearCache(): void
    {
        try {
            $cacheTag = config('netcore.module-category.cache_tag');
            $isRedis = cache()->getStore() instanceof RedisStore;

            if ($cacheTag && $isRedis) {
                cache()->tags([$cacheTag])->flush();
            } else {
                cache()->flush();
            }
        } catch (Exception $exception) {
            logger()->error('[module-category] Unable to clear cache: ' . $exception->getMessage());
        }
    }
730973
public function editImage($action)
    {
        $image = $this->loadImage();

        $path = $this->processImage($action, $image);

        $this->changeImagePath($path);
    }
370232
public function clear()
    {
        echo $path  = $this->getFilePath();
        $files = glob($path . '*' . $this->fileExtension);

        foreach ($files as $file)
        {
            // if cache file expire, delete cache file
            if ( time() > filemtime($file) )
            {
                @unlink($file);
            }
        }
    }
593572
public function clearAction()
    {
        $tags = $this->params('tags', null);
        if (null === $tags) {
            $this->console->writeLine('You should provide tags');
            return;
        }

        $tags   = explode(',', $tags);
        $result = false;
        try {
            $result = $this->getCacheService()->clearByTags($tags);
        } catch (UnsupportedAdapterException $exception) {
            $this->console->writeLine($exception->getMessage());
        }

        $this->console->writeLine(
            sprintf(
                'Cache invalidation %s',
                $result ? 'succeeded' : 'failed'
            )
        );
    }
833243
protected function clearCacheFolder($folder)
    {
        $path = WINDWALKER_CACHE . '/' . $folder;

        if (is_dir($path)) {
            Folder::delete($path);
        } elseif (is_file($path)) {
            File::delete($path);
        }

        $this->out(sprintf('[Deleted] <info>%s</info>', $path));
    }
1308114
protected function clearToken($token)
    {
        $token = $this->tokenize($token);
        $this->checkToken($token);
        $this->tokens[$token] = array();
    }
80153
public function shouldLogChange($action)
    {
        if ($action != 'deleted'
            && count($this->getDirty()) == 1
            && $this->isDirty('remember_token')) {
            return false;
        }
        return parent::shouldLogChange($action);
    }