-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
228 additions
and
362 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,16 +11,17 @@ | |
|
||
namespace Cache\CacheBundle\DependencyInjection; | ||
|
||
use Cache\CacheBundle\Cache\LoggingCachePool; | ||
use Cache\CacheBundle\DataCollector\CacheDataCollector; | ||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
use Symfony\Component\HttpKernel\DependencyInjection\Extension; | ||
use Symfony\Component\DependencyInjection\Loader; | ||
|
||
|
||
/** | ||
* Class AequasiCacheExtension | ||
* | ||
* @author Aaron Scherer <[email protected]> | ||
* @author Tobias Nyholm <[email protected]> | ||
*/ | ||
class CacheExtension extends Extension | ||
{ | ||
|
@@ -34,17 +35,24 @@ public function load(array $configs, ContainerBuilder $container) | |
{ | ||
$config = $this->processConfiguration(new Configuration(), $configs); | ||
|
||
if ($container->getParameter('kernel.debug')) { | ||
$container->register('data_collector.cache', CacheDataCollector::class) | ||
->addTag('data_collector', ['template' => CacheDataCollector::TEMPLATE, 'id' => 'cache']); | ||
} | ||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
$loader->load('services.yml'); | ||
|
||
foreach (['router', 'session', 'doctrine'] as $section) { | ||
if ($config[$section]['enabled']) { | ||
$container->setParameter('cache.'.$section, $config[$section]); | ||
} | ||
} | ||
|
||
if ($config['router']['enabled']) { | ||
$container->getDefinition('cache.router_listener')->replaceArgument(0, new Reference($config['router']['service_id'])); | ||
} else { | ||
$container->removeDefinition('cache.router_listener'); | ||
} | ||
|
||
if (!$container->getParameter('kernel.debug')) { | ||
$container->removeDefinition('data_collector.cache'); | ||
} | ||
} | ||
|
||
public function getAlias() | ||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
services: | ||
data_collector.cache: | ||
class: Cache\CacheBundle\DataCollector\CacheDataCollector | ||
tags: | ||
- { name: data_collectorr, template: 'CacheBundle:Collector:cache.html.twig', id: 'cache' } | ||
|
||
cache.router_listener: | ||
class: Cache\CacheBundle\Routing\RouterListener | ||
arguments: [~, %cache.router.ttl%] | ||
tags: | ||
- { name: kernel.event_listener, event: kernel.request, method: onBeforeRouting, priority: 33 } | ||
- { name: kernel.event_listener, event: kernel.request, method: onAfterRouting, priority: 31 } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.