【发布时间】:2014-10-04 09:17:30
【问题描述】:
我安装了带有 Corebundle、Blockbundle 和 Adminbundle 的 Symfony CMF (se1.1),所有这些都可以正常工作。现在我安装了 Sonata Cachebundle(Sonata Pagebundle 需要),网站现在显示这个错误:
InvalidConfigurationException:“sonata_cache.caches”下无法识别的选项“symfony”
(我使用 Composer 来安装这个包。)
这里是我关于 Cachebundle 的配置文件列表;
app/AppKernel.php:
new Sonata\CacheBundle\SonataCacheBundle(),
app/autoload.php
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;
/**
* @var ClassLoader $loader
*/
$loader = require __DIR__.'/../vendor/autoload.php';
$loader->add('Sonata', __DIR__);
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
return $loader;
app/config/config.yml
sonata_cache:
caches:
esi:
token: an unique security key # a random one is generated by default
servers:
- varnishadm -T 127.0.0.1:2000 {{ COMMAND }} "{{ EXPRESSION }}"
ssi:
token: an unique security key # a random one is generated by default
mongo:
database: cache
collection: cache
servers:
- {host: 127.0.0.1, port: 27017, user: username, password: pASS'}
- {host: 127.0.0.2}
memcached:
prefix: test # prefix to ensure there is no clash between instances
servers:
- {host: 127.0.0.1, port: 11211, weight: 0}
predis:
servers:
- {host: 127.0.0.1, port: 6379, database: 42}
apc:
token: s3cur3 # token used to clear the related cache
prefix: test # prefix to ensure there is no clash between instances
servers:
- { domain: kooqit.local, ip: 127.0.0.1, port: 80}
symfony:
token: s3cur3 # token used to clear the related cache
php_cache_enabled: true # Optional (default: false), clear APC or PHP OPcache
types: [mytype1, mycustomtype2] # Optional, you can restrict allowed cache types
servers:
- { domain: kooqit.local, ip: 127.0.0.1, port: 80}
app/config/routing.yml
sonata_cache_cache:
resource: '@SonataCacheBundle/Resources/config/routing/cache.xml'
prefix: /
我希望有人能指出这里到底出了什么问题..
【问题讨论】: