Craft\RetourService::findRedirectMatch PHP Méthode

findRedirectMatch() public méthode

public findRedirectMatch ( string $url ) : mixed
$url string the url to match
Résultat mixed the redirect array
    public function findRedirectMatch($url)
    {
        $result = null;
        /* -- Check the cache first */
        $redirect = $this->getRedirectFromCache($url);
        if ($redirect) {
            $error = $this->incrementRedirectHitCount($redirect);
            $this->saveRedirectToCache($url, $redirect);
            RetourPlugin::log("[cached] " . $redirect['redirectMatchType'] . " result: " . print_r($error, true), LogLevel::Info, false);
            return $redirect;
        }
        /* -- Look up the entry redirects first */
        $redirects = null;
        $redirects = $this->getAllEntryRedirects();
        $result = $this->lookupRedirect($url, $redirects);
        if ($result) {
            return $result;
        }
        /* -- Look up the static redirects next */
        $redirects = null;
        $redirects = $this->getAllStaticRedirects();
        $result = $this->lookupRedirect($url, $redirects);
        if ($result) {
            return $result;
        }
        return $result;
    }