file isExist

@param  $cacheName(string)
@param  $cacheDir(string)
@return boolean
762543
public function isExist($cacheName, $cacheDir = false)
    {
        $cacheDir = $cacheDir == false ? self::$cacheDir : $cacheDir;
        $dir = $cacheDir."/".$cacheName;

        return file_exists($dir);
    }
402069
private function _checkCacheDir()
    {
        if (!is_dir($this->getCachePath()) && !mkdir($this->getCachePath(), 0775, true)) {
            throw new \Exception('Unable to create cache directory ' . $this->getCachePath());
        } elseif (!is_writable($this->getCachePath())) {
            throw new \Exception($this->getCachePath() . ' must be readable and writeable');
        }
        return true;
    }
576753
public function offsetExists($offset)
    {

        list($url, $key) = $this->fileUrlAndKey($offset);

        if ($key) {
            return $this->getOrCreateStorage($url)->offsetExists($key);
        }

        if (isset($this->purgeQueue["$url"])) {
            return false;
        }

        if ($storage = $this->getStorageIfLoaded($url)) {
            return true;
        }

        return $this->filesystem->exists($url);

    }
474754
public function exists($key) {

		$files = glob(Path :: get('cache-shared') . $this -> generateName($key));

		if(true === is_array($files) && count($files) > 0) {

			$file 		= new File($files[0]);
			$expiration = $this -> extractExpiration($file);

			if($expiration -> time >= time()) {
				return true;
			}

			$file -> delete();
		}

		return false;
	}
458280
public function fileExists($containerName, $fileName, $relativePath)
    {
        return $this->fileUploadFacade->fileExists($containerName, $fileName, $relativePath);
    }
771775
protected function removeCache($cachename){
        $file = $this->cachedir . $cachename . '.cache';
        if ( is_file($file) ) {
            @unlink($file);
        }
        return true;
    }
1203424
public function isCached($key)
    {
        if ($cachedData = $this->loadCache()) {
            if (isset($cachedData[$key])) {
                if (!$this->isExpired($cachedData[$key]['time'], $cachedData[$key]['expire'])) {
                    return true;
                }
            }
        }
        return false; // If cache file doesn't exist or cache is empty or key doesn't exist in array, key isn't cached
    }
116757
public function exists($filename)
    {
        $listing = $this->listDirectoryContents();

        $dirname_info = array_filter($listing, function ($item) use ($filename) {
            return $item['name'] === $filename;
        });

        return count($dirname_info) !== 0;
    }
615293
public function TrustedShopsImage_CacheCheck($filename_cache, $timeout = 10800)
    {
        $bRet = false;
        if (file_exists($filename_cache)) {
            $timestamp = filemtime($filename_cache);
            // Seconds
            if (mktime() - $timestamp < $timeout) {
                $bRet = true;
            } else {
                $bRet = false;
            }
        } else {
            $bRet = false;
        }

        return $bRet;
    }
306239
public function checkForCacheFile()
    {
        // first check if we can create a file
        if (!$this->canCreateCacheFile()) {
            return;
        }
        $cacheEntry = HtmlCacheCache::findOne(['uri' => $this->uri, 'siteId' => $this->siteId]);

        // check if cache exists
        if ($cacheEntry) {
            $file = $this->getCacheFileName($cacheEntry->uid);
            if (file_exists($file)) {
                // load cache - may return false if cache has expired
                if ($this->loadCache($file)) {
                    return \Craft::$app->end();
                }
            }
        }
        // Turn output buffering on
        ob_start();
    }
514158
public function directoryExists(string $name)
    {
        if(!$this->_isLoaded) {
            $this->load();
        }

        return in_array($name, $this->_directories);
    }
265302
public function file_cache($key,$value=null,$expire=70,$prefix=''){
        if (empty($key)) return false;
        $option = array(
            'type'=>'File',
            'prefix'=>$prefix,
            'path'=>CACHE_PATH,
        );
        $expire = empty($expire)?0:$expire;
        $cache = \think\Cache::connect($option);
        if ($value){
            return $cache->set($key,$value,$expire);
        }else{
            return $cache->rm($key);
        }
    }
1015097
protected function verifyDirectoryExistence($base, $cacheDir)
    {
        if (is_dir("$base/$cacheDir")) {
            return;
        }

        $folder_path = explode('/', $cacheDir);
        foreach ($folder_path as $element) {
            $base .= '/' . $element;
            if (!is_dir($base)) {
                mkdir($base, 0755, true);
                chmod($base, 0755);
            }
        }
    }
313762
protected function filesExist($dir, $file)
    {
        if (!file_exists($dir)) {
            return false;
        }

        $full_path = rtrim($dir, DS) . DS . ltrim($file, DS);

        try {
            $files = glob($full_path);

            $files_found = ! empty($files);
        } catch (\Exception $ex) {
            Tlog::getInstance()->addError($ex->getMessage());

            $files_found = false;
        }

        return $files_found;
    }
1215973
function fileExists(fileName) {
        if (!fileName) {
            return false;
        }

        var filePath = PathUtils.resolveInRoot(outputFolder, fileName);
        return fs.existsSync(filePath);
    }
357237
public function fileExists($filename)
    {
        if ($this->mediaDirectory->isFile($filename)) {
            return true;
        } else {
            return $this->coreFileStorageDatabase->saveFileToFilesystem(
                $this->mediaDirectory->getAbsolutePath($filename)
            );
        }
    }
170730
public static function has( $key )
	{
		$cache = self::instance();
		if ( $cache ) {
			return $cache->isExisting( $key );
		}
		return false;
	}