8000 [FrameworkBundle] removed the Asset component dependency on Framework… · symfony/symfony@c2ddb68 · GitHub
[go: up one dir, main page]

Skip to content

Commit c2ddb68

Browse files
committed
[FrameworkBundle] removed the Asset component dependency on FrameworkBundle
1 parent f1c1e37 commit c2ddb68

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed

UPGRADE-3.2.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ UPGRADE FROM 3.1 to 3.2
44
FrameworkBundle
55
---------------
66

7+
* The `symfony/asset` dependency has been removed; require it via `composer
8+
require symfony/asset` if you depend on it and don't already depend on
9+
`symfony/symfony`
710
* The `Resources/public/images/*` files have been removed.
811
* The `Resources/public/css/*.css` files have been removed (they are now inlined
912
in TwigBundle).

src/Symfony/Bundle/FrameworkBundle/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/asset` from the list of required dependencies in `composer.json`
78
* The `Resources/public/images/*` files have been removed.
89
* The `Resources/public/css/*.css` files have been removed (they are now inlined in TwigBundle).
910
* The `Controller::getUser()` method has been deprecated and will be removed in

src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ protected function configure()
7474
;
7575
}
7676

77+
/**
78+
* {@inheritdoc}
79+
*/
80+
public function isEnabled()
81+
{
82+
if (!class_exists('Symfony\Component\Asset\Package')) {
83+
return false;
84+
}
85+
86+
return parent::isEnabled();
87+
}
88+
7789
/**
7890
* {@inheritdoc}
7991
*/

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ public function load(array $configs, ContainerBuilder $container)
134134
$this->registerSecurityCsrfConfiguration($config['csrf_protection'], $container, $loader);
135135

136136
if ($this->isConfigEnabled($container, $config['assets'])) {
137+
if (!class_exists('Symfony\Component\Asset\Package')) {
138+
throw new LogicException('Asset support cannot be enabled as the Asset component is not installed.');
139+
}
140+
137141
$this->registerAssetsConfiguration($config['assets'], $container, $loader);
138142
}
139143

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
],
1818
"require": {
1919
"php": ">=5.5.9",
20-
"symfony/asset": "~2.8|~3.0",
2120
"symfony/cache": "~3.2",
2221
"symfony/class-loader": "~3.2",
2322
"symfony/dependency-injection": "~3.2",
@@ -38,6 +37,7 @@
3837
"doctrine/annotations": "~1.0"
3938
},
4039
"require-dev": {
40+
"symfony/asset": "~2.8|~3.0",
4141
"symfony/browser-kit": "~2.8|~3.0",
4242
"symfony/console": "~2.8.8|~3.0.8|~3.1.2|~3.2",
4343
"symfony/css-selector": "~2.8|~3.0",

0 commit comments

Comments
 (0)
0