hasRoutingConfig
Check if the routing file exists and needs to be parsed.

@return bool $has_config
420810
protected function hasRoutingConfig()
    {
        $has_config = false;

        if ($this->locator) {
            try {
                $routing_file = $this->locator->locate($this->getRoutingFilename());

                if (filesize($routing_file) > 0) {
                    $this->debug(sprintf('hasRoutingConfig: Located Routing File %s', $routing_file));
                    $has_config = true;
                }
            } catch (\InvalidArgumentException $e) {}
        }

        return($has_config);
    }
318070
public function loadCachedConfig(array &$config)
    {
        $cacheFilePath = $this->config->getCacheFile();

        if (!file_exists($cacheFilePath)) {
            return false;
        }

        $cachedConfig = include $cacheFilePath;

        if (!is_array($cachedConfig)) {
            return false;
        }

        if (!isset($config['routes'])) {
            $config['routes'] = array();
        }

        $this->merger->merge($cachedConfig, $config['routes']);

        return true;
    }
1145148
public static function getCanPurge(): bool
    {
        if (!isset(self::$canPurge)) {
            /** @var ConfigModel $settings */
            $config = ImagerService::getConfig();
            
            // No Imgix config, no purging
            $imgixConfigArr = $config->getSetting('imgixConfig');
            if (!$imgixConfigArr || !\is_array($imgixConfigArr) || empty($imgixConfigArr)) {
                self::$canPurge = false;
                return false;
            }
            
            // Make sure there's at least one profile that is not a web proxy and that is not excluded from purging
            $hasApiKey = !!$config->getSetting('imgixApiKey');
            $hasPurgableProfile = false;
            foreach ($imgixConfigArr as $profile => $imgixConfig) {
                $imgixConfig = new ImgixSettings($imgixConfig);
                $hasApiKey = $hasApiKey || !!$imgixConfig->apiKey;
                $hasPurgableProfile = $hasPurgableProfile || (!$imgixConfig->sourceIsWebProxy && !$imgixConfig->excludeFromPurge);
                if ($hasApiKey && $hasPurgableProfile) {
                    break;
                }
            }
            
            self::$canPurge = $hasApiKey && $hasPurgableProfile;
        }
        
        return self::$canPurge;
    }
131358
public function matchRoute()
	{

		//check if this route key exists
		$RouteMatch = (ArrayHelper::KeyExists($this->UrlParserObjectInstance->getController(), $this->definedRoutesArray)->get()) ? true : false;

		//a matching route was found, set params and return true
		if($RouteMatch)
		{
			//set the value of the routeName
			$this->routeName = $this->UrlParserObjectInstance->getController();

			//get metaData for this route
			$this->routeMetaData = $this->definedRoutesArray[$this->UrlParserObjectInstance->getController()];

			//return true
			return true;

		}

		//not matching route was found, return fasle
		else{

			//return false
			return false;

		}

	}
875564
public function configHas($parameter)
    {
        if (empty($this->config)) {
            return false;
        }

        return $this->config->has($parameter);
    }
788480
protected function validateConfig()
    {
        $this->validateUrls();
        $this->validateRefreshInterval();
        $this->validateCacheFile();
        $this->validateFilePath();
        $this->validateParser();

        return true;
    }
1085012
protected function isConfig($path)
    {
        if ($this->config()->isConfigFile($path)) {
            $this->config()->invalidateConfig();

            $this->loader->loadEverything();

            return true;
        }

        return false;
    }
1325850
final protected function hasConfigs($config = null)
    {
        if (null !== $config) {
            return array_key_exists($config, self::$_configs);
        }

        return count(self::$_configs) > 0;
    }
995657
public function hasCustomOptionsForm()
    {
        $app = Application::getFacadeApplication();
        $locator = $app->make(FileLocator::class);
        $pkgHandle = $this->getPackageHandle();
        if ($pkgHandle) {
            $locator->addLocation(new FileLocator\PackageLocation($pkgHandle));
        }
        $record = $locator->getRecord(DIRNAME_ELEMENTS . '/' . DIRNAME_PERMISSIONS . '/' . DIRNAME_KEYS . '/' . $this->getPermissionKeyHandle() . '.php');

        return $record ? file_exists($record->getFile()) : false;
    }
1052817
public function hasMessage()
    {
        $has_message = parent::hasMessage();

        foreach ($this->pages as $page) {
            if ($page->hasMessage()) {
                $has_message = true;
                break;
            }
        }

        return $has_message;
    }
454185
public function exists()
    {
        try {
            $path = $this->getPrefix();

            if ($this->getFileSystem()->has($path)) {
                $metadata = $this->getFileSystem()->getMetadata($this->getPrefix());
                return $metadata['type'] === 'file';
            }
        } catch (FileNotFoundException $e) {
        }
        return false;
    }
1368236
public static function uri_exist() {
		$routes = new Config('application/config');
		$current_route = str_replace('.php', '', self::get_uri());

		if (array_key_exists($current_route, array_flip(self::reserve))) {
			switch (true) {
				case ($current_route == 'rest'): $parent = 'rest'; break;

				case ($current_route == 'install' || $current_route == 'update'): $parent = 'vcs'; break;

				case ($current_route == 'admin'): $parent = 'admin'; break;

				default: $parent = 'default'; break;
			}

			$route = $routes->get("router/routes/$parent/$current_route");
			$buffer = [];

			foreach (self::$route as $option) {
				$buffer[$option] = $route['options'][$option];
			}
			$buffer['route'] = ($parent?("$parent/"):'').str_replace(['/', '[', ']', ':action'], ['', '', '', $buffer['action']], $buffer['route']);

			self::setRoute((object)$buffer);

			return true;
		}

		//TODO: other routes;

		return false;
    }
1092227
private static function canRoute() {
        $httpContext = self::$config['httpContext'];

        if ($httpContext->isIgnoredRoute()) {
            $request = $httpContext->getRequest();
            $response = $httpContext->getResponse();
            $response->clear();

            if (!file_exists($request->documentRoot() . $request->path())) {
                $response->setStatusCode(404);
            }
            else {
                require($request->documentRoot() . $request->path());
            }

            $response->end();
            return false;
        }

        $route = $httpContext->getRoute();

        if ($route == null) {
            $response = $httpContext->getResponse();
            $response->setStatusCode(404);
            $response->end();
            return false;
        }

        return $route;
    }
536151
protected function hasStaticPage()
    {
        if (!self::config()->enable_static_file) {
            return false;
        }

        // Attempt to retrieve content from generated file handler
        $filename = $this->getErrorFilename();
        $storeFilename = File::join_paths(self::config()->store_filepath, $filename);
        $result = self::get_asset_handler()->getContent($storeFilename);
        return !empty($result);
    }
804470
public function is()
    {
        $patterns = func_get_args();

        $name = $this->currentRouteName();

        foreach ($patterns as $pattern) {
            if (Str::is($pattern, $this->currentRouteName())) {
                return true;
            }
        }

        return false;
    }
1120121
def has_default_file(cls):
        """"""
        for filename in cls.config_files:
            for searchpath in cls.config_searchpath:
                path = os.path.join(searchpath, filename)
                if os.path.exists(path):
                    return True

        return False
83634
public function hasConfigFile($name)
    {
        $filename = $this->getConfigFilename($name);
        return is_file($filename) && is_readable($filename);
    }