Flush the entire cache or a cache section.

@param string $pSection
@return File
161289
public function flush($pSection = '')
    {
        $info = apcu_cache_info();
        if (! $info or ! isset($info['cache_list'])) {
            return $this;
        }

        foreach ($info['cache_list'] as $cacheFile) {
            if (($pSection and
                strpos($cacheFile['key'], self::_getKeyPrefix() . $pSection . static::SECTION_DELIMITER) === 0)
                or (! $pSection
                and strpos($cacheFile['key'], self::_getKeyPrefix()) === 0)) {
                apcu_delete($cacheFile['key']);
            }
        }

        return $this;
    }
1044179
public function flush($type) {
		if (isset($this->cache[$type])) $this->cache[$type]=array();
		return $this;
	}
360402
public function setSection($section)
    {
        $this->section = $section;
        if($section) {
        	$section->getSectionConfig()->setPage($this);
        }

        return $this;
    }
892410
private function initializeCache($section) {
    if (!isset($this->cache[$section])) {
      $file = $this->getCacheFile($section);
      if (file_exists($file)) {
        $this->cache[$section] = unserialize(file_get_contents($file));
      }
      else {
        $this->cache[$section] = [];
      }
    }
  }
1186826
public function flushAll()
    {
        $mask = '*' . self::CACHE_FILE_SUFFIX;

        foreach (glob($this->basePath . $mask) as $cacheFilePath) {
            if (!unlink($cacheFilePath)) {
                throw new \RuntimeException("Failed to delete cache file '{$cacheFilePath}'.");
            }
        }
    }
1050983
public function flush() {

		if(false !== $this -> file -> getExists()) {

			if(false === is_writable($this -> file -> getBasepath())) {
				return trigger_error(sprintf('File "%s" passed to %s() is not writable', $this -> file -> getBasepath(), __METHOD__), E_USER_ERROR);
	    	}

			$fh = fopen($this -> file -> getBasepath(), 'w');
			
			if(flock($fh, LOCK_EX)) {

    			ftruncate($fh, 0);
			    fflush($fh);
    			flock($fh, LOCK_UN);
    		}

			fclose($fh);

			$this -> refresh();
		}

		return $this;
	}
520159
public function flush()
    {
        $count = xcache_count(XC_TYPE_PHP);
        for ($i = 0; $i < $count; $i++) {
            // XCache PHP cache temizle.
            xcache_clear_cache(XC_TYPE_PHP, $i);
        }

        $count = xcache_count(XC_TYPE_VAR);
        for ($i = 0; $i < $count; $i++) {
            // XCache degisken cache temizle.
            xcache_clear_cache(XC_TYPE_VAR, $i);
        }

        return true;
    }
1337046
public function flush() {
		$pattern = $this->getCachePath() . DIRECTORY_SEPARATOR . $this->prefix . '_*';
		
		if (self::isExecAvailable()) {
			exec('rm ' . $pattern);
			return true;
		}
		
		$list = glob($pattern);
		
		if ($list === false) {
			return false;
		}
		
		if (empty($list)) {
			return true;
		}
		
		$result = true;
		
		foreach ($list as $path) {
			if (! unlink($path)) {
				$result = false;
			}
		}
		
		return $result;
	}
254938
public function write_cache($cache_path, $content)
    {
        $cache_content = json_encode($content);
        $cache_size = strlen($cache_content);

        $temp = tempnam($this->params['path'], 'temp');
        if (!($f = @fopen($temp, 'wb'))) { 
            $temp = $this->params['path'].'/'.uniqid('temp'); 
            if (!($f = @fopen($temp, 'wb'))) { 
                throw new WriteException('Unable to write temporary file '.$temp);
            }
        }

        fwrite($f, $cache_content); 
        fclose($f); 

        if (!rename($temp, $cache_path)) { 
            unlink($cache_path); 
            rename($temp, $cache_path); 
        } 

        chmod($cache_path, $this->params['write_perms']); 

        return $cache_size;
    }
643441
public function flushCaches(bool $flushPersistentCaches = false): void
    {
        $this->createAllCaches();
        /** @var FrontendInterface $cache */
        foreach ($this->caches as $identifier => $cache) {
            if (!$flushPersistentCaches && $this->isCachePersistent($identifier)) {
                continue;
            }
            $cache->flush();
        }
        $this->configurationManager->flushConfigurationCache();
        $dataTemporaryPath = $this->environment->getPathToTemporaryDirectory();
        Files::unlink($dataTemporaryPath . 'AvailableProxyClasses.php');
    }
618398
public function flush(){
        $content = implode('',$this->_contentArray);
        $saveToFileRes = file_put_contents($this->_filleFullName, $content);
        return $saveToFileRes;
    }
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;
    }
1242632
public function flush()
    {
        $n = 0;
        $children = [];
        foreach ($this->children as $k => $child) {
            if ($child !== null) {
                $child->setIndex($n);
                $child->setParent($this);
                $children[] = $child;
                ++$n;
            }
        }

        $this->children = $children;

        return $this;
    }
869052
public function flush()
    {
        if (file_exists($this->CacheFolder . "/" . $this->CacheIndex)) {
            unlink($this->CacheFolder . "/" . $this->CacheIndex);
            touch($this->CacheFolder . "/" . $this->CacheIndex);
        }
        if (file_exists($this->CacheFolder . "/" . $this->CacheDB)) {
            unlink($this->CacheFolder . "/" . $this->CacheDB);
            touch($this->CacheFolder . "/" . $this->CacheDB);
        }
    }
1231141
private function updateSections()
    {
        $sections = $this->repo->findAll();
        foreach ($sections as $section) {
            PageListener::setSectionHasChildren($this->em, $section);
        }
        $this->em->flush();

        return $this;
    }
716711
public function flush()
	{
		$index	= new DirectoryIterator( $this->path );
		$number	= 0;
		foreach( $index as $entry )
		{
			if( $entry->isDot() || $entry->isDir() )
				continue;
			if( substr( $entry->getFilename(), -7 ) == ".serial" )
				$number	+= (int) @unlink( $entry->getPathname() );
		}
		$this->data	= array();
		return $number;
	}
684095
public function flush($delay = 0) {
    $result = $this->memcache->flush();
    $this->result_code = $result ? self::RES_SUCCESS : self::RES_NOTSTORED;
    return $result;
  }