我最近更新了 symfony,因为我的供应商不再工作。我有这个错误
Fatal error: Class 'Paging' not found in /home/username/workspace/project/src/project/projectBundle/Controller/MyController.php on line 22
在第 22 和 23 行的 MyController 中,我有
...
$paging = new \Paging($em, $query, $currentPage, $nbOfResults);
$trainings = $paging->run();
...
我试图像这样在 ../vendor/composer/autoload_classmap.php 中添加库,因为它曾经可以工作
'Paging' => $baseDir . '/vendor/se/Paging/Paging.php',
但我收到以下错误
Fatal error: Symfony\Component\ClassLoader\DebugClassLoader::loadClass(): Failed opening required '/home/username/workspace/project/vendor/se/Paging/Paging.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/username/workspace/project/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/DebugClassLoader.php on line 82
我还尝试在项目根目录的 composer.json 文件中添加“适当”行,但没有成功
"autoload": {
"psr-0": {
"": "src/",
"Paging": "vendor/se/Paging/" //I've added this line
}
},
这一切都发生在我使用以下命令行更新我的项目之后
php composer.phar self-update
php composer.phar update
php composer.phar install
我也在跑步
php composer.phar install
每次我更新 composer.json 文件
提前致谢!