Checks if a file is present in a folder on the server

@param string $path The file or dir relative or full path
@return bool
774303
public function exists(string $path){
    if ( !empty($path) ){
      $dir = dirname($path);
      $ext = \bbn\str::file_ext($path);
      $file = basename($path);
      if ( \is_array($files = $this->listFiles($dir)) ){
        foreach ( $files as $f ){
          if ( $f['basename'] === $file ){
            return true;
          }
        }
      }
    }
    return false;
  }
1010911
public function deleteFile($path)
    {
        $path = $this->cleanFolder($path);
        if (!$this->disk->exists($path)) {
            $this->errors[] = 'File does not exist.';

            return false;
        }

        return $this->disk->delete($path);
    }
317728
private function checkPath($path)
    {
        return file_exists($path) && is_readable($path) && ($resources = scandir($path)) && (count($resources) > 2);
    }
262745
protected function checkIfPathToFileCheckPrefix(string $path): bool
    {
        if (file_exists($path) === true) {
            return substr($path, 0, 7) === 'file://';
        }

        return true;
    }
1208640
public static function checkFolderPath($path){
      $path = substr($path,strpos($path,'/')+1);
      $path = explode('/',trim($path,'/'));
        foreach ( $path as $dir ){
          if ( !empty($dir) && !CKFinder_Connector_Utils_FileSystem::checkFolderName($dir) ){
            return false;
          }
        }

        return true;
    }
1205412
function is_dir($path) {

        // be sure path is utf-8
        $item = $this->gpi($path);

        if ($item === false) {
            return false;
        } else {
            return ($item['resourcetype'] == 'collection');
        }
    }
886433
public function has(string ...$path): bool
    {
        try {
            $this->get(...$path);
        } catch (ConfigKeyNotFoundException $e) {
            return false;
        }

        return true;
    }
369184
protected function checkPath($path)
    {
        foreach ($this->chroots as $chroot) {
            if (StringHelper::contains($path, $chroot)) {
                return true;
            }
        }
        return false;
    }
1050780
protected function verifyPath($path){
		if (file_exists($path)) return true;
			
		if (mkdir($path, 0777, true)) return true;
				
		return false;
	}
1240093
public static function mkdir($path): bool
    {
        if (is_dir($path)) {
            return true;
        }

        if (dirname($path) && !is_dir(dirname($path))) {
            self::mkdir(dirname($path));
        }

        try {
            mkdir($path);

            return true;
        } catch (Throwable $ex) {
            return false;
        }
    }
327152
private static function checkSavePath($path) {
            if (is_string($path)) {
                $dir = dirname($path);

                return file_exists($dir) && is_writeable($dir);
            } elseif (is_resource($path)) {
                return true;
            }

            return false;
        }
3278
public function isEmpty(string $path): bool
	{
		if(is_dir($path))
		{
			return (new FilesystemIterator($path))->valid() === false;
		}

		return filesize($path) === 0;
	}
1130116
public function isSubdir($path)
    {
        foreach ($this->storage as $member) {
            if ($member->isSubdirOf($path)) {
                return true;
            }
        }

        return false;
    }
217404
public function isDirExcluded ($path)
	{
		foreach ($this->excludedDirs as $needle)
		{
			if (empty($needle)) {
				continue;
			}

			$needleLen = strlen($needle);
			$pathChunk = substr($path, -$needleLen, $needleLen);

			// check if matches end of $path
			if ($pathChunk == $needle) {
				return true;
			}
		}
		return false;
	}
623533
public function parseFile(string $path): bool
    {
        static::$iteration++;
        if (static::$iteration > 10) exit();
        if (in_array($path, $this->parsed_files)) {
            // The file has already been parsed, don't parse it again
            return true;
        }
        $this->parsed_files[] = $path;
        if (is_readable($path)) {
            $array = include($path);
        } else {
            if (isset(Core::i()->log)) {
                Core::i()->log->debug('Config path ' . $path . ' could not be read.');
            }
            return false;
        }
        if (!is_array($array)) {
            if (isset(Core::i()->log)) {
                Core::i()->log->debug('Config file ' . $path . ' is not an array.');
            }
            return false;
        }
        $this->parseArray($array);
        return true;
    }
319279
protected function isDirectory($path)
    {
        $location = $this->applyPathPrefix($path);

        if (empty($location)) {
            return true;
        }

        try {
            $file = $this->share->stat($location);
        } catch (NotFoundException $e) {
            return false;
        }

        return $file->isDirectory();
    }
646632
public static function isFile($path)
    {
        if (is_file($path)) {
            if (strstr(PHP_OS, 'WIN')) {
                if (basename(realpath($path)) != basename($path)) {
                    return false;
                }
            }

            return true;
        }

        return false;
    }