DependencyInjection/Compiler/FiltersCompilerPass.php 1 location
|
@@ 17-35 (lines=19) @@
|
| 14 |
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
| 15 |
|
use Symfony\Component\DependencyInjection\Reference; |
| 16 |
|
|
| 17 |
|
class FiltersCompilerPass extends AbstractCompilerPass |
| 18 |
|
{ |
| 19 |
|
/** |
| 20 |
|
* {@inheritdoc} |
| 21 |
|
*/ |
| 22 |
|
public function process(ContainerBuilder $container) |
| 23 |
|
{ |
| 24 |
|
$tags = $container->findTaggedServiceIds('liip_imagine.filter.loader'); |
| 25 |
|
|
| 26 |
|
if (\count($tags) > 0 && $container->hasDefinition('liip_imagine.filter.manager')) { |
| 27 |
|
$manager = $container->getDefinition('liip_imagine.filter.manager'); |
| 28 |
|
|
| 29 |
|
foreach ($tags as $id => $tag) { |
| 30 |
|
$manager->addMethodCall('addLoader', [$tag[0]['loader'], new Reference($id)]); |
| 31 |
|
$this->log($container, 'Registered filter loader: %s', $id); |
| 32 |
|
} |
| 33 |
|
} |
| 34 |
|
} |
| 35 |
|
} |
| 36 |
|
|
DependencyInjection/Compiler/LoadersCompilerPass.php 1 location
|
@@ 17-35 (lines=19) @@
|
| 14 |
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
| 15 |
|
use Symfony\Component\DependencyInjection\Reference; |
| 16 |
|
|
| 17 |
|
class LoadersCompilerPass extends AbstractCompilerPass |
| 18 |
|
{ |
| 19 |
|
/** |
| 20 |
|
* {@inheritdoc} |
| 21 |
|
*/ |
| 22 |
|
public function process(ContainerBuilder $container) |
| 23 |
|
{ |
| 24 |
|
$tags = $container->findTaggedServiceIds('liip_imagine.binary.loader'); |
| 25 |
|
|
| 26 |
|
if (\count($tags) > 0 && $container->hasDefinition('liip_imagine.data.manager')) { |
| 27 |
|
$manager = $container->getDefinition('liip_imagine.data.manager'); |
| 28 |
|
|
| 29 |
|
foreach ($tags as $id => $tag) { |
| 30 |
|
$manager->addMethodCall('addLoader', [$tag[0]['loader'], new Reference($id)]); |
| 31 |
|
$this->log($container, 'Registered binary loader: %s', $id); |
| 32 |
|
} |
| 33 |
|
} |
| 34 |
|
} |
| 35 |
|
} |
| 36 |
|
|
DependencyInjection/Compiler/PostProcessorsCompilerPass.php 1 location
|
@@ 22-40 (lines=19) @@
|
| 19 |
|
* |
| 20 |
|
* @author Konstantin Tjuterev <[email protected]> |
| 21 |
|
*/ |
| 22 |
|
class PostProcessorsCompilerPass extends AbstractCompilerPass |
| 23 |
|
{ |
| 24 |
|
/** |
| 25 |
|
* {@inheritdoc} |
| 26 |
|
*/ |
| 27 |
|
public function process(ContainerBuilder $container) |
| 28 |
|
{ |
| 29 |
|
$tags = $container->findTaggedServiceIds('liip_imagine.filter.post_processor'); |
| 30 |
|
|
| 31 |
|
if (\count($tags) > 0 && $container->hasDefinition('liip_imagine.filter.manager')) { |
| 32 |
|
$manager = $container->getDefinition('liip_imagine.filter.manager'); |
| 33 |
|
|
| 34 |
|
foreach ($tags as $id => $tag) { |
| 35 |
|
$manager->addMethodCall('addPostProcessor', [$tag[0]['post_processor'], new Reference($id)]); |
| 36 |
|
$this->log($container, 'Registered filter post-processor: %s', $id); |
| 37 |
|
} |
| 38 |
|
} |
| 39 |
|
} |
| 40 |
|
} |
| 41 |
|
|
DependencyInjection/Compiler/ResolversCompilerPass.php 1 location
|
@@ 17-35 (lines=19) @@
|
| 14 |
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
| 15 |
|
use Symfony\Component\DependencyInjection\Reference; |
| 16 |
|
|
| 17 |
|
class ResolversCompilerPass extends AbstractCompilerPass |
| 18 |
|
{ |
| 19 |
|
/** |
| 20 |
|
* {@inheritdoc} |
| 21 |
|
*/ |
| 22 |
|
public function process(ContainerBuilder $container) |
| 23 |
|
{ |
| 24 |
|
$tags = $container->findTaggedServiceIds('liip_imagine.cache.resolver'); |
| 25 |
|
|
| 26 |
|
if (\count($tags) > 0 && $container->hasDefinition('liip_imagine.cache.manager')) { |
| 27 |
|
$manager = $container->getDefinition('liip_imagine.cache.manager'); |
| 28 |
|
|
| 29 |
|
foreach ($tags as $id => $tag) { |
| 30 |
|
$manager->addMethodCall('addResolver', [$tag[0]['resolver'], new Reference($id)]); |
| 31 |
|
$this->log($container, 'Registered cache resolver: %s', $id); |
| 32 |
|
} |
| 33 |
|
} |
| 34 |
|
} |
| 35 |
|
} |
| 36 |
|
|
DependencyInjection/Compiler/CacheWarmersCompilerPass.php 1 location
|
@@ 9-26 (lines=18) @@
|
| 6 |
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
| 7 |
|
use Symfony\Component\DependencyInjection\Reference; |
| 8 |
|
|
| 9 |
|
class CacheWarmersCompilerPass implements CompilerPassInterface |
| 10 |
|
{ |
| 11 |
|
/** |
| 12 |
|
* {@inheritDoc} |
| 13 |
|
*/ |
| 14 |
|
public function process(ContainerBuilder $container) |
| 15 |
|
{ |
| 16 |
|
$tags = $container->findTaggedServiceIds('liip_imagine.cache.warmer'); |
| 17 |
|
|
| 18 |
|
if (count($tags) > 0 && $container->hasDefinition('liip_imagine.cache.warmer')) { |
| 19 |
|
$warmer = $container->getDefinition('liip_imagine.cache.warmer'); |
| 20 |
|
|
| 21 |
|
foreach ($tags as $id => $tag) { |
| 22 |
|
$warmer->addMethodCall('addWarmer', array($tag[0]['warmer'], new Reference($id))); |
| 23 |
|
} |
| 24 |
|
} |
| 25 |
|
} |
| 26 |
|
} |
| 27 |
|
|