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;
}