我想创建项目的另一个环境,所以我决定通过源代码控制来完成,而不仅仅是复制源文件的粘贴。
所以我做的是git clone...
cd到应用程序文件夹
运行composer install
安装引发异常:
[RuntimeException]
Could not scan for classes inside "vendor/autoload.php" which does not appear to be a file nor a folder
据我所知,这个vendor/autoload.php
文件应该由composer install
命令生成。 composer update或-no-scripts给出了相同的结果......
这是我的composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"torann/geoip": "0.2.*@dev"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database",
"app/Facades",
"app/Services",
"vendor/autoload.php"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
答案 0 :(得分:2)
从自动加载> classmap
中删除"vendor/autoload.php"
"autoload": {
"classmap": [
"database",
"app/Facades",
"app/Services",
"vendor/autoload.php"
],
答案 1 :(得分:0)
我的linux机器上有一个几乎类似的问题,我的是:
“无法扫描
app/facades
中未显示的类 既不是文件也不是文件夹”
我通过编辑composer.json
解决了这个问题。我在下面的类图中将app/facades
更改为app/Facades
:
"classmap": [
"database/seeds",
"database/factories",
"app/Facades"
]
显然作曲家是区分大小写的,我的facade文件夹是:Facades不是Facades