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

Skip to content

Commit 4a6cd91

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

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

UPGRADE-3.2.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ UPGRADE FROM 3.1 to 3.2
44
FrameworkBundle
55
---------------
6< 10000 /td>6

7+
* The `symfony/asset` dependency has been removed. Add it to your `composer.json` if you depend on it
8+
with `composer require symfony/asset`
79
* The `Resources/public/images/*` files have been removed.
810
* The `Resources/public/css/*.css` files have been removed (they are now inlined
911
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