Skip to content

Commit d63247f

Browse files
committed
feature #20075 [FrameworkBundle] removed the Security Core and Security CSRF component dependencies on FrameworkBundle (fabpot)
This PR was merged into the 3.2-dev branch. Discussion ---------- [FrameworkBundle] removed the Security Core and Security CSRF component dependencies on FrameworkBundle | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no (except for people using FrameworkBundle without requiring symfony/symfony which should be pretty rare; and fixing this is easy by adding symfony/security-core and symfony/security-csrf explicitly) | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15748 partially | License | MIT | Doc PR | n/a Another PR to reduce the number of required dependencies on FrameworkBundle. This PR removes the Security Core and CSRF components from the list. Commits ------- d703784 [FrameworkBundle] removed the Security Core and Security CSRF component dependencies on FrameworkBundle
2 parents 55e2d7e + 3212fb1 commit d63247f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CHANGELOG
44
3.2.0
55
-----
66

7+
* Removed `symfony/security-core` and `symfony/security-csrf` from the list of required dependencies in `composer.json`
78
* Removed `symfony/templating` from the list of required dependencies in `composer.json`
89
* Removed `symfony/translation` from the list of required dependencies in `composer.json`
910
* Removed `symfony/asset` from the list of required dependencies in `composer.json`

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,10 @@ private function registerSecurityCsrfConfiguration(array $config, ContainerBuild
10211021
return;
10221022
}
10231023

1024+
if (!class_exists('Symfony\Component\Security\Csrf\CsrfToken')) {
1025+
throw new LogicException('CSRF support cannot be enabled as the Security CSRF component is not installed.');
1026+
}
1027+
10241028
if (!$this->sessionConfigEnabled) {
10251029
throw new \LogicException('CSRF protection needs sessions to be enabled.');
10261030
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
"symfony/filesystem": "~2.8|~3.0",
2929
"symfony/finder": "~2.8|~3.0",
3030
"symfony/routing": "~3.0",
31-
"symfony/security-core": "~3.2",
32-
"symfony/security-csrf": "~2.8|~3.0",
3331
"symfony/stopwatch": "~2.8|~3.0",
3432
"doctrine/cache": "~1.0",
3533
"doctrine/annotations": "~1.0"
@@ -45,6 +43,8 @@
4543
"symfony/form": "~2.8|~3.0",
4644
"symfony/expression-language": "~2.8|~3.0",
4745
"symfony/process": "~2.8|~3.0",
46+
"symfony/security-core": "~3.2",
47+
"symfony/security-csrf": "~2.8|~3.0",
4848
"symfony/serializer": "~2.8|~3.0",
4949
"symfony/translation": "~2.8|~3.0",
5050
"symfony/templating": "~2.8|~3.0",

0 commit comments

Comments
 (0)