Wenn ich versuche, unser bestehendes Projekt von Laravel 5,1 bis Laravel 5.2 mit dem offiziellen Guide zu aktualisieren, erhalte ich einen Fehler nach Komponisten Update, wenn die Post-UpdateLaravel 5.1 bis 5.2 Upgrade-Fehler
php Handwerker klar kompilierte
wird ausgeführt. Hier ist der Fehler.
Klasse Illuminate \ Foundation \ Composer existiert nicht
Hat jemand ein ähnliches Problem gehabt? Wenn ich das Composer-Update mit dem Flag no scripts ausfühle, wird es regelmäßig aktualisiert, so dass es ein Problem mit dem clear-compiled ist.
Unten sind meine Service Provider und meine composer.json Datei.
Dienstleister
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
// Illuminate\Redis\RedisServiceProvider::class,
Vetruvet\PhpRedis\PhpRedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
Laravel\Socialite\SocialiteServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
Torann\GeoIP\GeoIPServiceProvider::class,
Jenssegers\Agent\AgentServiceProvider::class,
Barryvdh\Debugbar\ServiceProvider::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.*",
"fzaninotto/faker": "^[email protected]",
"laravelcollective/html": "5.2.*",
"laravelcollective/remote": "~5.2",
"kriswallsmith/assetic": "^[email protected]",
"pda/pheanstalk": "^[email protected]",
"aws/aws-sdk-php-laravel": "~3.0",
"illuminate/http": "~5.2",
"illuminate/session": "~5.2",
"illuminate/support": "~5.2",
"nesbot/carbon": "~1.18",
"guzzlehttp/guzzle": "~5.3|~6.0",
"vetruvet/laravel-phpredis": "dev-master",
"predis/predis": "^[email protected]",
"laravel/socialite": "^[email protected]",
"intervention/image": "^[email protected]",
"brightcove/api": "^[email protected]",
"torann/geoip": "dev-master",
"graham-campbell/throttle": "~5.1",
"jenssegers/agent": "^[email protected]"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"symfony/dom-crawler": "~3.0",
"symfony/css-selector": "~3.0",
"barryvdh/laravel-debugbar": "^[email protected]",
"laracasts/generators": "dev-master"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/nardev/laravel-vzaar.git"
}
],
"autoload": {
"classmap": [
"database",
"app/Models",
"app/Footgoll"
],
"files": [
"app/helpers.php"
],
"psr-4": {
"Myapp\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "dev",
"prefer-stable": true
}
Als ich
laufengrep -nH -d recurse 'Composer' Bootstrap/app/config/
Rückgabe:
bootstrap/autoload.php: 7: | Registrieren Sie den Composer Auto Loader bootstrap/autoload.php: 10: | Composer bietet einen praktischen, automatisch generierten Klassenlader bootstrap/autoload.php: 42: | wenn lokal gearbeitet wird. Allerdings müssen wir in dem Komponisten
Dies ist, wie die autoload.php Datei aussieht laden:
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Composer Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Include The Compiled Class File
|--------------------------------------------------------------------------
|
| To dramatically increase your application's performance, you may use a
| compiled class file which contains all of the classes commonly used
| by a request. The Artisan "optimize" is used to create this file.
|
*/
$compiledPath = __DIR__.'/cache/compiled.php';
if (file_exists($compiledPath)) {
require $compiledPath;
}
/*
|--------------------------------------------------------------------------
| Register The Workbench Loaders
|--------------------------------------------------------------------------
|
| The Laravel workbench provides a convenient place to develop packages
| when working locally. However we will need to load in the Composer
| auto-load files for the packages so that these can be used here.
|
*/
if (is_dir($workbench = __DIR__.'/../workbench'))
{
Xtwoend\Workbench\Starter::start($workbench);
}
Könnte es etwas über die Werkbank sein?
Update: eine wirklich schreckliche Lösung der Rückkehr der Composer.php von 5.1 nach Vendor/Laravel/Framework/src/Illuminate/Foundation lässt die App normal funktionieren, aber ich brauche wirklich eine bessere Lösung, die auf die Produktion geschoben werden kann .
ich das gleiche Problem habe und auch nach einer Lösung suchen. – murze
Nein, das Autoload ist nicht relevant. Das sind nur Kommentare. Der Grep sagt, dass es keinen Bezug zur Klasse "Composer" gibt. Ich glaube wirklich, dass das Entfernen der 'compiled.php'-Datei es reparierte und Sie müssen nur Composer erneut ausführen. – andrewtweber
Für zukünftige Leser können Sie [das Upgrade von Laravel 5.1 auf Laravel 5.2 automatisieren] (https://laravelshift.com/upgrade -Laravel-5.1-zu-Laravel-5.2). –