Returns true: style File exists in the specified path
otherwise, false
@param string $filepath
@return bool
505098
protected function getFilesStatus(string $filepath) : bool
    {
        $status     = false;
        $path       = explode('/', $filepath);

        if (empty($path[0])) {
            // Internal Path
            $site           = $path[1];
            $acceptables    = ['css', 'CSS'];
            $filename       = $path[count($path) - 1];

            // check if style file has correct extension
            $nameParts = explode('.', $filename);
            if (!in_array($nameParts[count($nameParts) - 1], $acceptables)) {
                return false;
            }

            // Getting the subfolder(s)
            $subfolders     = '';
            for ($i = 2; $i <= count($path) - 2; $i++) {
                $subfolders .= $path[$i] . '/';
            }

            $fullPath = $_SERVER['DOCUMENT_ROOT'] . '/../module/MelisSites/' . $site . '/public/' . $subfolders . $filename;
            if (is_file($fullPath) && file_exists($fullPath)) {
                return true;
            }

        } else {
            // External Path
            if (filter_var($filepath, FILTER_VALIDATE_URL)) {
                $header_response = get_headers($filepath, 1);
                if (strpos($header_response[0], "200") !== false) {
                    // File exists
                    return true;
                }
            }
        }

        return $status;
    }
22658
protected function _ensurePathExistence($filePath) {
        $folders = explode(DIRECTORY_SEPARATOR, $filePath);
        // discard the actual file
        array_pop($folders);
        $path = implode(DIRECTORY_SEPARATOR, $folders);
        if (file_exists($path)) {
            return;
        }
        mkdir($path, 0777, true);
    }
609107
public function hasDir($path)
    {
        $meta = $this->getMetadata($path);
        return ($meta && isset($meta['hasdir'])) ? $meta : [
            'hasdir' => true
        ];
    }
924813
public static function countLines($filepath)
	{
		$return = false;
		if (file_exists($filepath)) {
			$handle = fopen($filepath, 'r');
			if ($handle) {
				$return = 0;
				while (!feof($handle)) {
					$chunk = fgets($handle, 4096);
					$chunk_count = substr_count($chunk, "\n");
					$return = $return + $chunk_count;
				}
				fclose($handle);
			}
		}
		return $return;
	}
551800
public function exists($path)
    {
        $metadata = $this->dropbox->getMetadata($this->pathRoot.$path);
        return is_array($metadata) && isset($metadata['path']);
    }
1342256
public function has($path)
    {
        $location = $this->applyPathPrefix($path);

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

        return true;
    }
257152
protected function readCacheFile($filePath)
    {
        if (file_exists($filePath)) {
            /** @noinspection PhpIncludeInspection */
            $map = require $filePath;
            if (is_array($map)) {
                $this->map = array_merge($this->map, $map);
            }

            return true;
        }

        return false;
    }
14582
public static function isDir($path)
    {
        return (self::isPhar($path) === true) ? file_exists($path) : is_dir($path);
    }
1166392
public function loadFile($filePath)
    {
        if ($filePath instanceof \SplFileInfo) {
            $filePath = $filePath->getRealPath();
        }

        if (isset($this->sourceFileDirectory)) {
            if (is_file($this->sourceFileDirectory . $filePath)) {
                $filePath = $this->sourceFileDirectory . $filePath;
            }
        }

        if (is_file($filePath)) {
            $this->sourceFilePath = realpath($filePath);
            $this->sourceFileDirectory = pathinfo($this->sourceFilePath, PATHINFO_DIRNAME) . DIRECTORY_SEPARATOR;

            return $this->loadString(file_get_contents($filePath));
        }

        return false;
    }
659337
public function loadFile($filePath)
    {
        if ($filePath instanceof \SplFileInfo) {
            $filePath = $filePath->getRealPath();
        }

        if (is_file($filePath)) {
            return $this->loadString(file_get_contents($filePath));
        }

        return false;
    }
494078
public static function checkDirExistOrCreate(string $filePath, string $modeMask = '0755') : bool
    {
        if (self::isDirSafe($filePath)) {
            return true;
        }

        //controllo adesso che non sia un file
        if (FileHelper::fileExistsSafe($filePath)) {
            return false;
        }

        return mkdir($filePath, $modeMask, true) && self::isDirSafe($filePath);
    }
495457
public static function exists($path, $inSensitive = false)
    {
        $exists = is_file($path);

        if (!$inSensitive) {
            return $exists;
        }

        if (!$exists) {
            $lowerfile = strtolower($path);

            foreach (glob(dirname($path) . '/*') as $file) {
                if (strtolower($file) === $lowerfile) {
                    return true;
                }
            }
        }

        return false;
    }
463617
private function isInternalRoute($filepath)
    {
        foreach ($this->internalRouteDirPattern as $pattern) {
            if (preg_match($pattern, $filepath)) {
                return true;
            }
        }

        $filename = basename($filepath);
        foreach ($this->internalRouteFilePattern as $pattern) {
            if (preg_match($pattern, $filename)) {
                return true;
            }
        }

        return false;
    }
1047299
public static boolean checkIfFileExists(String filePath) {
        File file = new File(filePath);// getSDCardPath(), filePath);
        return (file.exists() ? true : false);
    }
966880
function delete_file($filepath)
	{
		if ( ! $this->_is_conn())
		{
			return false;
		}

		$result = @ftp_delete($this->_conn_id, $filepath);

		if ($result === false)
		{
			if ($this->_debug == true)
			{
				throw new \FtpFileAccessException('Unable to delete');
			}
			return false;
		}

		return true;
	}
583445
public static boolean exist(String filePath) {

        File f = new File(filePath);

        if( !f.isFile() ) {
            return false;
        }

        return true;
    }
176076
protected function isAbsolutePath($filePath)
    {
        if ($filePath === null || $filePath === '') {
            return false;
        }
    
        if ($filePath[0] === DIRECTORY_SEPARATOR || preg_match('~\A[A-Z]:(?![^/\\\\])~i', $filePath) > 0) {
            return true;
        }
    
        return false;
    }