我需要從源代碼控制中自動執行我的生產機器上的laravel項目設置/ 升級。Laravel - 無法從我的源代碼控制安裝
我寫了一個bash腳本來克隆GIT倉庫的源代碼並運行安裝程序。
的git的代碼將文件夾/var/www/prod/mainapp/
,所以下面的bash代碼git的命令後運行:
cd /var/www/prod/mainapp/app/
composer install # composer update will not work as well
php artisan dump-autoload
php artisan optimize
我收到以下錯誤,當代碼達到:php artisan optimize
PHP Fatal error: Class 'App\Providers\SocialUserProvider' not found in /var/www/prod/mainapp/app/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146
我有以下提供:
App\Providers\FacebookGraphProvider::class,
Torann\GeoIP\GeoIPServiceProvider::class,
App\Providers\SocialUserProvider::class,
這是我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.3"
},
"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"
],
"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"
}
}
刪除'軟件\供應商\ SocialUserProvider ::類,'從服務供應商名單,然後'作曲家install' –
@RisulIslam但這不是穩健的,這是我應該做的我每次升級時間?它沒有任何意義... – SexyMF
確保在App \ Providers中有一個名爲'SocialUserProvider'的文件。 –