Determine if the incoming request is for a static file.

@param  string  $sitePath
@param  string  $siteName
@param  string  $uri
@return string|false
336097
public function isStaticFile($sitePath, $siteName, $uri)
    {
        $sitePath = $this->addSubdirectory($sitePath);

        if (file_exists($sitePath.$uri) &&
            ! is_dir($sitePath.$uri) &&
            pathinfo($sitePath.$uri)['extension'] != 'php') {
            return $sitePath.$uri;
        }

        return false;
    }
1188475
public void setSitePath(String sitepath) {

        if (!isLeafType() && !sitepath.endsWith("/")) {
            sitepath = sitepath + "/";
        }
        m_sitePath = sitepath;
    }
47611
public static function getByPath($path, $version = 'RECENT', TreeInterface $siteTree = null)
    {
        $c = parent::getByPath(STACKS_PAGE_PATH . '/' . trim($path, '/'), $version, $siteTree);
        if (static::isValidStack($c)) {
            return $c;
        }

        return false;
    }
76035
protected boolean doesUriMatchPattern(final String requestPath, final String patternUrl) {
        val pattern = Pattern.compile('/' + patternUrl + "(/)*$");
        return pattern.matcher(requestPath).find();
    }
875570
public function isStaticFile($sitePath, $siteName, $uri)
    {
        if (file_exists($staticFilePath = $sitePath.'/public/'.$uri)) {
            return $staticFilePath;
        }

        return false;
    }
739005
public function frontControllerPath($sitePath, $siteName, $uri)
    {
        $sitePath = $this->addSubdirectory($sitePath);

        if (!isset($_GET['q']) && !empty($uri) && $uri !== '/') {
          $_GET['q'] = $uri;
        }

        $matches = [];
        if (preg_match('/^\/(.*?)\.php/', $uri, $matches)) {
            $filename = $matches[0];
            if (file_exists($sitePath.$filename) && ! is_dir($sitePath.$filename)) {
                $_SERVER['SCRIPT_FILENAME'] = $sitePath.$filename;
                $_SERVER['SCRIPT_NAME'] = $filename;
                return $sitePath.$filename;
            }
        }

        // Fallback
        $_SERVER['SCRIPT_FILENAME'] = $sitePath.'/index.php';
        $_SERVER['SCRIPT_NAME'] = '/index.php';
        return $sitePath.'/index.php';
    }
731793
public static function isNetworkPath($uri): bool
    {
        $uri = self::filterUri($uri);
        $null = $uri instanceof Psr7UriInterface ? '' : null;

        return $null === $uri->getScheme() && $null !== $uri->getAuthority();
    }
1006223
@VisibleForTesting
  static URI sourceURI(URI uri) {
    if (!uri.getScheme().equals("jar")) {
      return uri;
    }
    try {
      return URI.create(
          "file:/" + ((JarURLConnection) uri.toURL().openConnection()).getEntryName());
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
  }
1142728
public function analyseURI($uri)
    {
        if (($siteaccessPart = "/$this->key") === $uri) {
            return '/';
        }

        if (mb_strpos($uri, $siteaccessPart) === 0) {
            return mb_substr($uri, mb_strlen($siteaccessPart));
        }

        return $uri;
    }
383222
public function serves($sitePath, $siteName, $uri)
    {
        $typo3Dir = $sitePath . $this->documentRoot . '/typo3';
        return file_exists($typo3Dir) && is_dir($typo3Dir);
    }
704200
private boolean isOutFile(final URI toCheckPath) {
        final String path = toCheckPath.getPath();
        return !(path != null && path.startsWith(rootDir.getPath()));
    }
503340
public function isStaticFile($sitePath, $siteName, $uri)
    {
        if (file_exists($staticFilePath = $sitePath.'/public'.$uri)
           && is_file($staticFilePath)) {
            return $staticFilePath;
        }

        $storageUri = $uri;

        if (strpos($uri, '/storage/') === 0) {
            $storageUri = substr($uri, 8);
        }

        if ($this->isActualFile($storagePath = $sitePath.'/storage/app/public'.$storageUri)) {
            return $storagePath;
        }

        return false;
    }
565702
public function hasStatic($uri, $method = Route::METHOD_GET)
    {
        return isset($this->staticRoutes[$uri][$method]) || isset($this->staticRoutes[$uri][Route::METHOD_ALL]);
    }
35398
private function checkRequestUri($path, $uri)
    {
        if (strstr($path, '?') == '?') {
            $uri = rtrim($uri, '/').'/';
        }

        // Url check and path PARSER
        $path = str_replace('~', '\\~', $path);

        if (preg_match('~^'. $path . '$~', $uri, $match)) {
            array_shift($match);

            $this->match = str_replace('/', '', $match);

            return true;
        }

        return false;
    }
1019119
protected function getStaticPath($sitePath)
    {
        $parts = parse_url($_SERVER['REQUEST_URI']);
        $query = isset($parts['query']) ? $parts['query'] : '';

        return $sitePath . '/static' . $parts['path'] . '_' . $query . '.html';
    }
580313
def sitemap_uri(self, basename):
        """"""
        if (re.match(r"\w+:", basename)):
            # looks like URI
            return(basename)
        elif (re.match(r"/", basename)):
            # looks like full path
            return(basename)
        else:
            # build from mapping with name appended
            return(self.mapper.default_src_uri() + '/' + basename)
36976
function ( uri ) {
    var ret = {
        folder: false,
        redirect: false
    };

    uri = uri.replace( rSlash, "" );

    for ( var i = serverConfig.siteData.siteLayout.layout.length; i--; ) {
        var layout = serverConfig.siteData.siteLayout.layout[ i ];

        // Break out if folder matched
        if ( ret.folder ) {
            break;
        }

        // Skip hidden navigations
        //if ( layout.identifier === "_hidden" ) {
        //    continue;
        //}

        for ( var j = layout.links.length; j--; ) {
            var link = layout.links[ j ];

            // Matched a root level folder uri request
            if ( rIndexFolder.test( link.typeName ) && link.urlId === uri ) {
                if ( rFolder && keyFiles.folderList ) {
                    break;

                } else if ( rIndex && keyFiles.indexList ) {
                    break;

                } else {
                    ret.folder = true;
                    ret.redirect = ("/" + link.children[ 0 ].urlId + "/");
                    break;
                }
            }
        }
    }

    return ret;
}