好的,这让我走到了边缘......所以我开始了新的Symfony 2.7项目。然后我继续进行配置,然后进行数据库设置,这是我每次输入app/console doctrine
命令时都会遇到的问题我得到了这个错误:
PHP Fatal error: Class 'Doctrine\Common\Annotations\AnnotationRegistry' not found in /Users/Tomazi/Dev/symfony2test/app/autoload.php on line 11
PHP Stack trace:
PHP 1. {main}() /Users/Tomazi/Dev/symfony2test/app/console:0
PHP 2. require_once() /Users/Tomazi/Dev/symfony2test/app/console:10
PHP 3. require_once() /Users/Tomazi/Dev/symfony2test/app/bootstrap.php.cache:5
Fatal error: Class 'Doctrine\Common\Annotations\AnnotationRegistry' not found in /Users/Tomazi/Dev/symfony2test/app/autoload.php on line 11
Call Stack:
0.0010 224456 1. {main}() /Users/Tomazi/Dev/symfony2test/app/console:0
0.0184 406824 2. require_once('/Users/Tomazi/Dev/symfony2test/app/bootstrap.php.cache') /Users/Tomazi/Dev/symfony2test/app/console:10
0.0187 407592 3. require_once('/Users/Tomazi/Dev/symfony2test/app/autoload.php') /Users/Tomazi/Dev/symfony2test/app/bootstrap.php.cache:5
查看错误我理解app / autoloader.php中缺少Doctrine\Common\Annotations\AnnotationRegistry
?
autoloader.php:
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;
/**
* @var ClassLoader $loader
*/
$loader = require __DIR__.'/../vendor/autoload.php';
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
return $loader;
在我的自动加载器中,所谓的缺失类与namespac一起使用......
导致此错误的原因是什么......?