Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 275be3e

Browse filesBrowse files
[FrameworkBundle] Add default pool & system adapter
1 parent 714b916 commit 275be3e
Copy full SHA for 275be3e

File tree

Expand file treeCollapse file tree

3 files changed

+21
-4
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+21
-4
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+15-3Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,9 +1022,7 @@ private function registerPropertyInfoConfiguration(array $config, ContainerBuild
10221022

10231023
private function registerCacheConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
10241024
{
1025-
if (!empty($config['pools'])) {
1026-
$loader->load('cache_pools.xml');
1027-
}
1025+
$loader->load('cache_pools.xml');
10281026

10291027
foreach ($config['pools'] as $name => $poolConfig) {
10301028
$poolDefinition = new DefinitionDecorator($poolConfig['adapter']);
@@ -1034,6 +1032,20 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
10341032
$poolDefinition->addTag('cache.pool', $poolConfig);
10351033
$container->setDefinition('cache.pool.'.$name, $poolDefinition);
10361034
}
1035+
1036+
$this->addClassesToCompile(array(
1037+
'Psr\Cache\CacheItemInterface',
1038+
'Psr\Cache\CacheItemPoolInterface',
1039+
'Symfony\Component\Cache\Adapter\AdapterInterface',
1040+
'Symfony\Component\Cache\Adapter\AbstractAdapter',
1041+
'Symfony\Component\Cache\CacheItem',
1042+
));
1043+
1044+
if (function_exists('apcu_fetch')) {
1045+
$this->addClassesToCompile(array('Symfony\Component\Cache\Adapter\ApcuAdapter'));
1046+
} else {
1047+
$container->setAlias('cache.adapter.system', 'cache.adapter.default');
1048+
}
10371049
}
10381050

10391051
/**

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/cache_pools.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/cache_pools.xml
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
</service>
1212

1313
<service id="cache.adapter.default" alias="cache.adapter.filesystem" />
14+
<service id="cache.adapter.system" alias="cache.adapter.apcu" />
15+
16+
<service id="cache.pool.default" parent="cache.adapter.default">
17+
<tag name="cache.pool" clearer="cache.default_pools_clearer" />
18+
</service>
1419

1520
<service id="cache.adapter.apcu" class="Symfony\Component\Cache\Adapter\ApcuAdapter" abstract="true">
1621
<argument /> <!-- namespace -->

‎src/Symfony/Bundle/FrameworkBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"require": {
1919
"php": ">=5.5.9",
2020
"symfony/asset": "~2.8|~3.0",
21+
"symfony/cache": "~3.1",
2122
"symfony/class-loader": "~2.8|~3.0",
2223
"symfony/dependency-injection": "~3.1",
2324
"symfony/config": "~2.8|~3.0",
@@ -38,7 +39,6 @@
3839
},
3940
"require-dev": {
4041
"symfony/browser-kit": "~2.8|~3.0",
41-
"symfony/cache": "~3.1",
4242
"symfony/console": "~2.8|~3.0",
4343
"symfony/css-selector": "~2.8|~3.0",
4444
"symfony/dom-crawler": "~2.8|~3.0",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.