Initial Commit
This commit is contained in:
59
vendor/symfony/routing/Tests/Annotation/RouteTest.php
vendored
Normal file
59
vendor/symfony/routing/Tests/Annotation/RouteTest.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Annotation;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class RouteTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException \BadMethodCallException
|
||||
*/
|
||||
public function testInvalidRouteParameter()
|
||||
{
|
||||
$route = new Route(array('foo' => 'bar'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \BadMethodCallException
|
||||
*/
|
||||
public function testTryingToSetLocalesDirectly()
|
||||
{
|
||||
$route = new Route(array('locales' => array('nl' => 'bar')));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getValidParameters
|
||||
*/
|
||||
public function testRouteParameters($parameter, $value, $getter)
|
||||
{
|
||||
$route = new Route(array($parameter => $value));
|
||||
$this->assertEquals($route->$getter(), $value);
|
||||
}
|
||||
|
||||
public function getValidParameters()
|
||||
{
|
||||
return array(
|
||||
array('value', '/Blog', 'getPath'),
|
||||
array('requirements', array('locale' => 'en'), 'getRequirements'),
|
||||
array('options', array('compiler_class' => 'RouteCompiler'), 'getOptions'),
|
||||
array('name', 'blog_index', 'getName'),
|
||||
array('defaults', array('_controller' => 'MyBlogBundle:Blog:index'), 'getDefaults'),
|
||||
array('schemes', array('https'), 'getSchemes'),
|
||||
array('methods', array('GET', 'POST'), 'getMethods'),
|
||||
array('host', '{locale}.example.com', 'getHost'),
|
||||
array('condition', 'context.getMethod() == "GET"', 'getCondition'),
|
||||
array('value', array('nl' => '/hier', 'en' => '/here'), 'getLocalizedPaths'),
|
||||
);
|
||||
}
|
||||
}
|
||||
27
vendor/symfony/routing/Tests/CompiledRouteTest.php
vendored
Normal file
27
vendor/symfony/routing/Tests/CompiledRouteTest.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Routing\CompiledRoute;
|
||||
|
||||
class CompiledRouteTest extends TestCase
|
||||
{
|
||||
public function testAccessors()
|
||||
{
|
||||
$compiled = new CompiledRoute('prefix', 'regex', array('tokens'), array(), null, array(), array(), array('variables'));
|
||||
$this->assertEquals('prefix', $compiled->getStaticPrefix(), '__construct() takes a static prefix as its second argument');
|
||||
$this->assertEquals('regex', $compiled->getRegex(), '__construct() takes a regexp as its third argument');
|
||||
$this->assertEquals(array('tokens'), $compiled->getTokens(), '__construct() takes an array of tokens as its fourth argument');
|
||||
$this->assertEquals(array('variables'), $compiled->getVariables(), '__construct() takes an array of variables as its ninth argument');
|
||||
}
|
||||
}
|
||||
36
vendor/symfony/routing/Tests/DependencyInjection/RoutingResolverPassTest.php
vendored
Normal file
36
vendor/symfony/routing/Tests/DependencyInjection/RoutingResolverPassTest.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\DependencyInjection;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Config\Loader\LoaderResolver;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Symfony\Component\Routing\DependencyInjection\RoutingResolverPass;
|
||||
|
||||
class RoutingResolverPassTest extends TestCase
|
||||
{
|
||||
public function testProcess()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$container->register('routing.resolver', LoaderResolver::class);
|
||||
$container->register('loader1')->addTag('routing.loader');
|
||||
$container->register('loader2')->addTag('routing.loader');
|
||||
|
||||
(new RoutingResolverPass())->process($container);
|
||||
|
||||
$this->assertEquals(
|
||||
array(array('addLoader', array(new Reference('loader1'))), array('addLoader', array(new Reference('loader2')))),
|
||||
$container->getDefinition('routing.resolver')->getMethodCalls()
|
||||
);
|
||||
}
|
||||
}
|
||||
16
vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/AbstractClass.php
vendored
Normal file
16
vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/AbstractClass.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses;
|
||||
|
||||
abstract class AbstractClass
|
||||
{
|
||||
}
|
||||
19
vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BarClass.php
vendored
Normal file
19
vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BarClass.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses;
|
||||
|
||||
class BarClass
|
||||
{
|
||||
public function routeAction($arg1, $arg2 = 'defaultValue2', $arg3 = 'defaultValue3')
|
||||
{
|
||||
}
|
||||
}
|
||||
19
vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BazClass.php
vendored
Normal file
19
vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BazClass.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses;
|
||||
|
||||
class BazClass
|
||||
{
|
||||
public function __invoke()
|
||||
{
|
||||
}
|
||||
}
|
||||
16
vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/FooClass.php
vendored
Normal file
16
vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/FooClass.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses;
|
||||
|
||||
class FooClass
|
||||
{
|
||||
}
|
||||
13
vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/FooTrait.php
vendored
Normal file
13
vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/FooTrait.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses;
|
||||
|
||||
trait FooTrait
|
||||
{
|
||||
public function doBar()
|
||||
{
|
||||
$baz = self::class;
|
||||
if (true) {
|
||||
}
|
||||
}
|
||||
}
|
||||
7
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/AbstractClassController.php
vendored
Normal file
7
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/AbstractClassController.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
abstract class AbstractClassController
|
||||
{
|
||||
}
|
||||
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/ActionPathController.php
vendored
Normal file
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/ActionPathController.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class ActionPathController
|
||||
{
|
||||
/**
|
||||
* @Route("/path", name="action")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/DefaultValueController.php
vendored
Normal file
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/DefaultValueController.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class DefaultValueController
|
||||
{
|
||||
/**
|
||||
* @Route("/{default}/path", name="action")
|
||||
*/
|
||||
public function action($default = 'value')
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class ExplicitLocalizedActionPathController
|
||||
{
|
||||
/**
|
||||
* @Route(path={"en": "/path", "nl": "/pad"}, name="action")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/InvokableController.php
vendored
Normal file
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/InvokableController.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route("/here", name="lol")
|
||||
*/
|
||||
class InvokableController
|
||||
{
|
||||
public function __invoke()
|
||||
{
|
||||
}
|
||||
}
|
||||
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/InvokableLocalizedController.php
vendored
Normal file
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/InvokableLocalizedController.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route(path={"nl": "/hier", "en": "/here"}, name="action")
|
||||
*/
|
||||
class InvokableLocalizedController
|
||||
{
|
||||
public function __invoke()
|
||||
{
|
||||
}
|
||||
}
|
||||
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/LocalizedActionPathController.php
vendored
Normal file
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/LocalizedActionPathController.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class LocalizedActionPathController
|
||||
{
|
||||
/**
|
||||
* @Route(path={"en": "/path", "nl": "/pad"}, name="action")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
25
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/LocalizedMethodActionControllers.php
vendored
Normal file
25
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/LocalizedMethodActionControllers.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route(path={"en": "/the/path", "nl": "/het/pad"})
|
||||
*/
|
||||
class LocalizedMethodActionControllers
|
||||
{
|
||||
/**
|
||||
* @Route(name="post", methods={"POST"})
|
||||
*/
|
||||
public function post()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(name="put", methods={"PUT"})
|
||||
*/
|
||||
public function put()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route(path={"nl": "/nl", "en": "/en"})
|
||||
*/
|
||||
class LocalizedPrefixLocalizedActionController
|
||||
{
|
||||
/**
|
||||
* @Route(path={"nl": "/actie", "en": "/action"}, name="action")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route(path={"nl": "/nl"})
|
||||
*/
|
||||
class LocalizedPrefixMissingLocaleActionController
|
||||
{
|
||||
/**
|
||||
* @Route(path={"nl": "/actie", "en": "/action"}, name="action")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route(path={"nl": "/nl", "en": "/en"})
|
||||
*/
|
||||
class LocalizedPrefixMissingRouteLocaleActionController
|
||||
{
|
||||
/**
|
||||
* @Route(path={"nl": "/actie"}, name="action")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route(path={"en": "/en", "nl": "/nl"})
|
||||
*/
|
||||
class LocalizedPrefixWithRouteWithoutLocale
|
||||
{
|
||||
/**
|
||||
* @Route("/suffix", name="action")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
25
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/MethodActionControllers.php
vendored
Normal file
25
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/MethodActionControllers.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route("/the/path")
|
||||
*/
|
||||
class MethodActionControllers
|
||||
{
|
||||
/**
|
||||
* @Route(name="post", methods={"POST"})
|
||||
*/
|
||||
public function post()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(name="put", methods={"PUT"})
|
||||
*/
|
||||
public function put()
|
||||
{
|
||||
}
|
||||
}
|
||||
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/MissingRouteNameController.php
vendored
Normal file
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/MissingRouteNameController.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class MissingRouteNameController
|
||||
{
|
||||
/**
|
||||
* @Route("/path")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/NothingButNameController.php
vendored
Normal file
15
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/NothingButNameController.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class NothingButNameController
|
||||
{
|
||||
/**
|
||||
* @Route(name="action")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route("/prefix")
|
||||
*/
|
||||
class PrefixedActionLocalizedRouteController
|
||||
{
|
||||
/**
|
||||
* @Route(path={"en": "/path", "nl": "/pad"}, name="action")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
18
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/PrefixedActionPathController.php
vendored
Normal file
18
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/PrefixedActionPathController.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route("/prefix", host="frankdejonge.nl", condition="lol=fun")
|
||||
*/
|
||||
class PrefixedActionPathController
|
||||
{
|
||||
/**
|
||||
* @Route("/path", name="action")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
18
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/RouteWithPrefixController.php
vendored
Normal file
18
vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/RouteWithPrefixController.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* @Route("/prefix")
|
||||
*/
|
||||
class RouteWithPrefixController
|
||||
{
|
||||
/**
|
||||
* @Route("/path", name="action")
|
||||
*/
|
||||
public function action()
|
||||
{
|
||||
}
|
||||
}
|
||||
18
vendor/symfony/routing/Tests/Fixtures/CustomCompiledRoute.php
vendored
Normal file
18
vendor/symfony/routing/Tests/Fixtures/CustomCompiledRoute.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Routing\CompiledRoute;
|
||||
|
||||
class CustomCompiledRoute extends CompiledRoute
|
||||
{
|
||||
}
|
||||
26
vendor/symfony/routing/Tests/Fixtures/CustomRouteCompiler.php
vendored
Normal file
26
vendor/symfony/routing/Tests/Fixtures/CustomRouteCompiler.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Routing\Route;
|
||||
use Symfony\Component\Routing\RouteCompiler;
|
||||
|
||||
class CustomRouteCompiler extends RouteCompiler
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function compile(Route $route)
|
||||
{
|
||||
return new CustomCompiledRoute('', '', array(), array());
|
||||
}
|
||||
}
|
||||
26
vendor/symfony/routing/Tests/Fixtures/CustomXmlFileLoader.php
vendored
Normal file
26
vendor/symfony/routing/Tests/Fixtures/CustomXmlFileLoader.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Config\Util\XmlUtils;
|
||||
use Symfony\Component\Routing\Loader\XmlFileLoader;
|
||||
|
||||
/**
|
||||
* XmlFileLoader with schema validation turned off.
|
||||
*/
|
||||
class CustomXmlFileLoader extends XmlFileLoader
|
||||
{
|
||||
protected function loadFile($file)
|
||||
{
|
||||
return XmlUtils::loadFile($file, function () { return true; });
|
||||
}
|
||||
}
|
||||
24
vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php
vendored
Normal file
24
vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\OtherAnnotatedClasses;
|
||||
|
||||
trait AnonymousClassInTrait
|
||||
{
|
||||
public function test()
|
||||
{
|
||||
return new class() {
|
||||
public function foo()
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
3
vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/NoStartTagClass.php
vendored
Normal file
3
vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/NoStartTagClass.php
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
class NoStartTagClass
|
||||
{
|
||||
}
|
||||
19
vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/VariadicClass.php
vendored
Normal file
19
vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/VariadicClass.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures\OtherAnnotatedClasses;
|
||||
|
||||
class VariadicClass
|
||||
{
|
||||
public function routeAction(...$params)
|
||||
{
|
||||
}
|
||||
}
|
||||
30
vendor/symfony/routing/Tests/Fixtures/RedirectableUrlMatcher.php
vendored
Normal file
30
vendor/symfony/routing/Tests/Fixtures/RedirectableUrlMatcher.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Routing\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface;
|
||||
use Symfony\Component\Routing\Matcher\UrlMatcher;
|
||||
|
||||
/**
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class RedirectableUrlMatcher extends UrlMatcher implements RedirectableUrlMatcherInterface
|
||||
{
|
||||
public function redirect($path, $route, $scheme = null)
|
||||
{
|
||||
return array(
|
||||
'_controller' => 'Some controller reference...',
|
||||
'path' => $path,
|
||||
'scheme' => $scheme,
|
||||
);
|
||||
}
|
||||
}
|
||||
0
vendor/symfony/routing/Tests/Fixtures/annotated.php
vendored
Normal file
0
vendor/symfony/routing/Tests/Fixtures/annotated.php
vendored
Normal file
3
vendor/symfony/routing/Tests/Fixtures/bad_format.yml
vendored
Normal file
3
vendor/symfony/routing/Tests/Fixtures/bad_format.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
blog_show:
|
||||
path: /blog/{slug}
|
||||
defaults: { _controller: "MyBundle:Blog:show" }
|
||||
0
vendor/symfony/routing/Tests/Fixtures/bar.xml
vendored
Normal file
0
vendor/symfony/routing/Tests/Fixtures/bar.xml
vendored
Normal file
10
vendor/symfony/routing/Tests/Fixtures/controller/import__controller.xml
vendored
Normal file
10
vendor/symfony/routing/Tests/Fixtures/controller/import__controller.xml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<import resource="routing.xml">
|
||||
<default key="_controller">FrameworkBundle:Template:template</default>
|
||||
</import>
|
||||
</routes>
|
||||
4
vendor/symfony/routing/Tests/Fixtures/controller/import__controller.yml
vendored
Normal file
4
vendor/symfony/routing/Tests/Fixtures/controller/import__controller.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
_static:
|
||||
resource: routing.yml
|
||||
defaults:
|
||||
_controller: FrameworkBundle:Template:template
|
||||
8
vendor/symfony/routing/Tests/Fixtures/controller/import_controller.xml
vendored
Normal file
8
vendor/symfony/routing/Tests/Fixtures/controller/import_controller.xml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<import resource="routing.xml" controller="FrameworkBundle:Template:template" />
|
||||
</routes>
|
||||
3
vendor/symfony/routing/Tests/Fixtures/controller/import_controller.yml
vendored
Normal file
3
vendor/symfony/routing/Tests/Fixtures/controller/import_controller.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
_static:
|
||||
resource: routing.yml
|
||||
controller: FrameworkBundle:Template:template
|
||||
10
vendor/symfony/routing/Tests/Fixtures/controller/import_override_defaults.xml
vendored
Normal file
10
vendor/symfony/routing/Tests/Fixtures/controller/import_override_defaults.xml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<import resource="routing.xml" controller="FrameworkBundle:Template:template">
|
||||
<default key="_controller">AppBundle:Blog:index</default>
|
||||
</import>
|
||||
</routes>
|
||||
5
vendor/symfony/routing/Tests/Fixtures/controller/import_override_defaults.yml
vendored
Normal file
5
vendor/symfony/routing/Tests/Fixtures/controller/import_override_defaults.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
_static:
|
||||
resource: routing.yml
|
||||
controller: FrameworkBundle:Template:template
|
||||
defaults:
|
||||
_controller: AppBundle:Homepage:show
|
||||
10
vendor/symfony/routing/Tests/Fixtures/controller/override_defaults.xml
vendored
Normal file
10
vendor/symfony/routing/Tests/Fixtures/controller/override_defaults.xml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<route id="app_blog" path="/blog" controller="AppBundle:Homepage:show">
|
||||
<default key="_controller">AppBundle:Blog:index</default>
|
||||
</route>
|
||||
</routes>
|
||||
5
vendor/symfony/routing/Tests/Fixtures/controller/override_defaults.yml
vendored
Normal file
5
vendor/symfony/routing/Tests/Fixtures/controller/override_defaults.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
app_blog:
|
||||
path: /blog
|
||||
controller: AppBundle:Homepage:show
|
||||
defaults:
|
||||
_controller: AppBundle:Blog:index
|
||||
14
vendor/symfony/routing/Tests/Fixtures/controller/routing.xml
vendored
Normal file
14
vendor/symfony/routing/Tests/Fixtures/controller/routing.xml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<route id="app_homepage" path="/" controller="AppBundle:Homepage:show" />
|
||||
|
||||
<route id="app_blog" path="/blog">
|
||||
<default key="_controller">AppBundle:Blog:list</default>
|
||||
</route>
|
||||
|
||||
<route id="app_logout" path="/logout" />
|
||||
</routes>
|
||||
11
vendor/symfony/routing/Tests/Fixtures/controller/routing.yml
vendored
Normal file
11
vendor/symfony/routing/Tests/Fixtures/controller/routing.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
app_homepage:
|
||||
path: /
|
||||
controller: AppBundle:Homepage:show
|
||||
|
||||
app_blog:
|
||||
path: /blog
|
||||
defaults:
|
||||
_controller: AppBundle:Blog:list
|
||||
|
||||
app_logout:
|
||||
path: /logout
|
||||
2
vendor/symfony/routing/Tests/Fixtures/directory/recurse/routes1.yml
vendored
Normal file
2
vendor/symfony/routing/Tests/Fixtures/directory/recurse/routes1.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
route1:
|
||||
path: /route/1
|
||||
2
vendor/symfony/routing/Tests/Fixtures/directory/recurse/routes2.yml
vendored
Normal file
2
vendor/symfony/routing/Tests/Fixtures/directory/recurse/routes2.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
route2:
|
||||
path: /route/2
|
||||
2
vendor/symfony/routing/Tests/Fixtures/directory/routes3.yml
vendored
Normal file
2
vendor/symfony/routing/Tests/Fixtures/directory/routes3.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
route3:
|
||||
path: /route/3
|
||||
3
vendor/symfony/routing/Tests/Fixtures/directory_import/import.yml
vendored
Normal file
3
vendor/symfony/routing/Tests/Fixtures/directory_import/import.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
_directory:
|
||||
resource: "../directory"
|
||||
type: directory
|
||||
35
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher0.php
vendored
Normal file
35
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher0.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($rawPathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
247
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php
vendored
Normal file
247
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php
vendored
Normal file
@@ -0,0 +1,247 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($rawPathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
$host = strtolower($context->getHost());
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
switch ($pathinfo) {
|
||||
default:
|
||||
$routes = array(
|
||||
'/test/baz' => array(array('_route' => 'baz'), null, null, null),
|
||||
'/test/baz.html' => array(array('_route' => 'baz2'), null, null, null),
|
||||
'/test/baz3/' => array(array('_route' => 'baz3'), null, null, null),
|
||||
'/foofoo' => array(array('_route' => 'foofoo', 'def' => 'test'), null, null, null),
|
||||
'/spa ce' => array(array('_route' => 'space'), null, null, null),
|
||||
'/multi/new' => array(array('_route' => 'overridden2'), null, null, null),
|
||||
'/multi/hey/' => array(array('_route' => 'hey'), null, null, null),
|
||||
'/ababa' => array(array('_route' => 'ababa'), null, null, null),
|
||||
'/route1' => array(array('_route' => 'route1'), 'a.example.com', null, null),
|
||||
'/c2/route2' => array(array('_route' => 'route2'), 'a.example.com', null, null),
|
||||
'/route4' => array(array('_route' => 'route4'), 'a.example.com', null, null),
|
||||
'/c2/route3' => array(array('_route' => 'route3'), 'b.example.com', null, null),
|
||||
'/route5' => array(array('_route' => 'route5'), 'c.example.com', null, null),
|
||||
'/route6' => array(array('_route' => 'route6'), null, null, null),
|
||||
'/route11' => array(array('_route' => 'route11'), '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null),
|
||||
'/route12' => array(array('_route' => 'route12', 'var1' => 'val'), '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null),
|
||||
'/route17' => array(array('_route' => 'route17'), null, null, null),
|
||||
);
|
||||
|
||||
if (!isset($routes[$pathinfo])) {
|
||||
break;
|
||||
}
|
||||
list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
|
||||
|
||||
if ($requiredHost) {
|
||||
if ('#' !== $requiredHost[0] ? $requiredHost !== $host : !preg_match($requiredHost, $host, $hostMatches)) {
|
||||
break;
|
||||
}
|
||||
if ('#' === $requiredHost[0] && $hostMatches) {
|
||||
$hostMatches['_route'] = $ret['_route'];
|
||||
$ret = $this->mergeDefaults($hostMatches, $ret);
|
||||
}
|
||||
}
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$matchedPathinfo = $host.'.'.$pathinfo;
|
||||
$regexList = array(
|
||||
0 => '{^(?'
|
||||
.'|(?:(?:[^./]*+\\.)++)(?'
|
||||
.'|/foo/(baz|symfony)(*:47)'
|
||||
.'|/bar(?'
|
||||
.'|/([^/]++)(*:70)'
|
||||
.'|head/([^/]++)(*:90)'
|
||||
.')'
|
||||
.'|/test/([^/]++)/(?'
|
||||
.'|(*:116)'
|
||||
.')'
|
||||
.'|/([\']+)(*:132)'
|
||||
.'|/a/(?'
|
||||
.'|b\'b/([^/]++)(?'
|
||||
.'|(*:161)'
|
||||
.'|(*:169)'
|
||||
.')'
|
||||
.'|(.*)(*:182)'
|
||||
.'|b\'b/([^/]++)(?'
|
||||
.'|(*:205)'
|
||||
.'|(*:213)'
|
||||
.')'
|
||||
.')'
|
||||
.'|/multi/hello(?:/([^/]++))?(*:249)'
|
||||
.'|/([^/]++)/b/([^/]++)(?'
|
||||
.'|(*:280)'
|
||||
.'|(*:288)'
|
||||
.')'
|
||||
.'|/aba/([^/]++)(*:310)'
|
||||
.')|(?i:([^\\.]++)\\.example\\.com)\\.(?'
|
||||
.'|/route1(?'
|
||||
.'|3/([^/]++)(*:372)'
|
||||
.'|4/([^/]++)(*:390)'
|
||||
.')'
|
||||
.')|(?i:c\\.example\\.com)\\.(?'
|
||||
.'|/route15/([^/]++)(*:442)'
|
||||
.')|(?:(?:[^./]*+\\.)++)(?'
|
||||
.'|/route16/([^/]++)(*:490)'
|
||||
.'|/a/(?'
|
||||
.'|a\\.\\.\\.(*:511)'
|
||||
.'|b/(?'
|
||||
.'|([^/]++)(*:532)'
|
||||
.'|c/([^/]++)(*:550)'
|
||||
.')'
|
||||
.')'
|
||||
.')'
|
||||
.')$}sD',
|
||||
);
|
||||
|
||||
foreach ($regexList as $offset => $regex) {
|
||||
while (preg_match($regex, $matchedPathinfo, $matches)) {
|
||||
switch ($m = (int) $matches['MARK']) {
|
||||
case 116:
|
||||
$matches = array('foo' => $matches[1] ?? null);
|
||||
|
||||
// baz4
|
||||
return $this->mergeDefaults(array('_route' => 'baz4') + $matches, array());
|
||||
|
||||
// baz5
|
||||
$ret = $this->mergeDefaults(array('_route' => 'baz5') + $matches, array());
|
||||
if (!isset(($a = array('POST' => 0))[$requestMethod])) {
|
||||
$allow += $a;
|
||||
goto not_baz5;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
not_baz5:
|
||||
|
||||
// baz.baz6
|
||||
$ret = $this->mergeDefaults(array('_route' => 'baz.baz6') + $matches, array());
|
||||
if (!isset(($a = array('PUT' => 0))[$requestMethod])) {
|
||||
$allow += $a;
|
||||
goto not_bazbaz6;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
not_bazbaz6:
|
||||
|
||||
break;
|
||||
case 161:
|
||||
$matches = array('foo' => $matches[1] ?? null);
|
||||
|
||||
// foo1
|
||||
$ret = $this->mergeDefaults(array('_route' => 'foo1') + $matches, array());
|
||||
if (!isset(($a = array('PUT' => 0))[$requestMethod])) {
|
||||
$allow += $a;
|
||||
goto not_foo1;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
not_foo1:
|
||||
|
||||
break;
|
||||
case 205:
|
||||
$matches = array('foo1' => $matches[1] ?? null);
|
||||
|
||||
// foo2
|
||||
return $this->mergeDefaults(array('_route' => 'foo2') + $matches, array());
|
||||
|
||||
break;
|
||||
case 280:
|
||||
$matches = array('_locale' => $matches[1] ?? null, 'foo' => $matches[2] ?? null);
|
||||
|
||||
// foo3
|
||||
return $this->mergeDefaults(array('_route' => 'foo3') + $matches, array());
|
||||
|
||||
break;
|
||||
default:
|
||||
$routes = array(
|
||||
47 => array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null),
|
||||
70 => array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null),
|
||||
90 => array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null),
|
||||
132 => array(array('_route' => 'quoter'), array('quoter'), null, null),
|
||||
169 => array(array('_route' => 'bar1'), array('bar'), null, null),
|
||||
182 => array(array('_route' => 'overridden'), array('var'), null, null),
|
||||
213 => array(array('_route' => 'bar2'), array('bar1'), null, null),
|
||||
249 => array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null),
|
||||
288 => array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null),
|
||||
310 => array(array('_route' => 'foo4'), array('foo'), null, null),
|
||||
372 => array(array('_route' => 'route13'), array('var1', 'name'), null, null),
|
||||
390 => array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null),
|
||||
442 => array(array('_route' => 'route15'), array('name'), null, null),
|
||||
490 => array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null),
|
||||
511 => array(array('_route' => 'a'), array(), null, null),
|
||||
532 => array(array('_route' => 'b'), array('var'), null, null),
|
||||
550 => array(array('_route' => 'c'), array('var'), null, null),
|
||||
);
|
||||
|
||||
list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
|
||||
|
||||
foreach ($vars as $i => $v) {
|
||||
if (isset($matches[1 + $i])) {
|
||||
$ret[$v] = $matches[1 + $i];
|
||||
}
|
||||
}
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (550 === $m) {
|
||||
break;
|
||||
}
|
||||
$regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
|
||||
$offset += strlen($m);
|
||||
}
|
||||
}
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
2830
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher10.php
vendored
Normal file
2830
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher10.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
151
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher11.php
vendored
Normal file
151
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher11.php
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($pathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
|
||||
return $ret;
|
||||
}
|
||||
if ($allow) {
|
||||
throw new MethodNotAllowedException(array_keys($allow));
|
||||
}
|
||||
if (!in_array($this->context->getMethod(), array('HEAD', 'GET'), true)) {
|
||||
// no-op
|
||||
} elseif ($allowSchemes) {
|
||||
redirect_scheme:
|
||||
$scheme = $this->context->getScheme();
|
||||
$this->context->setScheme(key($allowSchemes));
|
||||
try {
|
||||
if ($ret = $this->doMatch($pathinfo)) {
|
||||
return $this->redirect($pathinfo, $ret['_route'], $this->context->getScheme()) + $ret;
|
||||
}
|
||||
} finally {
|
||||
$this->context->setScheme($scheme);
|
||||
}
|
||||
} elseif ('/' !== $pathinfo) {
|
||||
$pathinfo = '/' !== $pathinfo[-1] ? $pathinfo.'/' : substr($pathinfo, 0, -1);
|
||||
if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
|
||||
return $this->redirect($pathinfo, $ret['_route']) + $ret;
|
||||
}
|
||||
if ($allowSchemes) {
|
||||
goto redirect_scheme;
|
||||
}
|
||||
}
|
||||
|
||||
throw new ResourceNotFoundException();
|
||||
}
|
||||
|
||||
private function doMatch(string $rawPathinfo, array &$allow = array(), array &$allowSchemes = array()): ?array
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
$matchedPathinfo = $pathinfo;
|
||||
$regexList = array(
|
||||
0 => '{^(?'
|
||||
.'|/(en|fr)/(?'
|
||||
.'|admin/post/(?'
|
||||
.'|(*:33)'
|
||||
.'|new(*:43)'
|
||||
.'|(\\d+)(*:55)'
|
||||
.'|(\\d+)/edit(*:72)'
|
||||
.'|(\\d+)/delete(*:91)'
|
||||
.')'
|
||||
.'|blog/(?'
|
||||
.'|(*:107)'
|
||||
.'|rss\\.xml(*:123)'
|
||||
.'|p(?'
|
||||
.'|age/([^/]++)(*:147)'
|
||||
.'|osts/([^/]++)(*:168)'
|
||||
.')'
|
||||
.'|comments/(\\d+)/new(*:195)'
|
||||
.'|search(*:209)'
|
||||
.')'
|
||||
.'|log(?'
|
||||
.'|in(*:226)'
|
||||
.'|out(*:237)'
|
||||
.')'
|
||||
.')'
|
||||
.'|/(en|fr)?(*:256)'
|
||||
.')$}sD',
|
||||
);
|
||||
|
||||
foreach ($regexList as $offset => $regex) {
|
||||
while (preg_match($regex, $matchedPathinfo, $matches)) {
|
||||
switch ($m = (int) $matches['MARK']) {
|
||||
default:
|
||||
$routes = array(
|
||||
33 => array(array('_route' => 'a', '_locale' => 'en'), array('_locale'), null, null),
|
||||
43 => array(array('_route' => 'b', '_locale' => 'en'), array('_locale'), null, null),
|
||||
55 => array(array('_route' => 'c', '_locale' => 'en'), array('_locale', 'id'), null, null),
|
||||
72 => array(array('_route' => 'd', '_locale' => 'en'), array('_locale', 'id'), null, null),
|
||||
91 => array(array('_route' => 'e', '_locale' => 'en'), array('_locale', 'id'), null, null),
|
||||
107 => array(array('_route' => 'f', '_locale' => 'en'), array('_locale'), null, null),
|
||||
123 => array(array('_route' => 'g', '_locale' => 'en'), array('_locale'), null, null),
|
||||
147 => array(array('_route' => 'h', '_locale' => 'en'), array('_locale', 'page'), null, null),
|
||||
168 => array(array('_route' => 'i', '_locale' => 'en'), array('_locale', 'page'), null, null),
|
||||
195 => array(array('_route' => 'j', '_locale' => 'en'), array('_locale', 'id'), null, null),
|
||||
209 => array(array('_route' => 'k', '_locale' => 'en'), array('_locale'), null, null),
|
||||
226 => array(array('_route' => 'l', '_locale' => 'en'), array('_locale'), null, null),
|
||||
237 => array(array('_route' => 'm', '_locale' => 'en'), array('_locale'), null, null),
|
||||
256 => array(array('_route' => 'n', '_locale' => 'en'), array('_locale'), null, null),
|
||||
);
|
||||
|
||||
list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
|
||||
|
||||
foreach ($vars as $i => $v) {
|
||||
if (isset($matches[1 + $i])) {
|
||||
$ret[$v] = $matches[1 + $i];
|
||||
}
|
||||
}
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (256 === $m) {
|
||||
break;
|
||||
}
|
||||
$regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
|
||||
$offset += strlen($m);
|
||||
}
|
||||
}
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
100
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher12.php
vendored
Normal file
100
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher12.php
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($rawPathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
$matchedPathinfo = $pathinfo;
|
||||
$regexList = array(
|
||||
0 => '{^(?'
|
||||
.'|/abc([^/]++)/(?'
|
||||
.'|1(?'
|
||||
.'|(*:27)'
|
||||
.'|0(?'
|
||||
.'|(*:38)'
|
||||
.'|0(*:46)'
|
||||
.')'
|
||||
.')'
|
||||
.'|2(?'
|
||||
.'|(*:59)'
|
||||
.'|0(?'
|
||||
.'|(*:70)'
|
||||
.'|0(*:78)'
|
||||
.')'
|
||||
.')'
|
||||
.')'
|
||||
.')$}sD',
|
||||
);
|
||||
|
||||
foreach ($regexList as $offset => $regex) {
|
||||
while (preg_match($regex, $matchedPathinfo, $matches)) {
|
||||
switch ($m = (int) $matches['MARK']) {
|
||||
default:
|
||||
$routes = array(
|
||||
27 => array(array('_route' => 'r1'), array('foo'), null, null),
|
||||
38 => array(array('_route' => 'r10'), array('foo'), null, null),
|
||||
46 => array(array('_route' => 'r100'), array('foo'), null, null),
|
||||
59 => array(array('_route' => 'r2'), array('foo'), null, null),
|
||||
70 => array(array('_route' => 'r20'), array('foo'), null, null),
|
||||
78 => array(array('_route' => 'r200'), array('foo'), null, null),
|
||||
);
|
||||
|
||||
list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
|
||||
|
||||
foreach ($vars as $i => $v) {
|
||||
if (isset($matches[1 + $i])) {
|
||||
$ret[$v] = $matches[1 + $i];
|
||||
}
|
||||
}
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (78 === $m) {
|
||||
break;
|
||||
}
|
||||
$regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
|
||||
$offset += strlen($m);
|
||||
}
|
||||
}
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
69
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher13.php
vendored
Normal file
69
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher13.php
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($rawPathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
$host = strtolower($context->getHost());
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
$matchedPathinfo = $host.'.'.$pathinfo;
|
||||
$regexList = array(
|
||||
0 => '{^(?'
|
||||
.'|(?i:([^\\.]++)\\.exampple\\.com)\\.(?'
|
||||
.'|/abc([^/]++)(?'
|
||||
.'|(*:56)'
|
||||
.')'
|
||||
.')'
|
||||
.')$}sD',
|
||||
);
|
||||
|
||||
foreach ($regexList as $offset => $regex) {
|
||||
while (preg_match($regex, $matchedPathinfo, $matches)) {
|
||||
switch ($m = (int) $matches['MARK']) {
|
||||
case 56:
|
||||
$matches = array('foo' => $matches[1] ?? null, 'foo' => $matches[2] ?? null);
|
||||
|
||||
// r1
|
||||
return $this->mergeDefaults(array('_route' => 'r1') + $matches, array());
|
||||
|
||||
// r2
|
||||
return $this->mergeDefaults(array('_route' => 'r2') + $matches, array());
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (56 === $m) {
|
||||
break;
|
||||
}
|
||||
$regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
|
||||
$offset += strlen($m);
|
||||
}
|
||||
}
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
284
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php
vendored
Normal file
284
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php
vendored
Normal file
@@ -0,0 +1,284 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($pathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
|
||||
return $ret;
|
||||
}
|
||||
if ($allow) {
|
||||
throw new MethodNotAllowedException(array_keys($allow));
|
||||
}
|
||||
if (!in_array($this->context->getMethod(), array('HEAD', 'GET'), true)) {
|
||||
// no-op
|
||||
} elseif ($allowSchemes) {
|
||||
redirect_scheme:
|
||||
$scheme = $this->context->getScheme();
|
||||
$this->context->setScheme(key($allowSchemes));
|
||||
try {
|
||||
if ($ret = $this->doMatch($pathinfo)) {
|
||||
return $this->redirect($pathinfo, $ret['_route'], $this->context->getScheme()) + $ret;
|
||||
}
|
||||
} finally {
|
||||
$this->context->setScheme($scheme);
|
||||
}
|
||||
} elseif ('/' !== $pathinfo) {
|
||||
$pathinfo = '/' !== $pathinfo[-1] ? $pathinfo.'/' : substr($pathinfo, 0, -1);
|
||||
if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
|
||||
return $this->redirect($pathinfo, $ret['_route']) + $ret;
|
||||
}
|
||||
if ($allowSchemes) {
|
||||
goto redirect_scheme;
|
||||
}
|
||||
}
|
||||
|
||||
throw new ResourceNotFoundException();
|
||||
}
|
||||
|
||||
private function doMatch(string $rawPathinfo, array &$allow = array(), array &$allowSchemes = array()): ?array
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
$host = strtolower($context->getHost());
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
switch ($pathinfo) {
|
||||
default:
|
||||
$routes = array(
|
||||
'/test/baz' => array(array('_route' => 'baz'), null, null, null),
|
||||
'/test/baz.html' => array(array('_route' => 'baz2'), null, null, null),
|
||||
'/test/baz3/' => array(array('_route' => 'baz3'), null, null, null),
|
||||
'/foofoo' => array(array('_route' => 'foofoo', 'def' => 'test'), null, null, null),
|
||||
'/spa ce' => array(array('_route' => 'space'), null, null, null),
|
||||
'/multi/new' => array(array('_route' => 'overridden2'), null, null, null),
|
||||
'/multi/hey/' => array(array('_route' => 'hey'), null, null, null),
|
||||
'/ababa' => array(array('_route' => 'ababa'), null, null, null),
|
||||
'/route1' => array(array('_route' => 'route1'), 'a.example.com', null, null),
|
||||
'/c2/route2' => array(array('_route' => 'route2'), 'a.example.com', null, null),
|
||||
'/route4' => array(array('_route' => 'route4'), 'a.example.com', null, null),
|
||||
'/c2/route3' => array(array('_route' => 'route3'), 'b.example.com', null, null),
|
||||
'/route5' => array(array('_route' => 'route5'), 'c.example.com', null, null),
|
||||
'/route6' => array(array('_route' => 'route6'), null, null, null),
|
||||
'/route11' => array(array('_route' => 'route11'), '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null),
|
||||
'/route12' => array(array('_route' => 'route12', 'var1' => 'val'), '#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', null, null),
|
||||
'/route17' => array(array('_route' => 'route17'), null, null, null),
|
||||
'/secure' => array(array('_route' => 'secure'), null, null, array('https' => 0)),
|
||||
'/nonsecure' => array(array('_route' => 'nonsecure'), null, null, array('http' => 0)),
|
||||
);
|
||||
|
||||
if (!isset($routes[$pathinfo])) {
|
||||
break;
|
||||
}
|
||||
list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
|
||||
|
||||
if ($requiredHost) {
|
||||
if ('#' !== $requiredHost[0] ? $requiredHost !== $host : !preg_match($requiredHost, $host, $hostMatches)) {
|
||||
break;
|
||||
}
|
||||
if ('#' === $requiredHost[0] && $hostMatches) {
|
||||
$hostMatches['_route'] = $ret['_route'];
|
||||
$ret = $this->mergeDefaults($hostMatches, $ret);
|
||||
}
|
||||
}
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$matchedPathinfo = $host.'.'.$pathinfo;
|
||||
$regexList = array(
|
||||
0 => '{^(?'
|
||||
.'|(?:(?:[^./]*+\\.)++)(?'
|
||||
.'|/foo/(baz|symfony)(*:47)'
|
||||
.'|/bar(?'
|
||||
.'|/([^/]++)(*:70)'
|
||||
.'|head/([^/]++)(*:90)'
|
||||
.')'
|
||||
.'|/test/([^/]++)/(?'
|
||||
.'|(*:116)'
|
||||
.')'
|
||||
.'|/([\']+)(*:132)'
|
||||
.'|/a/(?'
|
||||
.'|b\'b/([^/]++)(?'
|
||||
.'|(*:161)'
|
||||
.'|(*:169)'
|
||||
.')'
|
||||
.'|(.*)(*:182)'
|
||||
.'|b\'b/([^/]++)(?'
|
||||
.'|(*:205)'
|
||||
.'|(*:213)'
|
||||
.')'
|
||||
.')'
|
||||
.'|/multi/hello(?:/([^/]++))?(*:249)'
|
||||
.'|/([^/]++)/b/([^/]++)(?'
|
||||
.'|(*:280)'
|
||||
.'|(*:288)'
|
||||
.')'
|
||||
.'|/aba/([^/]++)(*:310)'
|
||||
.')|(?i:([^\\.]++)\\.example\\.com)\\.(?'
|
||||
.'|/route1(?'
|
||||
.'|3/([^/]++)(*:372)'
|
||||
.'|4/([^/]++)(*:390)'
|
||||
.')'
|
||||
.')|(?i:c\\.example\\.com)\\.(?'
|
||||
.'|/route15/([^/]++)(*:442)'
|
||||
.')|(?:(?:[^./]*+\\.)++)(?'
|
||||
.'|/route16/([^/]++)(*:490)'
|
||||
.'|/a/(?'
|
||||
.'|a\\.\\.\\.(*:511)'
|
||||
.'|b/(?'
|
||||
.'|([^/]++)(*:532)'
|
||||
.'|c/([^/]++)(*:550)'
|
||||
.')'
|
||||
.')'
|
||||
.')'
|
||||
.')$}sD',
|
||||
);
|
||||
|
||||
foreach ($regexList as $offset => $regex) {
|
||||
while (preg_match($regex, $matchedPathinfo, $matches)) {
|
||||
switch ($m = (int) $matches['MARK']) {
|
||||
case 116:
|
||||
$matches = array('foo' => $matches[1] ?? null);
|
||||
|
||||
// baz4
|
||||
return $this->mergeDefaults(array('_route' => 'baz4') + $matches, array());
|
||||
|
||||
// baz5
|
||||
$ret = $this->mergeDefaults(array('_route' => 'baz5') + $matches, array());
|
||||
if (!isset(($a = array('POST' => 0))[$requestMethod])) {
|
||||
$allow += $a;
|
||||
goto not_baz5;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
not_baz5:
|
||||
|
||||
// baz.baz6
|
||||
$ret = $this->mergeDefaults(array('_route' => 'baz.baz6') + $matches, array());
|
||||
if (!isset(($a = array('PUT' => 0))[$requestMethod])) {
|
||||
$allow += $a;
|
||||
goto not_bazbaz6;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
not_bazbaz6:
|
||||
|
||||
break;
|
||||
case 161:
|
||||
$matches = array('foo' => $matches[1] ?? null);
|
||||
|
||||
// foo1
|
||||
$ret = $this->mergeDefaults(array('_route' => 'foo1') + $matches, array());
|
||||
if (!isset(($a = array('PUT' => 0))[$requestMethod])) {
|
||||
$allow += $a;
|
||||
goto not_foo1;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
not_foo1:
|
||||
|
||||
break;
|
||||
case 205:
|
||||
$matches = array('foo1' => $matches[1] ?? null);
|
||||
|
||||
// foo2
|
||||
return $this->mergeDefaults(array('_route' => 'foo2') + $matches, array());
|
||||
|
||||
break;
|
||||
case 280:
|
||||
$matches = array('_locale' => $matches[1] ?? null, 'foo' => $matches[2] ?? null);
|
||||
|
||||
// foo3
|
||||
return $this->mergeDefaults(array('_route' => 'foo3') + $matches, array());
|
||||
|
||||
break;
|
||||
default:
|
||||
$routes = array(
|
||||
47 => array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null),
|
||||
70 => array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null),
|
||||
90 => array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null),
|
||||
132 => array(array('_route' => 'quoter'), array('quoter'), null, null),
|
||||
169 => array(array('_route' => 'bar1'), array('bar'), null, null),
|
||||
182 => array(array('_route' => 'overridden'), array('var'), null, null),
|
||||
213 => array(array('_route' => 'bar2'), array('bar1'), null, null),
|
||||
249 => array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null),
|
||||
288 => array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null),
|
||||
310 => array(array('_route' => 'foo4'), array('foo'), null, null),
|
||||
372 => array(array('_route' => 'route13'), array('var1', 'name'), null, null),
|
||||
390 => array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null),
|
||||
442 => array(array('_route' => 'route15'), array('name'), null, null),
|
||||
490 => array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null),
|
||||
511 => array(array('_route' => 'a'), array(), null, null),
|
||||
532 => array(array('_route' => 'b'), array('var'), null, null),
|
||||
550 => array(array('_route' => 'c'), array('var'), null, null),
|
||||
);
|
||||
|
||||
list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
|
||||
|
||||
foreach ($vars as $i => $v) {
|
||||
if (isset($matches[1 + $i])) {
|
||||
$ret[$v] = $matches[1 + $i];
|
||||
}
|
||||
}
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (550 === $m) {
|
||||
break;
|
||||
}
|
||||
$regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
|
||||
$offset += strlen($m);
|
||||
}
|
||||
}
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
112
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php
vendored
Normal file
112
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($rawPathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
switch ($pathinfo) {
|
||||
case '/with-condition':
|
||||
// with-condition
|
||||
if (($context->getMethod() == "GET")) {
|
||||
return array('_route' => 'with-condition');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$routes = array(
|
||||
'/rootprefix/test' => array(array('_route' => 'static'), null, null, null),
|
||||
);
|
||||
|
||||
if (!isset($routes[$pathinfo])) {
|
||||
break;
|
||||
}
|
||||
list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$matchedPathinfo = $pathinfo;
|
||||
$regexList = array(
|
||||
0 => '{^(?'
|
||||
.'|/rootprefix/([^/]++)(*:27)'
|
||||
.')$}sD',
|
||||
);
|
||||
|
||||
foreach ($regexList as $offset => $regex) {
|
||||
while (preg_match($regex, $matchedPathinfo, $matches)) {
|
||||
switch ($m = (int) $matches['MARK']) {
|
||||
default:
|
||||
$routes = array(
|
||||
27 => array(array('_route' => 'dynamic'), array('var'), null, null),
|
||||
);
|
||||
|
||||
list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
|
||||
|
||||
foreach ($vars as $i => $v) {
|
||||
if (isset($matches[1 + $i])) {
|
||||
$ret[$v] = $matches[1 + $i];
|
||||
}
|
||||
}
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (27 === $m) {
|
||||
break;
|
||||
}
|
||||
$regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
|
||||
$offset += strlen($m);
|
||||
}
|
||||
}
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
84
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher4.php
vendored
Normal file
84
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher4.php
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($rawPathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
switch ($pathinfo) {
|
||||
case '/put_and_post':
|
||||
// put_and_post
|
||||
$ret = array('_route' => 'put_and_post');
|
||||
if (!isset(($a = array('PUT' => 0, 'POST' => 1))[$requestMethod])) {
|
||||
$allow += $a;
|
||||
goto not_put_and_post;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
not_put_and_post:
|
||||
// put_and_get_and_head
|
||||
$ret = array('_route' => 'put_and_get_and_head');
|
||||
if (!isset(($a = array('PUT' => 0, 'GET' => 1, 'HEAD' => 2))[$canonicalMethod])) {
|
||||
$allow += $a;
|
||||
goto not_put_and_get_and_head;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
not_put_and_get_and_head:
|
||||
break;
|
||||
default:
|
||||
$routes = array(
|
||||
'/just_head' => array(array('_route' => 'just_head'), null, array('HEAD' => 0), null),
|
||||
'/head_and_get' => array(array('_route' => 'head_and_get'), null, array('HEAD' => 0, 'GET' => 1), null),
|
||||
'/get_and_head' => array(array('_route' => 'get_and_head'), null, array('GET' => 0, 'HEAD' => 1), null),
|
||||
'/post_and_head' => array(array('_route' => 'post_and_head'), null, array('POST' => 0, 'HEAD' => 1), null),
|
||||
);
|
||||
|
||||
if (!isset($routes[$pathinfo])) {
|
||||
break;
|
||||
}
|
||||
list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
154
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher5.php
vendored
Normal file
154
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher5.php
vendored
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($pathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
|
||||
return $ret;
|
||||
}
|
||||
if ($allow) {
|
||||
throw new MethodNotAllowedException(array_keys($allow));
|
||||
}
|
||||
if (!in_array($this->context->getMethod(), array('HEAD', 'GET'), true)) {
|
||||
// no-op
|
||||
} elseif ($allowSchemes) {
|
||||
redirect_scheme:
|
||||
$scheme = $this->context->getScheme();
|
||||
$this->context->setScheme(key($allowSchemes));
|
||||
try {
|
||||
if ($ret = $this->doMatch($pathinfo)) {
|
||||
return $this->redirect($pathinfo, $ret['_route'], $this->context->getScheme()) + $ret;
|
||||
}
|
||||
} finally {
|
||||
$this->context->setScheme($scheme);
|
||||
}
|
||||
} elseif ('/' !== $pathinfo) {
|
||||
$pathinfo = '/' !== $pathinfo[-1] ? $pathinfo.'/' : substr($pathinfo, 0, -1);
|
||||
if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
|
||||
return $this->redirect($pathinfo, $ret['_route']) + $ret;
|
||||
}
|
||||
if ($allowSchemes) {
|
||||
goto redirect_scheme;
|
||||
}
|
||||
}
|
||||
|
||||
throw new ResourceNotFoundException();
|
||||
}
|
||||
|
||||
private function doMatch(string $rawPathinfo, array &$allow = array(), array &$allowSchemes = array()): ?array
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
switch ($pathinfo) {
|
||||
default:
|
||||
$routes = array(
|
||||
'/a/11' => array(array('_route' => 'a_first'), null, null, null),
|
||||
'/a/22' => array(array('_route' => 'a_second'), null, null, null),
|
||||
'/a/333' => array(array('_route' => 'a_third'), null, null, null),
|
||||
'/a/44/' => array(array('_route' => 'a_fourth'), null, null, null),
|
||||
'/a/55/' => array(array('_route' => 'a_fifth'), null, null, null),
|
||||
'/a/66/' => array(array('_route' => 'a_sixth'), null, null, null),
|
||||
'/nested/group/a/' => array(array('_route' => 'nested_a'), null, null, null),
|
||||
'/nested/group/b/' => array(array('_route' => 'nested_b'), null, null, null),
|
||||
'/nested/group/c/' => array(array('_route' => 'nested_c'), null, null, null),
|
||||
'/slashed/group/' => array(array('_route' => 'slashed_a'), null, null, null),
|
||||
'/slashed/group/b/' => array(array('_route' => 'slashed_b'), null, null, null),
|
||||
'/slashed/group/c/' => array(array('_route' => 'slashed_c'), null, null, null),
|
||||
);
|
||||
|
||||
if (!isset($routes[$pathinfo])) {
|
||||
break;
|
||||
}
|
||||
list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$matchedPathinfo = $pathinfo;
|
||||
$regexList = array(
|
||||
0 => '{^(?'
|
||||
.'|/([^/]++)(*:16)'
|
||||
.'|/nested/([^/]++)(*:39)'
|
||||
.')$}sD',
|
||||
);
|
||||
|
||||
foreach ($regexList as $offset => $regex) {
|
||||
while (preg_match($regex, $matchedPathinfo, $matches)) {
|
||||
switch ($m = (int) $matches['MARK']) {
|
||||
default:
|
||||
$routes = array(
|
||||
16 => array(array('_route' => 'a_wildcard'), array('param'), null, null),
|
||||
39 => array(array('_route' => 'nested_wildcard'), array('param'), null, null),
|
||||
);
|
||||
|
||||
list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
|
||||
|
||||
foreach ($vars as $i => $v) {
|
||||
if (isset($matches[1 + $i])) {
|
||||
$ret[$v] = $matches[1 + $i];
|
||||
}
|
||||
}
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (39 === $m) {
|
||||
break;
|
||||
}
|
||||
$regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
|
||||
$offset += strlen($m);
|
||||
}
|
||||
}
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
131
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher6.php
vendored
Normal file
131
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher6.php
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($rawPathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
switch ($pathinfo) {
|
||||
default:
|
||||
$routes = array(
|
||||
'/trailing/simple/no-methods/' => array(array('_route' => 'simple_trailing_slash_no_methods'), null, null, null),
|
||||
'/trailing/simple/get-method/' => array(array('_route' => 'simple_trailing_slash_GET_method'), null, array('GET' => 0), null),
|
||||
'/trailing/simple/head-method/' => array(array('_route' => 'simple_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null),
|
||||
'/trailing/simple/post-method/' => array(array('_route' => 'simple_trailing_slash_POST_method'), null, array('POST' => 0), null),
|
||||
'/not-trailing/simple/no-methods' => array(array('_route' => 'simple_not_trailing_slash_no_methods'), null, null, null),
|
||||
'/not-trailing/simple/get-method' => array(array('_route' => 'simple_not_trailing_slash_GET_method'), null, array('GET' => 0), null),
|
||||
'/not-trailing/simple/head-method' => array(array('_route' => 'simple_not_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null),
|
||||
'/not-trailing/simple/post-method' => array(array('_route' => 'simple_not_trailing_slash_POST_method'), null, array('POST' => 0), null),
|
||||
);
|
||||
|
||||
if (!isset($routes[$pathinfo])) {
|
||||
break;
|
||||
}
|
||||
list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$matchedPathinfo = $pathinfo;
|
||||
$regexList = array(
|
||||
0 => '{^(?'
|
||||
.'|/trailing/regex/(?'
|
||||
.'|no\\-methods/([^/]++)/(*:47)'
|
||||
.'|get\\-method/([^/]++)/(*:75)'
|
||||
.'|head\\-method/([^/]++)/(*:104)'
|
||||
.'|post\\-method/([^/]++)/(*:134)'
|
||||
.')'
|
||||
.'|/not\\-trailing/regex/(?'
|
||||
.'|no\\-methods/([^/]++)(*:187)'
|
||||
.'|get\\-method/([^/]++)(*:215)'
|
||||
.'|head\\-method/([^/]++)(*:244)'
|
||||
.'|post\\-method/([^/]++)(*:273)'
|
||||
.')'
|
||||
.')$}sD',
|
||||
);
|
||||
|
||||
foreach ($regexList as $offset => $regex) {
|
||||
while (preg_match($regex, $matchedPathinfo, $matches)) {
|
||||
switch ($m = (int) $matches['MARK']) {
|
||||
default:
|
||||
$routes = array(
|
||||
47 => array(array('_route' => 'regex_trailing_slash_no_methods'), array('param'), null, null),
|
||||
75 => array(array('_route' => 'regex_trailing_slash_GET_method'), array('param'), array('GET' => 0), null),
|
||||
104 => array(array('_route' => 'regex_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null),
|
||||
134 => array(array('_route' => 'regex_trailing_slash_POST_method'), array('param'), array('POST' => 0), null),
|
||||
187 => array(array('_route' => 'regex_not_trailing_slash_no_methods'), array('param'), null, null),
|
||||
215 => array(array('_route' => 'regex_not_trailing_slash_GET_method'), array('param'), array('GET' => 0), null),
|
||||
244 => array(array('_route' => 'regex_not_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null),
|
||||
273 => array(array('_route' => 'regex_not_trailing_slash_POST_method'), array('param'), array('POST' => 0), null),
|
||||
);
|
||||
|
||||
list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
|
||||
|
||||
foreach ($vars as $i => $v) {
|
||||
if (isset($matches[1 + $i])) {
|
||||
$ret[$v] = $matches[1 + $i];
|
||||
}
|
||||
}
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (273 === $m) {
|
||||
break;
|
||||
}
|
||||
$regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
|
||||
$offset += strlen($m);
|
||||
}
|
||||
}
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
166
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher7.php
vendored
Normal file
166
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher7.php
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($pathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
|
||||
return $ret;
|
||||
}
|
||||
if ($allow) {
|
||||
throw new MethodNotAllowedException(array_keys($allow));
|
||||
}
|
||||
if (!in_array($this->context->getMethod(), array('HEAD', 'GET'), true)) {
|
||||
// no-op
|
||||
} elseif ($allowSchemes) {
|
||||
redirect_scheme:
|
||||
$scheme = $this->context->getScheme();
|
||||
$this->context->setScheme(key($allowSchemes));
|
||||
try {
|
||||
if ($ret = $this->doMatch($pathinfo)) {
|
||||
return $this->redirect($pathinfo, $ret['_route'], $this->context->getScheme()) + $ret;
|
||||
}
|
||||
} finally {
|
||||
$this->context->setScheme($scheme);
|
||||
}
|
||||
} elseif ('/' !== $pathinfo) {
|
||||
$pathinfo = '/' !== $pathinfo[-1] ? $pathinfo.'/' : substr($pathinfo, 0, -1);
|
||||
if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
|
||||
return $this->redirect($pathinfo, $ret['_route']) + $ret;
|
||||
}
|
||||
if ($allowSchemes) {
|
||||
goto redirect_scheme;
|
||||
}
|
||||
}
|
||||
|
||||
throw new ResourceNotFoundException();
|
||||
}
|
||||
|
||||
private function doMatch(string $rawPathinfo, array &$allow = array(), array &$allowSchemes = array()): ?array
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
switch ($pathinfo) {
|
||||
default:
|
||||
$routes = array(
|
||||
'/trailing/simple/no-methods/' => array(array('_route' => 'simple_trailing_slash_no_methods'), null, null, null),
|
||||
'/trailing/simple/get-method/' => array(array('_route' => 'simple_trailing_slash_GET_method'), null, array('GET' => 0), null),
|
||||
'/trailing/simple/head-method/' => array(array('_route' => 'simple_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null),
|
||||
'/trailing/simple/post-method/' => array(array('_route' => 'simple_trailing_slash_POST_method'), null, array('POST' => 0), null),
|
||||
'/not-trailing/simple/no-methods' => array(array('_route' => 'simple_not_trailing_slash_no_methods'), null, null, null),
|
||||
'/not-trailing/simple/get-method' => array(array('_route' => 'simple_not_trailing_slash_GET_method'), null, array('GET' => 0), null),
|
||||
'/not-trailing/simple/head-method' => array(array('_route' => 'simple_not_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null),
|
||||
'/not-trailing/simple/post-method' => array(array('_route' => 'simple_not_trailing_slash_POST_method'), null, array('POST' => 0), null),
|
||||
);
|
||||
|
||||
if (!isset($routes[$pathinfo])) {
|
||||
break;
|
||||
}
|
||||
list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$matchedPathinfo = $pathinfo;
|
||||
$regexList = array(
|
||||
0 => '{^(?'
|
||||
.'|/trailing/regex/(?'
|
||||
.'|no\\-methods/([^/]++)/(*:47)'
|
||||
.'|get\\-method/([^/]++)/(*:75)'
|
||||
.'|head\\-method/([^/]++)/(*:104)'
|
||||
.'|post\\-method/([^/]++)/(*:134)'
|
||||
.')'
|
||||
.'|/not\\-trailing/regex/(?'
|
||||
.'|no\\-methods/([^/]++)(*:187)'
|
||||
.'|get\\-method/([^/]++)(*:215)'
|
||||
.'|head\\-method/([^/]++)(*:244)'
|
||||
.'|post\\-method/([^/]++)(*:273)'
|
||||
.')'
|
||||
.')$}sD',
|
||||
);
|
||||
|
||||
foreach ($regexList as $offset => $regex) {
|
||||
while (preg_match($regex, $matchedPathinfo, $matches)) {
|
||||
switch ($m = (int) $matches['MARK']) {
|
||||
default:
|
||||
$routes = array(
|
||||
47 => array(array('_route' => 'regex_trailing_slash_no_methods'), array('param'), null, null),
|
||||
75 => array(array('_route' => 'regex_trailing_slash_GET_method'), array('param'), array('GET' => 0), null),
|
||||
104 => array(array('_route' => 'regex_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null),
|
||||
134 => array(array('_route' => 'regex_trailing_slash_POST_method'), array('param'), array('POST' => 0), null),
|
||||
187 => array(array('_route' => 'regex_not_trailing_slash_no_methods'), array('param'), null, null),
|
||||
215 => array(array('_route' => 'regex_not_trailing_slash_GET_method'), array('param'), array('GET' => 0), null),
|
||||
244 => array(array('_route' => 'regex_not_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null),
|
||||
273 => array(array('_route' => 'regex_not_trailing_slash_POST_method'), array('param'), array('POST' => 0), null),
|
||||
);
|
||||
|
||||
list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
|
||||
|
||||
foreach ($vars as $i => $v) {
|
||||
if (isset($matches[1 + $i])) {
|
||||
$ret[$v] = $matches[1 + $i];
|
||||
}
|
||||
}
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (273 === $m) {
|
||||
break;
|
||||
}
|
||||
$regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
|
||||
$offset += strlen($m);
|
||||
}
|
||||
}
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
88
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher8.php
vendored
Normal file
88
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher8.php
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($rawPathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
$matchedPathinfo = $pathinfo;
|
||||
$regexList = array(
|
||||
0 => '{^(?'
|
||||
.'|/(a)(*:11)'
|
||||
.')$}sD',
|
||||
11 => '{^(?'
|
||||
.'|/(.)(*:22)'
|
||||
.')$}sDu',
|
||||
22 => '{^(?'
|
||||
.'|/(.)(*:33)'
|
||||
.')$}sD',
|
||||
);
|
||||
|
||||
foreach ($regexList as $offset => $regex) {
|
||||
while (preg_match($regex, $matchedPathinfo, $matches)) {
|
||||
switch ($m = (int) $matches['MARK']) {
|
||||
default:
|
||||
$routes = array(
|
||||
11 => array(array('_route' => 'a'), array('a'), null, null),
|
||||
22 => array(array('_route' => 'b'), array('a'), null, null),
|
||||
33 => array(array('_route' => 'c'), array('a'), null, null),
|
||||
);
|
||||
|
||||
list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
|
||||
|
||||
foreach ($vars as $i => $v) {
|
||||
if (isset($matches[1 + $i])) {
|
||||
$ret[$v] = $matches[1 + $i];
|
||||
}
|
||||
}
|
||||
|
||||
$hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
|
||||
if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
|
||||
if ($hasRequiredScheme) {
|
||||
$allow += $requiredMethods;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!$hasRequiredScheme) {
|
||||
$allowSchemes += $requiredSchemes;
|
||||
break;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (33 === $m) {
|
||||
break;
|
||||
}
|
||||
$regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
|
||||
$offset += strlen($m);
|
||||
}
|
||||
}
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
53
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher9.php
vendored
Normal file
53
vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher9.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
|
||||
use Symfony\Component\Routing\RequestContext;
|
||||
|
||||
/**
|
||||
* This class has been auto-generated
|
||||
* by the Symfony Routing Component.
|
||||
*/
|
||||
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
{
|
||||
public function __construct(RequestContext $context)
|
||||
{
|
||||
$this->context = $context;
|
||||
}
|
||||
|
||||
public function match($rawPathinfo)
|
||||
{
|
||||
$allow = $allowSchemes = array();
|
||||
$pathinfo = rawurldecode($rawPathinfo);
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
$host = strtolower($context->getHost());
|
||||
|
||||
if ('HEAD' === $requestMethod) {
|
||||
$canonicalMethod = 'GET';
|
||||
}
|
||||
|
||||
switch ($pathinfo) {
|
||||
case '/':
|
||||
// a
|
||||
if (preg_match('#^(?P<d>[^\\.]++)\\.e\\.c\\.b\\.a$#sDi', $host, $hostMatches)) {
|
||||
return $this->mergeDefaults(array('_route' => 'a') + $hostMatches, array());
|
||||
}
|
||||
// c
|
||||
if (preg_match('#^(?P<e>[^\\.]++)\\.e\\.c\\.b\\.a$#sDi', $host, $hostMatches)) {
|
||||
return $this->mergeDefaults(array('_route' => 'c') + $hostMatches, array());
|
||||
}
|
||||
// b
|
||||
if ('d.c.b.a' === $host) {
|
||||
return array('_route' => 'b');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ('/' === $pathinfo && !$allow && !$allowSchemes) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
0
vendor/symfony/routing/Tests/Fixtures/empty.yml
vendored
Normal file
0
vendor/symfony/routing/Tests/Fixtures/empty.yml
vendored
Normal file
0
vendor/symfony/routing/Tests/Fixtures/file_resource.yml
vendored
Normal file
0
vendor/symfony/routing/Tests/Fixtures/file_resource.yml
vendored
Normal file
0
vendor/symfony/routing/Tests/Fixtures/foo.xml
vendored
Normal file
0
vendor/symfony/routing/Tests/Fixtures/foo.xml
vendored
Normal file
0
vendor/symfony/routing/Tests/Fixtures/foo1.xml
vendored
Normal file
0
vendor/symfony/routing/Tests/Fixtures/foo1.xml
vendored
Normal file
8
vendor/symfony/routing/Tests/Fixtures/glob/bar.xml
vendored
Normal file
8
vendor/symfony/routing/Tests/Fixtures/glob/bar.xml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<route id="bar_route" path="/bar" controller="AppBundle:Bar:view" />
|
||||
</routes>
|
||||
4
vendor/symfony/routing/Tests/Fixtures/glob/bar.yml
vendored
Normal file
4
vendor/symfony/routing/Tests/Fixtures/glob/bar.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
bar_route:
|
||||
path: /bar
|
||||
defaults:
|
||||
_controller: AppBundle:Bar:view
|
||||
8
vendor/symfony/routing/Tests/Fixtures/glob/baz.xml
vendored
Normal file
8
vendor/symfony/routing/Tests/Fixtures/glob/baz.xml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<route id="baz_route" path="/baz" controller="AppBundle:Baz:view" />
|
||||
</routes>
|
||||
4
vendor/symfony/routing/Tests/Fixtures/glob/baz.yml
vendored
Normal file
4
vendor/symfony/routing/Tests/Fixtures/glob/baz.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
baz_route:
|
||||
path: /baz
|
||||
defaults:
|
||||
_controller: AppBundle:Baz:view
|
||||
8
vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.xml
vendored
Normal file
8
vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.xml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<import resource="ba?.xml" />
|
||||
</routes>
|
||||
2
vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.yml
vendored
Normal file
2
vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
_static:
|
||||
resource: ba?.yml
|
||||
8
vendor/symfony/routing/Tests/Fixtures/glob/import_single.xml
vendored
Normal file
8
vendor/symfony/routing/Tests/Fixtures/glob/import_single.xml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<import resource="b?r.xml" />
|
||||
</routes>
|
||||
2
vendor/symfony/routing/Tests/Fixtures/glob/import_single.yml
vendored
Normal file
2
vendor/symfony/routing/Tests/Fixtures/glob/import_single.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
_static:
|
||||
resource: b?r.yml
|
||||
7
vendor/symfony/routing/Tests/Fixtures/glob/php_dsl.php
vendored
Normal file
7
vendor/symfony/routing/Tests/Fixtures/glob/php_dsl.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Loader\Configurator;
|
||||
|
||||
return function (RoutingConfigurator $routes) {
|
||||
return $routes->import('php_dsl_ba?.php');
|
||||
};
|
||||
12
vendor/symfony/routing/Tests/Fixtures/glob/php_dsl_bar.php
vendored
Normal file
12
vendor/symfony/routing/Tests/Fixtures/glob/php_dsl_bar.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Loader\Configurator;
|
||||
|
||||
return function (RoutingConfigurator $routes) {
|
||||
$collection = $routes->collection();
|
||||
|
||||
$collection->add('bar_route', '/bar')
|
||||
->defaults(array('_controller' => 'AppBundle:Bar:view'));
|
||||
|
||||
return $collection;
|
||||
};
|
||||
12
vendor/symfony/routing/Tests/Fixtures/glob/php_dsl_baz.php
vendored
Normal file
12
vendor/symfony/routing/Tests/Fixtures/glob/php_dsl_baz.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\Routing\Loader\Configurator;
|
||||
|
||||
return function (RoutingConfigurator $routes) {
|
||||
$collection = $routes->collection();
|
||||
|
||||
$collection->add('baz_route', '/baz')
|
||||
->defaults(array('_controller' => 'AppBundle:Baz:view'));
|
||||
|
||||
return $collection;
|
||||
};
|
||||
10
vendor/symfony/routing/Tests/Fixtures/import_with_name_prefix/routing.xml
vendored
Normal file
10
vendor/symfony/routing/Tests/Fixtures/import_with_name_prefix/routing.xml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<import resource="../controller/routing.xml" />
|
||||
<import resource="../controller/routing.xml" prefix="/api" name-prefix="api_" />
|
||||
|
||||
</routes>
|
||||
7
vendor/symfony/routing/Tests/Fixtures/import_with_name_prefix/routing.yml
vendored
Normal file
7
vendor/symfony/routing/Tests/Fixtures/import_with_name_prefix/routing.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
app:
|
||||
resource: ../controller/routing.yml
|
||||
|
||||
api:
|
||||
resource: ../controller/routing.yml
|
||||
name_prefix: api_
|
||||
prefix: /api
|
||||
10
vendor/symfony/routing/Tests/Fixtures/import_with_no_trailing_slash/routing.xml
vendored
Normal file
10
vendor/symfony/routing/Tests/Fixtures/import_with_no_trailing_slash/routing.xml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<import resource="../controller/routing.xml" prefix="/slash" name-prefix="a_" />
|
||||
<import resource="../controller/routing.xml" prefix="/no-slash" name-prefix="b_" trailing-slash-on-root="false" />
|
||||
|
||||
</routes>
|
||||
10
vendor/symfony/routing/Tests/Fixtures/import_with_no_trailing_slash/routing.yml
vendored
Normal file
10
vendor/symfony/routing/Tests/Fixtures/import_with_no_trailing_slash/routing.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
app:
|
||||
resource: ../controller/routing.yml
|
||||
name_prefix: a_
|
||||
prefix: /slash
|
||||
|
||||
api:
|
||||
resource: ../controller/routing.yml
|
||||
name_prefix: b_
|
||||
prefix: /no-slash
|
||||
trailing_slash_on_root: false
|
||||
2
vendor/symfony/routing/Tests/Fixtures/incomplete.yml
vendored
Normal file
2
vendor/symfony/routing/Tests/Fixtures/incomplete.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
blog_show:
|
||||
defaults: { _controller: MyBlogBundle:Blog:show }
|
||||
20
vendor/symfony/routing/Tests/Fixtures/list_defaults.xml
vendored
Normal file
20
vendor/symfony/routing/Tests/Fixtures/list_defaults.xml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<route id="blog" path="/blog">
|
||||
<default key="_controller">
|
||||
<string>AcmeBlogBundle:Blog:index</string>
|
||||
</default>
|
||||
<default key="values">
|
||||
<list>
|
||||
<bool>true</bool>
|
||||
<int>1</int>
|
||||
<float>3.5</float>
|
||||
<string>foo</string>
|
||||
</list>
|
||||
</default>
|
||||
</route>
|
||||
</routes>
|
||||
22
vendor/symfony/routing/Tests/Fixtures/list_in_list_defaults.xml
vendored
Normal file
22
vendor/symfony/routing/Tests/Fixtures/list_in_list_defaults.xml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<route id="blog" path="/blog">
|
||||
<default key="_controller">
|
||||
<string>AcmeBlogBundle:Blog:index</string>
|
||||
</default>
|
||||
<default key="values">
|
||||
<list>
|
||||
<list>
|
||||
<bool>true</bool>
|
||||
<int>1</int>
|
||||
<float>3.5</float>
|
||||
<string>foo</string>
|
||||
</list>
|
||||
</list>
|
||||
</default>
|
||||
</route>
|
||||
</routes>
|
||||
22
vendor/symfony/routing/Tests/Fixtures/list_in_map_defaults.xml
vendored
Normal file
22
vendor/symfony/routing/Tests/Fixtures/list_in_map_defaults.xml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<route id="blog" path="/blog">
|
||||
<default key="_controller">
|
||||
<string>AcmeBlogBundle:Blog:index</string>
|
||||
</default>
|
||||
<default key="values">
|
||||
<map>
|
||||
<list key="list">
|
||||
<bool>true</bool>
|
||||
<int>1</int>
|
||||
<float>3.5</float>
|
||||
<string>foo</string>
|
||||
</list>
|
||||
</map>
|
||||
</default>
|
||||
</route>
|
||||
</routes>
|
||||
22
vendor/symfony/routing/Tests/Fixtures/list_null_values.xml
vendored
Normal file
22
vendor/symfony/routing/Tests/Fixtures/list_null_values.xml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<route id="blog" path="/blog">
|
||||
<default key="_controller">
|
||||
<string>AcmeBlogBundle:Blog:index</string>
|
||||
</default>
|
||||
<default key="list">
|
||||
<list>
|
||||
<bool xsi:nil="true" />
|
||||
<int xsi:nil="true" />
|
||||
<float xsi:nil="1" />
|
||||
<string xsi:nil="true" />
|
||||
<list xsi:nil="true" />
|
||||
<map xsi:nil="true" />
|
||||
</list>
|
||||
</default>
|
||||
</route>
|
||||
</routes>
|
||||
13
vendor/symfony/routing/Tests/Fixtures/localized.xml
vendored
Normal file
13
vendor/symfony/routing/Tests/Fixtures/localized.xml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<route id="localized">
|
||||
<default key="_controller">MyBundle:Blog:show</default>
|
||||
<path locale="en">/path</path>
|
||||
<path locale="fr">/route</path>
|
||||
</route>
|
||||
|
||||
</routes>
|
||||
9
vendor/symfony/routing/Tests/Fixtures/localized/imported-with-locale-but-not-localized.xml
vendored
Normal file
9
vendor/symfony/routing/Tests/Fixtures/localized/imported-with-locale-but-not-localized.xml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
<route id="imported" path="/suffix">
|
||||
<default key="_controller">MyBundle:Blog:show</default>
|
||||
</route>
|
||||
</routes>
|
||||
4
vendor/symfony/routing/Tests/Fixtures/localized/imported-with-locale-but-not-localized.yml
vendored
Normal file
4
vendor/symfony/routing/Tests/Fixtures/localized/imported-with-locale-but-not-localized.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
imported:
|
||||
controller: ImportedController::someAction
|
||||
path: /imported
|
||||
11
vendor/symfony/routing/Tests/Fixtures/localized/imported-with-locale.xml
vendored
Normal file
11
vendor/symfony/routing/Tests/Fixtures/localized/imported-with-locale.xml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
<route id="imported">
|
||||
<default key="_controller">MyBundle:Blog:show</default>
|
||||
<path locale="en">/suffix</path>
|
||||
<path locale="fr">/le-suffix</path>
|
||||
</route>
|
||||
</routes>
|
||||
6
vendor/symfony/routing/Tests/Fixtures/localized/imported-with-locale.yml
vendored
Normal file
6
vendor/symfony/routing/Tests/Fixtures/localized/imported-with-locale.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
imported:
|
||||
controller: ImportedController::someAction
|
||||
path:
|
||||
nl: /voorbeeld
|
||||
en: /example
|
||||
5
vendor/symfony/routing/Tests/Fixtures/localized/importer-with-controller-default.yml
vendored
Normal file
5
vendor/symfony/routing/Tests/Fixtures/localized/importer-with-controller-default.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
i_need:
|
||||
defaults:
|
||||
_controller: DefaultController::defaultAction
|
||||
resource: ./localized-route.yml
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
<import resource="./imported-with-locale-but-not-localized.xml">
|
||||
<prefix locale="fr">/le-prefix</prefix>
|
||||
<prefix locale="en">/the-prefix</prefix>
|
||||
</import>
|
||||
</routes>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
i_need:
|
||||
resource: ./imported-with-locale-but-not-localized.yml
|
||||
prefix:
|
||||
nl: /nl
|
||||
en: /en
|
||||
10
vendor/symfony/routing/Tests/Fixtures/localized/importer-with-locale.xml
vendored
Normal file
10
vendor/symfony/routing/Tests/Fixtures/localized/importer-with-locale.xml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing
|
||||
http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
<import resource="./imported-with-locale.xml">
|
||||
<prefix locale="fr">/le-prefix</prefix>
|
||||
<prefix locale="en">/the-prefix</prefix>
|
||||
</import>
|
||||
</routes>
|
||||
6
vendor/symfony/routing/Tests/Fixtures/localized/importer-with-locale.yml
vendored
Normal file
6
vendor/symfony/routing/Tests/Fixtures/localized/importer-with-locale.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
i_need:
|
||||
resource: ./imported-with-locale.yml
|
||||
prefix:
|
||||
nl: /nl
|
||||
en: /en
|
||||
3
vendor/symfony/routing/Tests/Fixtures/localized/importing-localized-route.yml
vendored
Normal file
3
vendor/symfony/routing/Tests/Fixtures/localized/importing-localized-route.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
i_need:
|
||||
resource: ./localized-route.yml
|
||||
9
vendor/symfony/routing/Tests/Fixtures/localized/localized-route.yml
vendored
Normal file
9
vendor/symfony/routing/Tests/Fixtures/localized/localized-route.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
home:
|
||||
path:
|
||||
nl: /nl
|
||||
en: /en
|
||||
|
||||
not_localized:
|
||||
controller: HomeController::otherAction
|
||||
path: /here
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user