Update to Drupal 8.0.0 beta 14. For more information, see https://drupal.org/node/2544542
This commit is contained in:
parent
3b2511d96d
commit
81ccda77eb
2155 changed files with 54307 additions and 46870 deletions
core/vendor/symfony/routing
3
core/vendor/symfony/routing/.gitignore
vendored
Normal file
3
core/vendor/symfony/routing/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
vendor/
|
||||
composer.lock
|
||||
phpunit.xml
|
22
core/vendor/symfony/routing/Annotation/Route.php
vendored
22
core/vendor/symfony/routing/Annotation/Route.php
vendored
|
@ -48,7 +48,7 @@ class Route
|
|||
foreach ($data as $key => $value) {
|
||||
$method = 'set'.str_replace('_', '', $key);
|
||||
if (!method_exists($this, $method)) {
|
||||
throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this)));
|
||||
throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, get_class($this)));
|
||||
}
|
||||
$this->$method($value);
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ class Route
|
|||
*/
|
||||
public function setPattern($pattern)
|
||||
{
|
||||
trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the setPath() method instead and use the "path" option instead of the "pattern" option in the route definition.', E_USER_DEPRECATED);
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the setPath() method instead and use the "path" option instead of the "pattern" option in the route definition.', E_USER_DEPRECATED);
|
||||
|
||||
$this->path = $pattern;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ class Route
|
|||
*/
|
||||
public function getPattern()
|
||||
{
|
||||
trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the getPath() method instead and use the "path" option instead of the "pattern" option in the route definition.', E_USER_DEPRECATED);
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the getPath() method instead and use the "path" option instead of the "pattern" option in the route definition.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->path;
|
||||
}
|
||||
|
@ -106,6 +106,22 @@ class Route
|
|||
|
||||
public function setRequirements($requirements)
|
||||
{
|
||||
if (isset($requirements['_method'])) {
|
||||
if (0 === count($this->methods)) {
|
||||
$this->methods = explode('|', $requirements['_method']);
|
||||
}
|
||||
|
||||
@trigger_error('The "_method" requirement is deprecated since version 2.2 and will be removed in 3.0. Use the "methods" option instead.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
if (isset($requirements['_scheme'])) {
|
||||
if (0 === count($this->schemes)) {
|
||||
$this->schemes = explode('|', $requirements['_scheme']);
|
||||
}
|
||||
|
||||
@trigger_error('The "_scheme" requirement is deprecated since version 2.2 and will be removed in 3.0. Use the "schemes" option instead.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$this->requirements = $requirements;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ class XmlFileLoader extends FileLoader
|
|||
throw new \InvalidArgumentException(sprintf('The <route> element in file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path));
|
||||
}
|
||||
|
||||
trigger_error(sprintf('The "pattern" option in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead.', $path), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('The "pattern" option in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead.', $path), E_USER_DEPRECATED);
|
||||
|
||||
$node->setAttribute('path', $node->getAttribute('pattern'));
|
||||
$node->removeAttribute('pattern');
|
||||
|
@ -133,6 +133,24 @@ class XmlFileLoader extends FileLoader
|
|||
|
||||
list($defaults, $requirements, $options, $condition) = $this->parseConfigs($node, $path);
|
||||
|
||||
if (isset($requirements['_method'])) {
|
||||
if (0 === count($methods)) {
|
||||
$methods = explode('|', $requirements['_method']);
|
||||
}
|
||||
|
||||
unset($requirements['_method']);
|
||||
@trigger_error(sprintf('The "_method" requirement of route "%s" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "methods" attribute instead.', $id, $path), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
if (isset($requirements['_scheme'])) {
|
||||
if (0 === count($schemes)) {
|
||||
$schemes = explode('|', $requirements['_scheme']);
|
||||
}
|
||||
|
||||
unset($requirements['_scheme']);
|
||||
@trigger_error(sprintf('The "_scheme" requirement of route "%s" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "schemes" attribute instead.', $id, $path), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$route = new Route($node->getAttribute('path'), $defaults, $requirements, $options, $node->getAttribute('host'), $schemes, $methods, $condition);
|
||||
$collection->add($id, $route);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ class YamlFileLoader extends FileLoader
|
|||
throw new \InvalidArgumentException(sprintf('The file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path));
|
||||
}
|
||||
|
||||
trigger_error(sprintf('The "pattern" option in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead.', $path), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('The "pattern" option in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "path" option in the route definition instead.', $path), E_USER_DEPRECATED);
|
||||
|
||||
$config['path'] = $config['pattern'];
|
||||
unset($config['pattern']);
|
||||
|
@ -127,6 +127,24 @@ class YamlFileLoader extends FileLoader
|
|||
$methods = isset($config['methods']) ? $config['methods'] : array();
|
||||
$condition = isset($config['condition']) ? $config['condition'] : null;
|
||||
|
||||
if (isset($requirements['_method'])) {
|
||||
if (0 === count($methods)) {
|
||||
$methods = explode('|', $requirements['_method']);
|
||||
}
|
||||
|
||||
unset($requirements['_method']);
|
||||
@trigger_error(sprintf('The "_method" requirement of route "%s" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "methods" option instead.', $name, $path), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
if (isset($requirements['_scheme'])) {
|
||||
if (0 === count($schemes)) {
|
||||
$schemes = explode('|', $requirements['_scheme']);
|
||||
}
|
||||
|
||||
unset($requirements['_scheme']);
|
||||
@trigger_error(sprintf('The "_scheme" requirement of route "%s" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "schemes" option instead.', $name, $path), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$route = new Route($config['path'], $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
|
||||
|
||||
$collection->add($name, $route);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Symfony\Component\Routing\Matcher;
|
||||
|
||||
trigger_error('The '.__NAMESPACE__.'\ApacheUrlMatcher class is deprecated since version 2.5 and will be removed in 3.0. It\'s hard to replicate the behaviour of the PHP implementation and the performance gains are minimal.', E_USER_DEPRECATED);
|
||||
@trigger_error('The '.__NAMESPACE__.'\ApacheUrlMatcher class is deprecated since version 2.5 and will be removed in 3.0. It\'s hard to replicate the behaviour of the PHP implementation and the performance gains are minimal.', E_USER_DEPRECATED);
|
||||
|
||||
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Symfony\Component\Routing\Matcher\Dumper;
|
||||
|
||||
trigger_error('The '.__NAMESPACE__.'\ApacheMatcherDumper class is deprecated since version 2.5 and will be removed in 3.0. It\'s hard to replicate the behaviour of the PHP implementation and the performance gains are minimal.', E_USER_DEPRECATED);
|
||||
@trigger_error('The '.__NAMESPACE__.'\ApacheMatcherDumper class is deprecated since version 2.5 and will be removed in 3.0. It\'s hard to replicate the behaviour of the PHP implementation and the performance gains are minimal.', E_USER_DEPRECATED);
|
||||
|
||||
use Symfony\Component\Routing\Route;
|
||||
|
||||
|
|
|
@ -229,11 +229,11 @@ EOF;
|
|||
$conditions[] = sprintf("rtrim(\$pathinfo, '/') === %s", var_export(rtrim(str_replace('\\', '', $m['url']), '/'), true));
|
||||
$hasTrailingSlash = true;
|
||||
} else {
|
||||
$conditions[] = sprintf("\$pathinfo === %s", var_export(str_replace('\\', '', $m['url']), true));
|
||||
$conditions[] = sprintf('$pathinfo === %s', var_export(str_replace('\\', '', $m['url']), true));
|
||||
}
|
||||
} else {
|
||||
if ($compiledRoute->getStaticPrefix() && $compiledRoute->getStaticPrefix() !== $parentPrefix) {
|
||||
$conditions[] = sprintf("0 === strpos(\$pathinfo, %s)", var_export($compiledRoute->getStaticPrefix(), true));
|
||||
$conditions[] = sprintf('0 === strpos($pathinfo, %s)', var_export($compiledRoute->getStaticPrefix(), true));
|
||||
}
|
||||
|
||||
$regex = $compiledRoute->getRegex();
|
||||
|
@ -241,7 +241,7 @@ EOF;
|
|||
$regex = substr($regex, 0, $pos).'/?$'.substr($regex, $pos + 2);
|
||||
$hasTrailingSlash = true;
|
||||
}
|
||||
$conditions[] = sprintf("preg_match(%s, \$pathinfo, \$matches)", var_export($regex, true));
|
||||
$conditions[] = sprintf('preg_match(%s, $pathinfo, $matches)', var_export($regex, true));
|
||||
|
||||
$matches = true;
|
||||
}
|
||||
|
|
12
core/vendor/symfony/routing/Route.php
vendored
12
core/vendor/symfony/routing/Route.php
vendored
|
@ -151,7 +151,7 @@ class Route implements \Serializable
|
|||
*/
|
||||
public function getPattern()
|
||||
{
|
||||
trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the getPath() method instead.', E_USER_DEPRECATED);
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the getPath() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->path;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ class Route implements \Serializable
|
|||
*/
|
||||
public function setPattern($pattern)
|
||||
{
|
||||
trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the setPath() method instead.', E_USER_DEPRECATED);
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the setPath() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->setPath($pattern);
|
||||
}
|
||||
|
@ -549,9 +549,9 @@ class Route implements \Serializable
|
|||
public function getRequirement($key)
|
||||
{
|
||||
if ('_scheme' === $key) {
|
||||
trigger_error('The "_scheme" requirement is deprecated since version 2.2 and will be removed in 3.0. Use getSchemes() instead.', E_USER_DEPRECATED);
|
||||
@trigger_error('The "_scheme" requirement is deprecated since version 2.2 and will be removed in 3.0. Use getSchemes() instead.', E_USER_DEPRECATED);
|
||||
} elseif ('_method' === $key) {
|
||||
trigger_error('The "_method" requirement is deprecated since version 2.2 and will be removed in 3.0. Use getMethods() instead.', E_USER_DEPRECATED);
|
||||
@trigger_error('The "_method" requirement is deprecated since version 2.2 and will be removed in 3.0. Use getMethods() instead.', E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
return isset($this->requirements[$key]) ? $this->requirements[$key] : null;
|
||||
|
@ -655,11 +655,11 @@ class Route implements \Serializable
|
|||
|
||||
// this is to keep BC and will be removed in a future version
|
||||
if ('_scheme' === $key) {
|
||||
trigger_error('The "_scheme" requirement is deprecated since version 2.2 and will be removed in 3.0. Use the setSchemes() method instead or the "schemes" option in the route definition.', E_USER_DEPRECATED);
|
||||
@trigger_error('The "_scheme" requirement is deprecated since version 2.2 and will be removed in 3.0. Use the setSchemes() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
$this->setSchemes(explode('|', $regex));
|
||||
} elseif ('_method' === $key) {
|
||||
trigger_error('The "_method" requirement is deprecated since version 2.2 and will be removed in 3.0. Use the setMethods() method instead or the "methods" option in the route definition.', E_USER_DEPRECATED);
|
||||
@trigger_error('The "_method" requirement is deprecated since version 2.2 and will be removed in 3.0. Use the setMethods() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
$this->setMethods(explode('|', $regex));
|
||||
}
|
||||
|
|
|
@ -52,8 +52,6 @@ class RouteTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testLegacyGetPattern()
|
||||
{
|
||||
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
|
||||
|
||||
$route = new Route(array('value' => '/Blog'));
|
||||
$this->assertEquals($route->getPattern(), '/Blog');
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class PhpGeneratorDumperTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$this->routeCollection = new RouteCollection();
|
||||
$this->generatorDumper = new PhpGeneratorDumper($this->routeCollection);
|
||||
$this->testTmpFilepath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_generator.php';
|
||||
$this->testTmpFilepath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_generator.'.$this->getName().'.php';
|
||||
@unlink($this->testTmpFilepath);
|
||||
}
|
||||
|
||||
|
|
|
@ -461,8 +461,6 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testLegacyGenerateNetworkPath()
|
||||
{
|
||||
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
|
||||
|
||||
$routes = $this->getRoutes('test', new Route('/{name}', array(), array('_scheme' => 'http'), array(), '{locale}.example.com'));
|
||||
|
||||
$this->assertSame('//fr.example.com/app.php/Fabien', $this->getGenerator($routes)->generate('test',
|
||||
|
|
|
@ -50,8 +50,6 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testLegacyRouteDefinitionLoading()
|
||||
{
|
||||
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
|
||||
|
||||
$loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures')));
|
||||
$routeCollection = $loader->load('legacy_validpattern.xml');
|
||||
$route = $routeCollection->get('blog_show_legacy');
|
||||
|
|
|
@ -86,8 +86,6 @@ class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testLegacyRouteDefinitionLoading()
|
||||
{
|
||||
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
|
||||
|
||||
$loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures')));
|
||||
$routeCollection = $loader->load('legacy_validpattern.yml');
|
||||
$route = $routeCollection->get('blog_show_legacy');
|
||||
|
|
|
@ -27,11 +27,6 @@ class LegacyApacheMatcherDumperTest extends \PHPUnit_Framework_TestCase
|
|||
self::$fixturesPath = realpath(__DIR__.'/../../Fixtures/');
|
||||
}
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
public function testDump()
|
||||
{
|
||||
$dumper = new ApacheMatcherDumper($this->getRouteCollection());
|
||||
|
|
|
@ -24,7 +24,6 @@ class LegacyApacheUrlMatcherTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
|
||||
$this->server = $_SERVER;
|
||||
}
|
||||
|
||||
|
|
|
@ -169,8 +169,6 @@ class RouteTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testLegacySchemeRequirement()
|
||||
{
|
||||
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
|
||||
|
||||
$route = new Route('/');
|
||||
$route->setRequirement('_scheme', 'http|https');
|
||||
$this->assertEquals('http|https', $route->getRequirement('_scheme'));
|
||||
|
@ -199,8 +197,6 @@ class RouteTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testLegacyMethodRequirement()
|
||||
{
|
||||
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
|
||||
|
||||
$route = new Route('/');
|
||||
$route->setRequirement('_method', 'GET|POST');
|
||||
$this->assertEquals('GET|POST', $route->getRequirement('_method'));
|
||||
|
@ -233,8 +229,6 @@ class RouteTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testLegacyPattern()
|
||||
{
|
||||
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
|
||||
|
||||
$route = new Route('/{foo}');
|
||||
$this->assertEquals('/{foo}', $route->getPattern());
|
||||
|
||||
|
|
Reference in a new issue