Skip to content

Commit

Permalink
Fixing conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptiklemur committed Dec 12, 2015
2 parents f939025 + 7e1edeb commit d7ad9fc
Show file tree
Hide file tree
Showing 17 changed files with 228 additions and 362 deletions.
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
"psr/cache": "1.0.x-dev"
},
"require-dev": {
"phpunit/phpunit": "^5.1|^4.0",
"cache/doctrine-cache": "^0.1"
"phpunit/phpunit": "^5.1|^4.0",
"cache/doctrine-adapter": "^0.1",
"cache/taggable-cache": "^0.1"
},
"suggest": {
"php-cache/doctrine-adapter-bundle": "A bundle to register PSR-6 compliant services based on Doctrine cache"
"cache/doctrine-adapter-bundle": "A bundle to register PSR-6 compliant services based on Doctrine cache"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="tests/bootstrap.php"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="CacheBundle for the Symfony2 Framework">
Expand Down
1 change: 0 additions & 1 deletion src/CacheBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public function build(ContainerBuilder $container)

$container->addCompilerPass(new Compiler\SessionSupportCompilerPass());
$container->addCompilerPass(new Compiler\DoctrineSupportCompilerPass());
$container->addCompilerPass(new Compiler\RouterCompilerPass());

if ($container->getParameter('kernel.debug')) {
$container->addCompilerPass(new Compiler\DataCollectorCompilerPass());
Expand Down
22 changes: 15 additions & 7 deletions src/DependencyInjection/CacheExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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()
Expand Down
45 changes: 0 additions & 45 deletions src/DependencyInjection/Compiler/RouterCompilerPass.php

This file was deleted.

11 changes: 4 additions & 7 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getConfigTreeBuilder()
}

/**
* Configure the "aequasi_cache.session" section
* Configure the "cache.session" section
*
* @return ArrayNodeDefinition
*/
Expand All @@ -69,7 +69,7 @@ private function addSessionSupportSection()
}

/**
* Configure the "aequasi_cache.doctrine" section
* Configure the "cache.doctrine" section
*
* @return ArrayNodeDefinition
*/
Expand Down Expand Up @@ -127,7 +127,7 @@ function ($v) {
}

/**
* Configure the "aequasi_cache.router" section
* Configure the "cache.router" section
*
* @return ArrayNodeDefinition
*/
Expand All @@ -142,10 +142,7 @@ private function addRouterSection()
->defaultFalse()
->end()
->integerNode('ttl')
->defaultValue(86400)
->end()
->booleanNode('auto-register')
->defaultTrue()
->defaultValue(604800)
->end()
->scalarNode('service_id')
->isRequired()
Expand Down
12 changes: 12 additions & 0 deletions src/Resources/config/services.yml
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 }
78 changes: 0 additions & 78 deletions src/Routing/Matcher/CacheUrlMatcher.php

This file was deleted.

109 changes: 0 additions & 109 deletions src/Routing/Router.php

This file was deleted.

Loading

0 comments on commit d7ad9fc

Please sign in to comment.