Clear cache directory.

@return bool
430770
public function clearCache() {
		$cachePath = Yii::getAlias('@webroot/' . $this->cachePath);
		//remove dir
		FileHelper::removeDirectory($cachePath);
		//creat dir
		return FileHelper::createDirectory($cachePath, 0755);
	}
1038246
public function clear() {
		if ( ! $this->enabled ) {
			return false;
		}

		$finder = $this->get_finder();

		foreach ( $finder as $file ) {
			unlink( $file->getRealPath() );
		}

		return true;
	}
990962
public function clear()
    {
        foreach(FileUtil::enumAll($this->savePath) as $fileName)
        {
            if(is_file($fileName))
            {
                unlink($fileName);
            }
            else if(is_dir($fileName))
            {
                rmdir($fileName);
            }
        }
    }
1036706
public function clearAssetCache()
    {
        foreach ($this->cachedFiles as $hash => $fileData) {
            if (!$this->fileBackend->isWritable($fileData['file'])) {
                continue;
            }
        
            $this->fileBackend->deleteFile($fileData['file']);
        }
        
        $this->cachedFiles = array();
        $this->saveAssetsCache();
    }
765097
public function clear()
    {
        try {
            $this->_repository
                    ->createQueryBuilder('c')
                    ->delete()
                    ->where('1 = 1')
                    ->getQuery()
                    ->execute();
            $this->resetCacheEntity();
        } catch (\Exception $e) {
            $this->log('warning', sprintf('Enable to clear cache : %s', $e->getMessage()));

            return false;
        }

        return true;
    }
1134761
public function clear() {
        $loops = $this->getLoops();

        if($loops->getService("cache")->flushAll()) {
            $loops->getService("logger")->info("Clearing cache was successful.");
            return 0;
        }
        else {
            $loops->getService("logger")->err("Clearing cache failed.");
            return 1;
        }
    }
225515
public static function purgeCache()
	{
		$cacheDirPaths = static::getCacheDirPaths();
		if (is_dir($cacheDirPaths['fullPath'])) {
			foreach (scandir($cacheDirPaths['fullPath']) as $file) {
				if (substr($file, -4) === '.php') {
					$file = new \File($cacheDirPaths['path'] . '/' . $file);
					$file->delete();
				}
			}
		}
	}
507891
public function flush()
    {
        if (! $this->files->isDirectory($this->directory)) {
            return false;
        }

        foreach ($this->files->directories($this->directory) as $directory) {
            if (! $this->files->deleteDirectory($directory)) {
                return false;
            }
        }

        return true;
    }
1256769
public function clearCache()
    {
        if ($this->Using === 'APCu') {
            return $this->Modified = apcu_clear_cache();
        }
        if ($this->Using === 'Memcached') {
            return ($this->WorkingData->flush() && ($this->Modified = true));
        }
        if ($this->Using === 'Redis') {
            return ($this->WorkingData->flushDb() && ($this->Modified = true));
        }
        if ($this->Using === 'PDO') {
            $PDO = $this->WorkingData->prepare(self::clearQuery);
            if ($PDO !== false && $PDO->execute()) {
                return ($PDO->rowCount() > 0 && $this->Modified = true);
            }
            return false;
        }
        if (is_array($this->WorkingData)) {
            $this->WorkingData = [];
            return $this->Modified = true;
        }
        return false;
    }
523579
public void clearCache() {
        File cacheDir = getCacheDir();
        if (cacheDir.exists()) {
            File[] files = cacheDir.listFiles();
            if (files != null) {
                for (File child : files) {
                    deleteFilesRecursively(child);
                }
            }
        }
    }
58541
public function clear()
    {
        $directory = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator($this->path),
            \RecursiveIteratorIterator::SELF_FIRST
        );

        $cacheIterator = new \RegexIterator($directory, '/^.+\.cache/i', \RecursiveRegexIterator::GET_MATCH);

        $isCleared = false;

        foreach ($cacheIterator as $cacheFiles) {
            foreach ($cacheFiles as $cacheFile) {
                if (false === ($isCleared = unlink($cacheFile))) {
                    return $isCleared;
                    break;
                }
            }
        }

        return $isCleared;
    }
549976
function clearDir()
    {
        $dir = _WWW.$this->patch.$this->id.'/';
        foreach (scandir($dir) as $file) {
            if ($file == '.' || $file == '..') {
                continue;
            }
            unlink($dir.$file);
        }
    }
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);
            }
        }
    }
85632
public function clearLogFiles()
    {
        $dir = $this->log_path;
        $files = scandir($dir);
        foreach ($files as $file) {
            if ($file == "." || $file == ".." || is_dir($dir . $file)) {
                continue;
            }
            
            $pi = pathinfo($dir . $file);
            
            if (empty($pi["extension"]) || strtolower($pi["extension"]) != "log") {
                continue;
            }
            
            if (!$this->clearLogFile($file)) {
                return false;
            }
        }
        
        return true;
    }
979403
public function clear()
    {
        $finder = new Finder();

        /** @var \Symfony\Component\Finder\SplFileInfo $file */
        foreach ($finder->files()->in($this->cacheDir)->depth(0)->name(self::CACHE_PATH_REGEX) as $file) {
            @unlink($file->getRealPath());
        }
    }
196819
public function clearCache()
    {
        $result = $this->getContainer()->get('fileManager')->removeInDir($this->cachePath);

        if ($result != true) {
            throw new Exceptions\Error("Error while clearing cache");
        }

        $this->updateCacheTimestamp();

        return $result;
    }
179886
def clearCache():
		
		if os.path.exists(CachedDataManager._cacheDir()) == True:
			shutil.rmtree(CachedDataManager._cacheDir())