从composer
下载hybridauth
后,我总是需要手动在/vendor/composer/autoload_classmap.php
中添加hybridauth的目录,这应该是自动的。
下面是我的composer.json,有人能告诉我为什么hybridauth没有自动写入自动加载的问题吗?
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"require": {
"laravel/framework": "4.0.*",
"way/generators": "dev-master",
"hybridauth/hybridauth": "*",
"intervention/image": "dev-master"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "dev"
}
你试过吗
使用"hybridauth/hybridauth":"dev-master"
也可以尝试
artisan dump自动加载命令
在最新的更新中,他们似乎更改了很多内容,而您的旧代码无法使用它。
如果你没有在classmap文件中自动加载类,那么最好使用HybridAuth的旧版本,即2.9.1
使用"hybridauth/hybridauth":"2.9.1"而不是"hybridauth/hybridauth":"dev-master"
类将在自动加载类映射文件中自动加载。
这对laravel 4和5都很有效