Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FrameworkBundle] converted the special routing resolver to a DIC com…
…piler pass
- Loading branch information
Showing
4 changed files
with
41 additions
and
69 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RoutingResolverPass.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; | ||
|
||
use Symfony\Component\DependencyInjection\Reference; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* Adds tagged routing.loader services to routing.resolver service | ||
* | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
*/ | ||
class RoutingResolverPass implements CompilerPassInterface | ||
{ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if (false === $container->hasDefinition('routing.resolver')) { | ||
return; | ||
} | ||
|
||
$definition = $container->getDefinition('routing.resolver'); | ||
|
||
foreach ($container->findTaggedServiceIds('routing.loader') as $id => $attributes) { | ||
$definition->addMethodCall('addLoader', array(new Reference($id))); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 0 additions & 65 deletions
65
src/Symfony/Bundle/FrameworkBundle/Routing/LoaderResolver.php
This file was deleted.
Oops, something went wrong.