minor #9427 adjust doctrine dependencies (Tobion)
This PR was merged into the master branch.
Discussion
----------
adjust doctrine dependencies
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #9384, #9385
| License | MIT
| Doc PR | -
I went through all components/bundles/bridges in symfony and searched for doctrine dependencies. Then looked if it only requires a subset (annotations instead of common for example).
Commits
-------
7366901
adjust doctrine dependencies
This commit is contained in:
commit
b9b7c8ac8e
@ -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\\": "" }
|
||||
|
@ -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\\": "" }
|
||||
|
@ -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\\": "" }
|
||||
|
@ -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\\": "" }
|
||||
|
@ -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);
|
||||
|
@ -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\\": "" }
|
||||
|
@ -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\\": "" }
|
||||
|
@ -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());
|
||||
|
@ -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": "",
|
||||
|
Reference in New Issue
Block a user