-1

我在本地从事 Laravel 项目,突然开始出现以下异常:

ErrorException in FilesystemManager.php line 193: Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found (View: /Users/mypetproject/resources/views/layouts/topheader.blade.php) (View: /Users/mypetproject/resources/views/layouts/topheader.blade.php) (View: /Users/mypetproject/resources/views/layouts/topheader.blade.php)

这个版本在服务器上运行没有任何问题。只是为了验证,我检查了相同的分支,比较composer.jsoncomposer.lock文件,它们在本地和服务器上是相同的,做了一个composer update以防万一,它仍然在本地失败,但在服务器中没有。.env文件也是一样的。

FilesystemManager位于 vender/laravel/framework/src/Illuminate/Filesystem 中,并且确实尝试过,use League\Flysystem\AwsS3v3\AwsS3Adapter as S3Adapter;但是在服务器上运行的版本也是如此。

请注意,我根本没有使用 S3,而且我真的不想安装league/flysystem-aws-s3-v3,因为我没有使用它。

知道有什么问题吗?

这是我的 composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.3.*",
        "laravelcollective/html": "5.3.*",
        "guzzlehttp/guzzle": "^6.2",
        "google/cloud-storage": "1.1.5"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "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
}

4

1 回答 1

0

我终于找到了供应商/作曲家/中的autoload_static.php和文件autoload_classmap.php

由于某种原因,它引用了一个不正确的文件(以前使用 S3 的文件):

'App\\IsoClasses\\IsoStorage' => __DIR__ . '/../..' . '/app/IsoClasses/IsoStorageS3.php',

更新为

'App\\IsoClasses\\IsoStorage' => __DIR__ . '/../..' . '/app/IsoClasses/IsoStorage.php',

现在它可以工作了。

奇怪的是开发服务器的文件也有这个,但它在开发服务器中运行没有问题。

于 2019-05-29T11:34:52.263 回答