public function sitemapMatching($request)
    {
        $sitemap = $this->storage->getSitemap()->getSitemap();
        $relativeUri = '/' . $request::$relativeUri;

        foreach ($sitemap as $sitemapItem) {
            if ($sitemapItem->regex) {
                $matches = array();
                if (preg_match_all($sitemapItem->url, $relativeUri, $matches)) {
                    // Make a clone, so it doesnt add the matches to the original
                    $matchedClone = clone $sitemapItem;
                    $matchedClone->matches = $matches;
                    $this->application->addMatchedSitemapItem($matchedClone);
                    return;
                }
            } else {
                if ($sitemapItem->url == $relativeUri) {
                    $this->application->addMatchedSitemapItem($sitemapItem);
                    return;
                }
            }
        }
    }
public function sitemapMatching($request)
    {
        $sitemap = $this->storage->getSitemap()->getSitemap();
        $relativeUri = '/' . $request::$relativeUri;

        foreach ($sitemap as $sitemapItem) {
            if ($sitemapItem->regex) {
                $matches = array();
                if (preg_match_all($sitemapItem->url, $relativeUri, $matches)) {
                    // Make a clone, so it doesnt add the matches to the original
                    $matchedClone = clone $sitemapItem;
                    $matchedClone->matches = $matches;
                    $this->application->addMatchedSitemapItem($matchedClone);
                    return;
                }
            } else {
                if ($sitemapItem->url == $relativeUri) {
                    $this->application->addMatchedSitemapItem($sitemapItem);
                    return;
                }
            }
        }
    }
public function sitemapMatching ( $ request ) { $ sitemap = $ this -> storage -> getSitemap ( ) -> getSitemap ( ) ; $ relativeUri = '/' . $ request :: $ relativeUri ; foreach ( $ sitemap as $ sitemapItem ) { if ( $ sitemapItem -> regex ) { $ matches = array ( ) ; if ( preg_match_all ( $ sitemapItem -> url , $ relativeUri , $ matches ) ) { // Make a clone, so it doesnt add the matches to the original $ matchedClone = clone $ sitemapItem ; $ matchedClone -> matches = $ matches ; $ this -> application -> addMatchedSitemapItem ( $ matchedClone ) ; return ; } } else { if ( $ sitemapItem -> url == $ relativeUri ) { $ this -> application -> addMatchedSitemapItem ( $ sitemapItem ) ; return ; } } } }
Loop through sitemap items and see if one matches the requestUri.
If it does, add it tot the matchedSitemapItems array

@param Request $request
Loop through sitemap items and see if one matches the requestUri . If it does add it tot the matchedSitemapItems array