自上次更新以来,无法弄清楚如何让symfony2.1.5自动加载我的供应商库

时间:2012-12-13 06:34:52

标签: php symfony

我最近更新了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文件

提前致谢!

0 个答案:

没有答案