Skip to content

Commit d6c209e

Browse files
committed
feature #21375 [FrameworkBundle][Config] Move ConfigCachePass from FrameworkBundle to Config (Deamon)
This PR was merged into the 3.3-dev branch. Discussion ---------- [FrameworkBundle][Config] Move ConfigCachePass from FrameworkBundle to Config | Q | A | ------------- | --- | Branch? | master<!--see comment below--> | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes/no | Fixed tickets | - <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | <!--highly recommended for new features--> This MR is part of the #21284 todo list <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Commits ------- bce445f452 Move ConfigCachePass from FrameworkBundle to Config
2 parents 6a66bad + 993f6e2 commit d6c209e

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ CHANGELOG
1717
* Deprecated `FormPass`, use `Symfony\Component\Form\DependencyInjection\FormPass` instead
1818
* Deprecated `SessionListener`
1919
* Deprecated `TestSessionListener`
20+
* Deprecated `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ConfigCachePass`.
21+
Use `Symfony\Component\Console\DependencyInjection\ConfigCachePass` instead.
2022

2123
3.2.0
2224
-----

DependencyInjection/Compiler/ConfigCachePass.php

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,18 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;
1313

14-
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15-
use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait;
16-
use Symfony\Component\DependencyInjection\ContainerBuilder;
14+
use Symfony\Component\Config\DependencyInjection\ConfigCachePass as BaseConfigCachePass;
15+
16+
@trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use Symfony\Component\Config\DependencyInjection\ConfigCachePass instead.', ConfigCachePass::class), E_USER_DEPRECATED);
1717

1818
/**
1919
* Adds services tagged config_cache.resource_checker to the config_cache_factory service, ordering them by priority.
2020
*
21+
* @deprecated since version 3.3, to be removed in 4.0. Use {@link BaseConfigCachePass} instead.
22+
*
2123
* @author Matthias Pigulla <mp@webfactory.de>
2224
* @author Benjamin Klotz <bk@webfactory.de>
2325
*/
24-
class ConfigCachePass implements CompilerPassInterface
26+
class ConfigCachePass extends BaseConfigCachePass
2527
{
26-
use PriorityTaggedServiceTrait;
27-
28-
public function process(ContainerBuilder $container)
29-
{
30-
$resourceCheckers = $this->findAndSortTaggedServices('config_cache.resource_checker', $container);
31-
32-
if (empty($resourceCheckers)) {
33-
return;
34-
}
35-
36-
$container->getDefinition('config_cache_factory')->replaceArgument(0, $resourceCheckers);
37-
}
3828
}

FrameworkBundle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslationExtractorPass;
3535
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslationDumperPass;
3636
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\UnusedTagsPass;
37-
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ConfigCachePass;
3837
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ValidateWorkflowsPass;
38+
use Symfony\Component\Config\DependencyInjection\ConfigCachePass;
3939
use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
4040
use Symfony\Component\Serializer\DependencyInjection\SerializerPass;
4141
use Symfony\Component\Debug\ErrorHandler;
@@ -108,7 +108,7 @@ public function build(ContainerBuilder $container)
108108
$container->addCompilerPass(new UnusedTagsPass(), PassConfig::TYPE_AFTER_REMOVING);
109109
$container->addCompilerPass(new ContainerBuilderDebugDumpPass(), PassConfig::TYPE_AFTER_REMOVING);
110110
$container->addCompilerPass(new CompilerDebugDumpPass(), PassConfig::TYPE_AFTER_REMOVING, -32);
111-
$container->addCompilerPass(new ConfigCachePass());
111+
$this->addCompilerPassIfExists($container, ConfigCachePass::class);
112112
$container->addCompilerPass(new CacheCollectorPass());
113113
}
114114
}

Tests/DependencyInjection/Compiler/ConfigCachePassTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
use Symfony\Component\DependencyInjection\Reference;
1616
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ConfigCachePass;
1717

18+
/**
19+
* @group legacy
20+
*/
1821
class ConfigCachePassTest extends TestCase
1922
{
2023
public function testThatCheckersAreProcessedInPriorityOrder()

0 commit comments

Comments
 (0)