* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Routing\Matcher; use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Routing\Route; /** * @author Fabien Potencier */ abstract class RedirectableUrlMatcher extends UrlMatcher implements RedirectableUrlMatcherInterface { /** * {@inheritdoc} */ public function match($pathinfo) { try { $parameters = parent::match($pathinfo); } catch (ResourceNotFoundException $e) { if ('/' === substr($pathinfo, -1) || !in_array($this->context->getMethod(), array('HEAD', 'GET'))) { throw $e; } try { $parameters = parent::match($pathinfo.'/'); return array_replace($parameters, $this->redirect($pathinfo.'/', isset($parameters['_route']) ? $parameters['_route'] : null)); } catch (ResourceNotFoundException $e2) { throw $e; } } return $parameters; } /** * {@inheritdoc} */ protected function handleRouteRequirements($pathinfo, $name, Route $route) { // expression condition if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), array('context' => $this->context, 'request' => $this->request ?: $this->createRequest($pathinfo)))) { return array(self::REQUIREMENT_MISMATCH, null); } // check HTTP scheme requirement $scheme = $this->context->getScheme(); $schemes = $route->getSchemes(); if ($schemes && !$route->hasScheme($scheme)) { return array(self::ROUTE_MATCH, $this->redirect($pathinfo, $name, current($schemes))); } return array(self::REQUIREMENT_MATCH, null); } } __halt_compiler();----SIGNATURE:----HQMzBIJAVKrwtStu3yXUNp28NZeY6Q4zmU4+CKevyPDXxM8uwotUyx5BjbluY4cEfCPMuDeAzTrqs6mW6nHrVCFCewalSRRpUjaZus4hcVYFKzu5qDsCyheTs+whUmDdewFs3wvMIavkp3PvBt0sfHaytF1Ewa+VzlQBVXd2pna92KeCPIwDCjRvoiF4mxfRzN1LDdUvcxWaKtED9jF++Au2ZU3jb+exVonVhJXdRLXDR2uxdZ4Zqs7c74rICcWV28GjxXGpK2EsCO4iZariIcp5gXf6G52LOIe2YSV1A57+mS4YL1z/iDjtfLuqdw2+q5/MMtSjoA763Ada+AyR3C4Fd2hIIyL5Fg1DLYWHgUaS84MFxJ5w9FmWbGROjKsb4nVezZ39OzxTCAF6cg9kbyV39m+4BGzVitslC69Zg2u3yKkn8n4nasHRTrpyNood/nlrcR1m72boBVzhRl8h1Hcpzr39ysugiLaDS2uGj+YfIMBg6W0c6Z01bMGuFLt2wYf56PUfbSlqH+iaInCxstJCwFdDcgRga1PbbqHgrS/lsLcM6tylHyl8Zbs6G3DDnFT2bSBZxK5gAUL6Fxfz+zLahM1V8VmO0oHsd9eKFV25w3JgX8JNNQusMDeqHAROJfpgtYuR+Jm7f34V2RAO6vNSHEuMdruX9CTS9cra8k8=----ATTACHMENT:----OTU1OTc1NjUwNjc5NDgzOCA1ODUyNzcxMDcyNDU5MDIwIDYyOTk0MjQwMzMzNjMwOTY=