Flushes the whole cache for a specific storage driver or just a part of it when $section is set
(might not work with all storage drivers), defaults to the default storage driver

@param   null|string
@param   null|string
@return  bool
329427
public static function delete_all($section = null, $driver = null)
	{
		$cache = static::forge('__NOT_USED__', $driver);
		return $cache->delete_all($section);
	}
383465
public function has(string $section, string $key) : bool
    {
        return $this->cacheStore->has($section . $this->sectionKeyDelimiter . $key);
    }
292768
public function addSection(PHPRtfLite_Container_Section $section = null)
    {
        if ($section === null) {
            $section = new PHPRtfLite_Container_Section($this);
        }

        $this->_sections[] = $section;

        return $section;
    }
184906
public function has($section, $key): bool
    {
        $setting = $this->get($section, $key);

        return !empty($setting);
    }
814275
public function clear()
    {
        $cleared = false;
        try {
            /* @todo Not at all sure about this... do we really want to flush()? What happens if the storage supports
            /*       namespaces, but none has been provided? */
            $options = $this->storage->getOptions();
            $namespace = $options->getNamespace();
            if ($this->storage instanceof ClearByNamespaceInterface && $namespace) {
                $cleared = $this->storage->clearByNamespace($namespace);
            } elseif ($this->storage instanceof FlushableInterface) {
                $cleared = $this->storage->flush();
            } else {
                throw new CacheException(sprintf("Storage %s does not support clear()", get_class($this->storage)));
            }
        } catch (Exception\InvalidArgumentException $e) {
            throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);

        } catch (Exception\ExceptionInterface $e) {
            throw new CacheException($e->getMessage(), $e->getCode(), $e);
        }

        return $cleared;
    }
181615
protected function lookup($section, $key=null) {
    $lookupKey = strtolower($section).':'.strtolower($key);
    if (isset($this->lookupTable[$lookupKey])) {
      return $this->lookupTable[$lookupKey];
    }
    return null;
  }
554843
public static function SaveCache($CacheName) {
      if ($CacheName != 'locale') return;
      
      if (!array_key_exists($CacheName,self::$Caches)) 
         return FALSE;
      
      $UseCache = (Gdn::Cache()->Type() == Gdn_Cache::CACHE_TYPE_MEMORY && Gdn::Cache()->ActiveEnabled());
      if ($UseCache) {
         $CacheKey = sprintf(Gdn_LibraryMap::CACHE_CACHE_NAME_FORMAT, $CacheName);
         $Stored = Gdn::Cache()->Store($CacheKey, self::$Caches[$CacheName]['cache']);
      } else {
         $FileName = self::$Caches[$CacheName]['ondisk'];
         $CacheContents = "";
         foreach (self::$Caches[$CacheName]['cache'] as $SectionTitle => $SectionData) {
            $CacheContents .= "[{$SectionTitle}]\n";
            foreach ($SectionData as $StoreKey => $StoreValue) {
               $CacheContents .= "{$StoreKey} = \"{$StoreValue}\"\n";
            }
         }
         try {
            Gdn_FileSystem::SaveFile(PATH_CACHE.DS.$FileName, $CacheContents, LOCK_EX);
         }
         catch (Exception $e) {}
      }
   }
441094
public function doCache($sectionKey, &$section)
    {
        do_action("before_theme_do_cache", $sectionKey);

        $cacheKey = $this->getCacheKey($sectionKey, $section);

        # Get cache file absolute path
        $file = $this->getCacheFile($cacheKey);

        # Start buffering output
        ob_start();

        # Render the template
        $section->init();
        $section->render();

        $cacheConfig = $this->getConfig("cache");

        # Minify the output
        if ($cacheConfig["minify"]):
            $cache = str_replace(["  ", "\n", "\t"], ["", "", ""], ob_get_clean());
        else:
            $cache = ob_get_clean();
        endif;

        # Write output to memory or file
        if ($cacheConfig["type"] == "wp_cache"):
            wp_cache_add(basename($file), $cache, "sections_cache", $cacheConfig["lifetime"]);
        else:
            # Delete file if already exists
            if (file_exists($file)):
                unlink($file);
            endif;

            # Prevents creating empty cache file
            if (!empty($cache) || $cache != ""):
                file_put_contents($file, $cache);
            endif;
        endif;

        do_action("after_theme_do_cache", $cache);

        # Return output
        return $cache;
    }
