diff --git a/core/composer.json b/core/composer.json index 247d8ce..9165342 100644 --- a/core/composer.json +++ b/core/composer.json @@ -14,6 +14,7 @@ "symfony/http-kernel": "2.7.*", "symfony/routing": "2.7.*", "symfony/serializer": "2.7.*", + "symfony/translation": "2.7.*", "symfony/validator": "2.7.*", "symfony/process": "2.7.*", "symfony/yaml": "2.7.*", diff --git a/core/composer.lock b/core/composer.lock index 837e1bf..1dc5ddf 100644 --- a/core/composer.lock +++ b/core/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "889ef3c9ba7aa2218dcf4958e06f5d32", + "hash": "9db2784f737cc318fc2faee02482a653", "packages": [ { "name": "behat/mink", @@ -2841,25 +2841,27 @@ }, { "name": "symfony/translation", - "version": "v2.6.6", - "target-dir": "Symfony/Component/Translation", + "version": "v2.7.0-BETA2", "source": { "type": "git", "url": "https://github.com/symfony/Translation.git", - "reference": "bd939f05cdaca128f4ddbae1b447d6f0203b60af" + "reference": "1be5bbed3938247acd7c5f4e4f29dd32db636b1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/bd939f05cdaca128f4ddbae1b447d6f0203b60af", - "reference": "bd939f05cdaca128f4ddbae1b447d6f0203b60af", + "url": "https://api.github.com/repos/symfony/Translation/zipball/1be5bbed3938247acd7c5f4e4f29dd32db636b1f", + "reference": "1be5bbed3938247acd7c5f4e4f29dd32db636b1f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" + }, + "conflict": { + "symfony/config": "<2.7" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.3,>=2.3.12", + "symfony/config": "~2.7", "symfony/intl": "~2.3", "symfony/phpunit-bridge": "~2.7", "symfony/yaml": "~2.2" @@ -2872,11 +2874,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.7-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\Translation\\": "" } }, @@ -2886,17 +2888,17 @@ ], "authors": [ { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Translation Component", - "homepage": "http://symfony.com", - "time": "2015-03-30 15:54:10" + "homepage": "https://symfony.com", + "time": "2015-05-11 02:35:29" }, { "name": "symfony/validator", @@ -3079,12 +3081,12 @@ "version": "2.4.0", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendEscaper.git", + "url": "https://github.com/zendframework/zend-escaper.git", "reference": "65b3328627362b0be1d5e9067bc846511d1fbc96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendEscaper/zipball/65b3328627362b0be1d5e9067bc846511d1fbc96", + "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/15e5769e4fcdb4bf07ebd76500810e7070e23a97", "reference": "65b3328627362b0be1d5e9067bc846511d1fbc96", "shasum": "" }, @@ -3119,12 +3121,12 @@ "version": "2.4.0", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendFeed.git", + "url": "https://github.com/zendframework/zend-feed.git", "reference": "aca2b42ecf06d94c621e3c3be8e95d61d3a79bf5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendFeed/zipball/aca2b42ecf06d94c621e3c3be8e95d61d3a79bf5", + "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/0f59e560364f1f1fcb09a96874328ae3ff690db2", "reference": "aca2b42ecf06d94c621e3c3be8e95d61d3a79bf5", "shasum": "" }, @@ -3176,12 +3178,12 @@ "version": "2.4.0", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendStdlib.git", + "url": "https://github.com/zendframework/zend-stdlib.git", "reference": "eab586f4c18af3fa63c977611939f1f4a3cf1030" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendStdlib/zipball/eab586f4c18af3fa63c977611939f1f4a3cf1030", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cf05c5ba75606e47ffee91cedc72778da46f74c3", "reference": "eab586f4c18af3fa63c977611939f1f4a3cf1030", "shasum": "" }, diff --git a/core/lib/Drupal/Core/Routing/RouteBuilder.php b/core/lib/Drupal/Core/Routing/RouteBuilder.php index 9c34cde..a78cf0c 100644 --- a/core/lib/Drupal/Core/Routing/RouteBuilder.php +++ b/core/lib/Drupal/Core/Routing/RouteBuilder.php @@ -168,9 +168,13 @@ public function rebuild() { 'defaults' => array(), 'requirements' => array(), 'options' => array(), + 'host' => NULL, + 'schemes' => array(), + 'methods' => array(), + 'condition' => '', ); - $route = new Route($route_info['path'], $route_info['defaults'], $route_info['requirements'], $route_info['options']); + $route = new Route($route_info['path'], $route_info['defaults'], $route_info['requirements'], $route_info['options'], $route_info['host'], $route_info['schemes'], $route_info['methods'], $route_info['condition']); $collection->add($name, $route); } } diff --git a/core/modules/rest/src/Routing/ResourceRoutes.php b/core/modules/rest/src/Routing/ResourceRoutes.php index a561b8b..f975f27 100644 --- a/core/modules/rest/src/Routing/ResourceRoutes.php +++ b/core/modules/rest/src/Routing/ResourceRoutes.php @@ -75,9 +75,9 @@ protected function alterRoutes(RouteCollection $collection) { foreach ($plugin->routes() as $name => $route) { // @todo: Are multiple methods possible here? - $method = $route->getMethods()[0]; + $methods = $route->getMethods(); // Only expose routes where the method is enabled in the configuration. - if ($method && isset($enabled_methods[$method])) { + if ($methods && ($method = $methods[0]) && $method && isset($enabled_methods[$method])) { $route->setRequirement('_access_rest_csrf', 'TRUE'); // Check that authentication providers are defined. diff --git a/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php b/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php index 59082d6..54cd70d 100644 --- a/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php +++ b/core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php @@ -50,20 +50,16 @@ public function staticSampleRouteCollection() { $routes = array(); $routes['route_a'] = array( 'path' => '/path/one', - 'requirements' => array( - '_method' => 'GET', - ), + 'methods' => array('GET'), ); $routes['route_b'] = array( 'path' => '/path/one', - 'requirements' => array( - '_method' => 'PUT', - ), + 'methods' => array('PUT'), ); $routes['route_c'] = array( 'path' => '/path/two', + 'methods' => array('GET'), 'requirements' => array( - '_method' => 'GET', '_format' => 'json' ), ); @@ -72,8 +68,8 @@ public function staticSampleRouteCollection() { ); $routes['route_e'] = array( 'path' => '/path/two', + 'methods' => array('GET', 'HEAD'), 'requirements' => array( - '_method' => 'GET|HEAD', '_format' => 'html' ), ); diff --git a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php index e4faaa7..26bbe04 100644 --- a/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php +++ b/core/tests/Drupal/Tests/Core/TypedData/RecursiveContextualValidatorTest.php @@ -16,6 +16,7 @@ use Drupal\Core\TypedData\Validation\RecursiveValidator; use Drupal\Core\Validation\ConstraintManager; use Drupal\Tests\UnitTestCase; +use Symfony\Component\Translation\IdentityTranslator; use Symfony\Component\Validator\ConstraintValidatorFactory; use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\DefaultTranslator; @@ -81,7 +82,7 @@ protected function setUp() { $container->set('typed_data_manager', $this->typedDataManager); \Drupal::setContainer($container); - $translator = new DefaultTranslator(); + $translator = new IdentityTranslator(); $this->contextFactory = new ExecutionContextFactory($translator); $this->validatorFactory = new ConstraintValidatorFactory(); $this->recursiveValidator = new RecursiveValidator($this->contextFactory, $this->validatorFactory, $this->typedDataManager); diff --git a/core/vendor/composer/autoload_namespaces.php b/core/vendor/composer/autoload_namespaces.php index f64e34b..305ab18 100644 --- a/core/vendor/composer/autoload_namespaces.php +++ b/core/vendor/composer/autoload_namespaces.php @@ -9,7 +9,6 @@ 'phpDocumentor' => array($vendorDir . '/phpdocumentor/reflection-docblock/src'), 'org\\bovigo\\vfs\\' => array($vendorDir . '/mikey179/vfsStream/src/main/php'), 'Twig_' => array($vendorDir . '/twig/twig/lib'), - 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), 'Symfony\\Component\\DomCrawler\\' => array($vendorDir . '/symfony/dom-crawler'), 'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'), 'Symfony\\Component\\BrowserKit\\' => array($vendorDir . '/symfony/browser-kit'), diff --git a/core/vendor/composer/autoload_psr4.php b/core/vendor/composer/autoload_psr4.php index c25ab6f..b14f161 100644 --- a/core/vendor/composer/autoload_psr4.php +++ b/core/vendor/composer/autoload_psr4.php @@ -11,6 +11,7 @@ 'Zend\\Escaper\\' => array($vendorDir . '/zendframework/zend-escaper'), 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), 'Symfony\\Component\\Validator\\' => array($vendorDir . '/symfony/validator'), + 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), 'Symfony\\Component\\Serializer\\' => array($vendorDir . '/symfony/serializer'), 'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'), 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json index f274086..0bfe9cc 100644 --- a/core/vendor/composer/installed.json +++ b/core/vendor/composer/installed.json @@ -1528,67 +1528,6 @@ "homepage": "http://symfony.com" }, { - "name": "symfony/translation", - "version": "v2.6.6", - "version_normalized": "2.6.6.0", - "target-dir": "Symfony/Component/Translation", - "source": { - "type": "git", - "url": "https://github.com/symfony/Translation.git", - "reference": "bd939f05cdaca128f4ddbae1b447d6f0203b60af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/bd939f05cdaca128f4ddbae1b447d6f0203b60af", - "reference": "bd939f05cdaca128f4ddbae1b447d6f0203b60af", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.3,>=2.3.12", - "symfony/intl": "~2.3", - "symfony/phpunit-bridge": "~2.7", - "symfony/yaml": "~2.2" - }, - "suggest": { - "psr/log": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "time": "2015-03-30 15:54:10", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\Translation\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Translation Component", - "homepage": "http://symfony.com" - }, - { "name": "symfony/dom-crawler", "version": "v2.6.6", "version_normalized": "2.6.6.0", @@ -1708,12 +1647,12 @@ "version_normalized": "2.4.0.0", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendStdlib.git", + "url": "https://github.com/zendframework/zend-stdlib.git", "reference": "eab586f4c18af3fa63c977611939f1f4a3cf1030" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendStdlib/zipball/eab586f4c18af3fa63c977611939f1f4a3cf1030", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cf05c5ba75606e47ffee91cedc72778da46f74c3", "reference": "eab586f4c18af3fa63c977611939f1f4a3cf1030", "shasum": "" }, @@ -1762,12 +1701,12 @@ "version_normalized": "2.4.0.0", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendEscaper.git", + "url": "https://github.com/zendframework/zend-escaper.git", "reference": "65b3328627362b0be1d5e9067bc846511d1fbc96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendEscaper/zipball/65b3328627362b0be1d5e9067bc846511d1fbc96", + "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/15e5769e4fcdb4bf07ebd76500810e7070e23a97", "reference": "65b3328627362b0be1d5e9067bc846511d1fbc96", "shasum": "" }, @@ -1804,12 +1743,12 @@ "version_normalized": "2.4.0.0", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendFeed.git", + "url": "https://github.com/zendframework/zend-feed.git", "reference": "aca2b42ecf06d94c621e3c3be8e95d61d3a79bf5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendFeed/zipball/aca2b42ecf06d94c621e3c3be8e95d61d3a79bf5", + "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/0f59e560364f1f1fcb09a96874328ae3ff690db2", "reference": "aca2b42ecf06d94c621e3c3be8e95d61d3a79bf5", "shasum": "" }, @@ -3331,5 +3270,68 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com" + }, + { + "name": "symfony/translation", + "version": "v2.7.0-BETA2", + "version_normalized": "2.7.0.0-beta2", + "source": { + "type": "git", + "url": "https://github.com/symfony/Translation.git", + "reference": "1be5bbed3938247acd7c5f4e4f29dd32db636b1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Translation/zipball/1be5bbed3938247acd7c5f4e4f29dd32db636b1f", + "reference": "1be5bbed3938247acd7c5f4e4f29dd32db636b1f", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "conflict": { + "symfony/config": "<2.7" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~2.7", + "symfony/intl": "~2.3", + "symfony/phpunit-bridge": "~2.7", + "symfony/yaml": "~2.2" + }, + "suggest": { + "psr/log": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "time": "2015-05-11 02:35:29", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com" } ] diff --git a/core/vendor/symfony/translation/Symfony/Component/Translation/TranslatorInterface.php b/core/vendor/symfony/translation/Symfony/Component/Translation/TranslatorInterface.php deleted file mode 100644 index fe1a865..0000000 --- a/core/vendor/symfony/translation/Symfony/Component/Translation/TranslatorInterface.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -/** - * TranslatorInterface. - * - * @author Fabien Potencier - * - * @api - */ -interface TranslatorInterface -{ - /** - * Translates the given message. - * - * @param string $id The message id (may also be an object that can be cast to string) - * @param array $parameters An array of parameters for the message - * @param string|null $domain The domain for the message or null to use the default - * @param string|null $locale The locale or null to use the default - * - * @throws \InvalidArgumentException If the locale contains invalid characters - * - * @return string The translated string - * - * @api - */ - public function trans($id, array $parameters = array(), $domain = null, $locale = null); - - /** - * Translates the given choice message by choosing a translation according to a number. - * - * @param string $id The message id (may also be an object that can be cast to string) - * @param int $number The number to use to find the indice of the message - * @param array $parameters An array of parameters for the message - * @param string|null $domain The domain for the message or null to use the default - * @param string|null $locale The locale or null to use the default - * - * @throws \InvalidArgumentException If the locale contains invalid characters - * - * @return string The translated string - * - * @api - */ - public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null); - - /** - * Sets the current locale. - * - * @param string $locale The locale - * - * @throws \InvalidArgumentException If the locale contains invalid characters - * - * @api - */ - public function setLocale($locale); - - /** - * Returns the current locale. - * - * @return string The locale - * - * @api - */ - public function getLocale(); -}