diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index ede2bdf3b0..931f40cdac 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -28,7 +28,7 @@ "symfony/stopwatch": "~2.3", "symfony/templating": "~2.1", "symfony/translation": "~2.3", - "doctrine/common": "~2.2" + "doctrine/annotations": "~1.0" }, "require-dev": { "symfony/finder": "~2.0", @@ -38,10 +38,11 @@ "symfony/validator": "~2.1" }, "suggest": { - "symfony/console": "", - "symfony/finder": "", - "symfony/form": "", - "symfony/validator": "" + "symfony/console": "For using the console commands", + "symfony/finder": "For using the translation loader and cache warmer", + "symfony/form": "For using forms", + "symfony/validator": "For using validation", + "doctrine/cache": "For using alternative cache drivers" }, "autoload": { "psr-0": { "Symfony\\Bundle\\FrameworkBundle\\": "" } diff --git a/src/Symfony/Component/Routing/composer.json b/src/Symfony/Component/Routing/composer.json index 67b9327834..3517b23624 100644 --- a/src/Symfony/Component/Routing/composer.json +++ b/src/Symfony/Component/Routing/composer.json @@ -2,7 +2,7 @@ "name": "symfony/routing", "type": "library", "description": "Symfony Routing Component", - "keywords": [], + "keywords": ["routing", "router", "URL", "URI"], "homepage": "http://symfony.com", "license": "MIT", "authors": [ @@ -22,13 +22,14 @@ "symfony/config": "~2.2", "symfony/yaml": "~2.0", "symfony/expression-language": "~2.4", - "doctrine/common": "~2.2", + "doctrine/annotations": "~1.0", "psr/log": "~1.0" }, "suggest": { - "symfony/config": "", - "symfony/yaml": "", - "doctrine/common": "" + "symfony/config": "For using the all-in-one router or any loader", + "symfony/yaml": "For using the YAML loader", + "symfony/expression-language": "For using expression matching", + "doctrine/annotations": "For using the annotation loader" }, "autoload": { "psr-0": { "Symfony\\Component\\Routing\\": "" } diff --git a/src/Symfony/Component/Security/Acl/composer.json b/src/Symfony/Component/Security/Acl/composer.json index 3d05989ba0..0e68d9e53d 100644 --- a/src/Symfony/Component/Security/Acl/composer.json +++ b/src/Symfony/Component/Security/Acl/composer.json @@ -25,9 +25,9 @@ "psr/log": "~1.0" }, "suggest": { - "symfony/class-loader": "", - "symfony/finder": "", - "doctrine/dbal": "to use the built-in ACL implementation" + "symfony/class-loader": "For using the ACL generateSql script", + "symfony/finder": "For using the ACL generateSql script", + "doctrine/dbal": "For using the built-in ACL implementation" }, "autoload": { "psr-0": { "Symfony\\Component\\Security\\Acl\\": "" } diff --git a/src/Symfony/Component/Security/Core/composer.json b/src/Symfony/Component/Security/Core/composer.json index 4e7ff3a650..7520be4f1e 100644 --- a/src/Symfony/Component/Security/Core/composer.json +++ b/src/Symfony/Component/Security/Core/composer.json @@ -28,8 +28,9 @@ "suggest": { "symfony/event-dispatcher": "", "symfony/http-foundation": "", - "symfony/validator": "", - "ircmaxell/password-compat": "" + "symfony/validator": "For using the user password constraint", + "symfony/expression-language": "For using the expression voter", + "ircmaxell/password-compat": "For using the BCrypt password encoder in PHP <5.5" }, "autoload": { "psr-0": { "Symfony\\Component\\Security\\Core\\": "" } diff --git a/src/Symfony/Component/Security/Http/Tests/Firewall/LogoutListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/LogoutListenerTest.php index 719b6849cf..c2795239fa 100644 --- a/src/Symfony/Component/Security/Http/Tests/Firewall/LogoutListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Firewall/LogoutListenerTest.php @@ -37,22 +37,21 @@ class LogoutListenerTest extends \PHPUnit_Framework_TestCase public function testHandleMatchedPathWithSuccessHandlerAndCsrfValidation() { $successHandler = $this->getSuccessHandler(); - $csrfProvider = $this->getCsrfProvider(); + $tokenManager = $this->getTokenManager(); - list($listener, $context, $httpUtils, $options) = $this->getListener($successHandler, $csrfProvider); + list($listener, $context, $httpUtils, $options) = $this->getListener($successHandler, $tokenManager); list($event, $request) = $this->getGetResponseEvent(); - $request->query->set('_csrf_token', $csrfToken = 'token'); + $request->query->set('_csrf_token', 'token'); $httpUtils->expects($this->once()) ->method('checkRequestPath') ->with($request, $options['logout_path']) ->will($this->returnValue(true)); - $csrfProvider->expects($this->once()) - ->method('isCsrfTokenValid') - ->with('logout', $csrfToken) + $tokenManager->expects($this->once()) + ->method('isTokenValid') ->will($this->returnValue(true)); $successHandler->expects($this->once()) @@ -151,30 +150,29 @@ class LogoutListenerTest extends \PHPUnit_Framework_TestCase */ public function testCsrfValidationFails() { - $csrfProvider = $this->getCsrfProvider(); + $tokenManager = $this->getTokenManager(); - list($listener, $context, $httpUtils, $options) = $this->getListener(null, $csrfProvider); + list($listener, $context, $httpUtils, $options) = $this->getListener(null, $tokenManager); list($event, $request) = $this->getGetResponseEvent(); - $request->query->set('_csrf_token', $csrfToken = 'token'); + $request->query->set('_csrf_token', 'token'); $httpUtils->expects($this->once()) ->method('checkRequestPath') ->with($request, $options['logout_path']) ->will($this->returnValue(true)); - $csrfProvider->expects($this->once()) - ->method('isCsrfTokenValid') - ->with('logout', $csrfToken) + $tokenManager->expects($this->once()) + ->method('isTokenValid') ->will($this->returnValue(false)); $listener->handle($event); } - private function getCsrfProvider() + private function getTokenManager() { - return $this->getMock('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface'); + return $this->getMock('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface'); } private function getContext() @@ -209,7 +207,7 @@ class LogoutListenerTest extends \PHPUnit_Framework_TestCase ->getMock(); } - private function getListener($successHandler = null, $csrfProvider = null) + private function getListener($successHandler = null, $tokenManager = null) { $listener = new LogoutListener( $context = $this->getContext(), @@ -221,7 +219,7 @@ class LogoutListenerTest extends \PHPUnit_Framework_TestCase 'logout_path' => '/logout', 'target_url' => '/', ), - $csrfProvider + $tokenManager ); return array($listener, $context, $httpUtils, $options); diff --git a/src/Symfony/Component/Security/Http/composer.json b/src/Symfony/Component/Security/Http/composer.json index 4dfd98555d..716c443ed8 100644 --- a/src/Symfony/Component/Security/Http/composer.json +++ b/src/Symfony/Component/Security/Http/composer.json @@ -23,14 +23,13 @@ "symfony/http-kernel": "~2.4" }, "require-dev": { - "symfony/form": "~2.0", "symfony/routing": "~2.2", "symfony/security-csrf": "~2.4", "psr/log": "~1.0" }, "suggest": { - "symfony/security-csrf": "", - "symfony/routing": "" + "symfony/security-csrf": "For using tokens to protect authentication/logout attempts", + "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs" }, "autoload": { "psr-0": { "Symfony\\Component\\Security\\Http\\": "" } diff --git a/src/Symfony/Component/Security/composer.json b/src/Symfony/Component/Security/composer.json index 6be388692f..18c69ba5b3 100644 --- a/src/Symfony/Component/Security/composer.json +++ b/src/Symfony/Component/Security/composer.json @@ -28,7 +28,6 @@ "symfony/security-http": "self.version" }, "require-dev": { - "symfony/form": "~2.0", "symfony/routing": "~2.2", "symfony/validator": "~2.2", "doctrine/common": "~2.2", @@ -38,13 +37,13 @@ "symfony/expression-language": "~2.4" }, "suggest": { - "symfony/class-loader": "", - "symfony/finder": "", - "symfony/form": "", - "symfony/validator": "", - "symfony/routing": "", - "doctrine/dbal": "to use the built-in ACL implementation", - "ircmaxell/password-compat": "" + "symfony/class-loader": "For using the ACL generateSql script", + "symfony/finder": "For using the ACL generateSql script", + "symfony/validator": "For using the user password constraint", + "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs", + "doctrine/dbal": "For using the built-in ACL implementation", + "symfony/expression-language": "For using the expression voter", + "ircmaxell/password-compat": "For using the BCrypt password encoder in PHP <5.5" }, "autoload": { "psr-0": { "Symfony\\Component\\Security\\": "" } diff --git a/src/Symfony/Component/Validator/ValidatorBuilder.php b/src/Symfony/Component/Validator/ValidatorBuilder.php index 159070be41..e24a707166 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilder.php +++ b/src/Symfony/Component/Validator/ValidatorBuilder.php @@ -205,8 +205,8 @@ class ValidatorBuilder implements ValidatorBuilderInterface } if (null === $annotationReader) { - if (!class_exists('Doctrine\Common\Annotations\AnnotationReader')) { - throw new \RuntimeException('Requested a ValidatorFactory with an AnnotationLoader, but the AnnotationReader was not found. You should add Doctrine Common to your project.'); + if (!class_exists('Doctrine\Common\Annotations\AnnotationReader') || !class_exists('Doctrine\Common\Cache\ArrayCache')) { + throw new \RuntimeException('Enabling annotation based constraint mapping requires the packages doctrine/annotations and doctrine/cache to be installed.'); } $annotationReader = new CachedReader(new AnnotationReader(), new ArrayCache()); diff --git a/src/Symfony/Component/Validator/composer.json b/src/Symfony/Component/Validator/composer.json index d6f6195825..1b4b6a6907 100644 --- a/src/Symfony/Component/Validator/composer.json +++ b/src/Symfony/Component/Validator/composer.json @@ -24,10 +24,13 @@ "symfony/http-foundation": "~2.1", "symfony/intl": "~2.3", "symfony/yaml": "~2.0", - "symfony/config": "~2.2" + "symfony/config": "~2.2", + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0" }, "suggest": { - "doctrine/common": "", + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader", "symfony/http-foundation": "", "symfony/intl": "", "symfony/yaml": "",