我正在迁移2.8 => 3.3
我用过这个tutorial
但是当我试图清除dev
上的缓存时,我抓住了这个Exceprion:
[学说\共同\注解\ AnnotationException]
[语义错误]类AppBundle \ Controller \ Applicati中的注释“@Sensio \ Bundle \ FrameworkExtraBundle \ Configuration \ Route” onController不存在,或者无法自动加载。
但在prod
上一切正常:
//使用debug false
清除prod环境的缓存
我的app.php
<?php
use Symfony\Component\HttpFoundation\Request;
require __DIR__.'/../vendor/autoload.php';
if (PHP_VERSION_ID < 70000) {
include_once __DIR__.'/../var/bootstrap.php.cache';
}
$kernel = new AppKernel('prod', false);
if (PHP_VERSION_ID < 70000) {
$kernel->loadClassCache();
}
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
app_dev.php
require __DIR__.'/../vendor/autoload.php';
Debug::enable();
$kernel = new AppKernel('dev', true);
if (PHP_VERSION_ID < 70000) {
$kernel->loadClassCache();
}
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
我真的不明白为什么所有这些都适用于prod
而失败dev
需要
"symfony/symfony": "3.3.15",
"symfony/validator": "3.3.*",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^5.1.6",