2010-11-25 02:50:21 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ProjectUrlMatcher
|
|
|
|
*
|
|
|
|
* This class has been auto-generated
|
|
|
|
* by the Symfony Routing Component.
|
|
|
|
*/
|
|
|
|
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Constructor.
|
|
|
|
*/
|
|
|
|
public function __construct(array $context = array(), array $defaults = array())
|
|
|
|
{
|
|
|
|
$this->context = $context;
|
|
|
|
$this->defaults = $defaults;
|
|
|
|
}
|
|
|
|
|
2011-03-09 16:25:44 +00:00
|
|
|
public function match($pathinfo)
|
2010-11-25 02:50:21 +00:00
|
|
|
{
|
2011-03-09 16:25:44 +00:00
|
|
|
if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?P<bar>baz|symfony)$#x', $pathinfo, $matches)) {
|
2010-11-25 02:50:21 +00:00
|
|
|
return array_merge($this->mergeDefaults($matches, array ( 'def' => 'test',)), array('_route' => 'foo'));
|
|
|
|
}
|
|
|
|
|
2011-03-09 16:25:44 +00:00
|
|
|
if (isset($this->context['method']) && preg_match('#^(GET|head)$#xi', $this->context['method']) && 0 === strpos($pathinfo, '/bar') && preg_match('#^/bar/(?P<foo>[^/\.]+?)$#x', $pathinfo, $matches)) {
|
2010-11-25 02:50:21 +00:00
|
|
|
return array_merge($this->mergeDefaults($matches, array ()), array('_route' => 'bar'));
|
|
|
|
}
|
|
|
|
|
2011-03-09 16:25:44 +00:00
|
|
|
if ($pathinfo === '/test/baz') {
|
2010-12-20 17:13:02 +00:00
|
|
|
return array_merge($this->mergeDefaults(array(), array ()), array('_route' => 'baz'));
|
|
|
|
}
|
|
|
|
|
2011-03-09 16:25:44 +00:00
|
|
|
if ($pathinfo === '/test/baz.html') {
|
2010-12-22 08:41:53 +00:00
|
|
|
return array_merge($this->mergeDefaults(array(), array ()), array('_route' => 'baz2'));
|
|
|
|
}
|
|
|
|
|
2011-03-09 16:25:44 +00:00
|
|
|
if (rtrim($pathinfo, '/') === '/test/baz3') {
|
|
|
|
if (substr($pathinfo, -1) !== '/') {
|
|
|
|
return array('_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', 'url' => $this->context['base_url'].$pathinfo.'/', 'permanent' => true, '_route' => 'baz3');
|
2011-02-10 22:03:19 +00:00
|
|
|
}
|
|
|
|
return array_merge($this->mergeDefaults(array(), array ()), array('_route' => 'baz3'));
|
|
|
|
}
|
|
|
|
|
2011-03-09 16:25:44 +00:00
|
|
|
if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P<foo>[^/\.]+?)/?$#x', $pathinfo, $matches)) {
|
|
|
|
if (substr($pathinfo, -1) !== '/') {
|
|
|
|
return array('_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', 'url' => $this->context['base_url'].$pathinfo.'/', 'permanent' => true, '_route' => 'baz4');
|
2011-02-10 22:03:19 +00:00
|
|
|
}
|
|
|
|
return array_merge($this->mergeDefaults($matches, array ()), array('_route' => 'baz4'));
|
|
|
|
}
|
|
|
|
|
2010-11-25 02:50:21 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|