359617
public static function flush()
    {
        $instance = self::getInstance();
        $glob = @glob(self::cacheDir() . $instance->_options['file_name_prefix'] . '--*');

        if (empty($glob)) {
            return false;
        }

        foreach ($glob as $v) {
            $fileName = basename($v);
            $id = $instance->_fileNameToId($fileName);
            $instance->delete($id);
        }
        return true;
    }
1046334
public static function InSection($Section) {
      $Section = (array)$Section;
      foreach ($Section as $Name) {
         if (isset(self::$_Section[$Name]))
            return TRUE;
      }
      return FALSE;
   }
1363740
public function flush()
    {
        if (!$this->hasConnection()) {
            // @codeCoverageIgnoreStart
            return false;
            // @codeCoverageIgnoreEnd
        }

        try {
            return $this->memcache->flush();
            // @codeCoverageIgnoreStart
        } catch (\Exception $e) {
        }

        return false;
        // @codeCoverageIgnoreEnd
    }
209569
public function actionClear()
    {
        $cachesInput = func_get_args();

        if (empty($cachesInput)) {
            throw new Exception('You should specify cache components names');
        }

        $caches = $this->findCaches($cachesInput);
        $cachesInfo = [];

        $foundCaches = array_keys($caches);
        $notFoundCaches = array_diff($cachesInput, array_keys($caches));

        if ($notFoundCaches) {
            $this->notifyNotFoundCaches($notFoundCaches);
        }

        if (!$foundCaches) {
            $this->notifyNoCachesFound();
            return ExitCode::OK;
        }

        if (!$this->confirmClear($foundCaches)) {
            return ExitCode::OK;
        }

        foreach ($caches as $name => $class) {
            $cachesInfo[] = [
                'name' => $name,
                'class' => $class,
                'is_flushed' => $this->canBeCleared($class) ? $this->app->get($name)->clear() : false,
            ];
        }

        $this->notifyCleared($cachesInfo);
    }
250321
public function startSection($section, $default = null)
    {
        $context = $this->_context;

        if ($default === null) {
            ob_start();
            ob_implicit_flush(false);
            $context->stack[] = $section;
        } else {
            $context->sections[$section] = $default;
        }
    }
62312
public function flushMemberCache($memberIDs = null)
    {
        $cache = $this->getHintsCache();

        if (!$memberIDs) {
            $cache->clear();
            return;
        }

        foreach ($memberIDs as $memberID) {
            $key = $this->generateHintsCacheKey($memberID);
            $cache->delete($key);
        }
    }
1010560
public function flushAction()
    {
        /** @var \Zend\Cache\Storage\Adapter\Memory $cache */
        $cache = $this->serviceLocator->get(\Rcm\Service\Cache::class);
        $cache->flush();
    }
1014820
public function flushMemberCache($memberIDs = null)
    {
        if (!$this->cacheService) {
            return;
        }

        // Hard flush, e.g. flush=1
        if (!$memberIDs) {
            $this->cacheService->clear();
        }

        if ($memberIDs && is_array($memberIDs)) {
            foreach ([self::VIEW, self::EDIT, self::DELETE] as $type) {
                foreach ($memberIDs as $memberID) {
                    $key = $this->generateCacheKey($type, $memberID);
                    $this->cacheService->delete($key);
                }
            }
        }
    }
666484
public function section($section, $position = null)
    {
        if (is_string($section)) {
            $section = new FormSection($section);
        }

        return null !== $position ? $this->insert($section, $position) : $this->push($section);
    }