Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/260.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Lumen 5.3:/var/www/project/vendor/illume/container/container.php:749中的“类文件系统不存在”_Php_Laravel_Lumen - Fatal编程技术网

Lumen 5.3:/var/www/project/vendor/illume/container/container.php:749中的“类文件系统不存在”

Lumen 5.3:/var/www/project/vendor/illume/container/container.php:749中的“类文件系统不存在”,php,laravel,lumen,Php,Laravel,Lumen,我一直在尝试将我们的api从Laravel迁移到Lumen,但在尝试运行简单的artisan命令时,出现以下错误: [2017-06-24 02:36:24] lumen.ERROR: exception 'ReflectionException' with message 'Class filesystem does not exist' in /var/www/{project-folder}/vendor/illuminate/container/Container.php:749 Sta

我一直在尝试将我们的api从Laravel迁移到Lumen,但在尝试运行简单的artisan命令时,出现以下错误:

[2017-06-24 02:36:24] lumen.ERROR: exception 'ReflectionException' with message 'Class filesystem does not exist' in /var/www/{project-folder}/vendor/illuminate/container/Container.php:749
Stack trace:
#0 /var/www/{project-folder}/vendor/illuminate/container/Container.php(749): ReflectionClass->__construct('filesystem')
#1 /var/www/{project-folder}/vendor/illuminate/container/Container.php(644): Illuminate\Container\Container->build('filesystem', Array)
#2 /var/www/{project-folder}/vendor/laravel/lumen-framework/src/Application.php(212): Illuminate\Container\Container->make('filesystem', Array)
#3 /var/www/{project-folder}/vendor/illuminate/container/Container.php(1203): Laravel\Lumen\Application->make('filesystem')
#4 /var/www/{project-folder}/vendor/illuminate/support/Facades/Facade.php(175): Illuminate\Container\Container->offsetGet('filesystem')
#5 /var/www/{project-folder}/vendor/illuminate/support/Facades/Facade.php(144): Illuminate\Support\Facades\Facade::resolveFacadeInstance('filesystem')
#6 /var/www/{project-folder}/vendor/illuminate/support/Facades/Facade.php(231): Illuminate\Support\Facades\Facade::getFacadeRoot()
#7 /var/www/{project-folder}/vendor/websight/l5-google-cloud-storage/src/Websight/GcsProvider/CloudStorageServiceProvider.php(46): Illuminate\Support\Facades\Facade::__callStatic('extend', Array)
#8 /var/www/{project-folder}/vendor/websight/l5-google-cloud-storage/src/Websight/GcsProvider/CloudStorageServiceProvider.php(46): Illuminate\Support\Facades\Storage::extend('gcs', Object(Closure))
#9 [internal function]: Websight\GcsProvider\CloudStorageServiceProvider->boot()
#10 /var/www/{project-folder}/vendor/illuminate/container/Container.php(508): call_user_func_array(Array, Array)
#11 /var/www/{project-folder}/vendor/laravel/lumen-framework/src/Application.php(178): Illuminate\Container\Container->call(Array)
#12 /var/www/{project-folder}/bootstrap/app.php(87): Laravel\Lumen\Application->register('Websight\\GcsPro...')
#13 /var/www/{project-folder}/artisan(18): require('/var/www/daysta...')
#14 {main}  
这就是我们的app.php的样子

<?php

require_once __DIR__.'/../vendor/autoload.php';

try {
    (new Dotenv\Dotenv(__DIR__.'/../'))->load();
} catch (Dotenv\Exception\InvalidPathException $e) {
    //
}

/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| Here we will load the environment and create the application instance
| that serves as the central piece of this framework. We'll use this
| application as an "IoC" container and router for this framework.
|
*/

$app = new Laravel\Lumen\Application(
    realpath(__DIR__.'/../')
);

 $app->withFacades();
 $app->withEloquent();

/*
|--------------------------------------------------------------------------
| Register Container Bindings
|--------------------------------------------------------------------------
|
| Now we will register a few bindings in the service container. We will
| register the exception handler and the console kernel. You may add
| your own bindings here if you like or you can make another file.
|
*/

$app->singleton(
    Illuminate\Contracts\Debug\ExceptionHandler::class,
    App\Exceptions\Handler::class
);

$app->singleton(
    Illuminate\Contracts\Console\Kernel::class,
    App\Console\Kernel::class
);

/*
|--------------------------------------------------------------------------
| Register Middleware
|--------------------------------------------------------------------------
|
| Next, we will register the middleware with the application. These can
| be global middleware that run before and after each request into a
| route or middleware that'll be assigned to some specific routes.
|
*/

// $app->middleware([
//    App\Http\Middleware\ExampleMiddleware::class
// ]);

// $app->routeMiddleware([
//     'auth' => App\Http\Middleware\Authenticate::class,
// ]);

/*
|--------------------------------------------------------------------------
| Register Service Providers
|--------------------------------------------------------------------------
|
| Here we will register all of the application's service providers which
| are used to bind services into the container. Service providers are
| totally optional, so you are not required to uncomment this line.
|
*/

 $app->register(App\Providers\AppServiceProvider::class);
 $app->register(App\Providers\AuthServiceProvider::class);
 $app->register(App\Providers\EventServiceProvider::class);
 $app->register(Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class);
 $app->register(Barryvdh\Cors\ServiceProvider::class);
 $app->register(Illuminate\Redis\RedisServiceProvider::class);
 $app->register(Bogardo\Mailgun\MailgunServiceProvider::class);
 $app->register(Websight\GcsProvider\CloudStorageServiceProvider::class);
 $app->register(GrahamCampbell\Flysystem\FlysystemServiceProvider::class);
 $app->register(Illuminate\Filesystem\FilesystemServiceProvider::class);
 $app->register(Illuminate\Cache\CacheServiceProvider::class);

 /*
  * configuration files
  */
 $app->configure('jwt');
 $app->configure('cors');
 $app->configure('database');
 $app->configure('cache');
 $app->configure('queue');
 $app->configure('mailgun');
 $app->configure('mail');
 $app->configure('filesystem');

/*
|--------------------------------------------------------------------------
| Load The Application Routes
|--------------------------------------------------------------------------
|
| Next we will include the routes file so that they can all be added to
| the application. This will provide all of the URLs the application
| can respond to, as well as the controllers that may handle them.
|
*/

$app->group(['namespace' => 'App\Http\Controllers'], function ($app) {
    require __DIR__.'/../routes/web.php';
});

return $app;
我知道不是所有的功能,从拉威尔是目前在流明,但有什么我在这里错过了

<?php

namespace Websight\GcsProvider;

use ErrorException;
use Google_Auth_AssertionCredentials;
use Google_Client;
use Google_Service_Storage;
use Illuminate\Support\ServiceProvider;
use League\Flysystem\Filesystem;
use Illuminate\Support\Facades\Storage;
use Superbalist\Flysystem\GoogleStorage\GoogleStorageAdapter;

    /**
     * Class CloudStorageServiceProvider
     * Configures Google Cloud Storage Access for flysystem
     *
     * @package Websight\GcsProvider
     */
    class CloudStorageServiceProvider extends ServiceProvider
    {
        /**
         * Bootstrap the application services.
         *
         * @return void
         */
        public function boot()
        {
            Storage::extend('gcs', function ($app, $config) {
                $credentials = new Google_Auth_AssertionCredentials(
                    $config['service_account'],
                    [
                        Google_Service_Storage::DEVSTORAGE_FULL_CONTROL
                    ],
                    file_get_contents($config['service_account_certificate']),
                    $config['service_account_certificate_password']
                );

                $client = new Google_Client();
                $client->setAssertionCredentials($credentials);

                $service = new Google_Service_Storage($client);
                $adapter = new GoogleStorageAdapter($service, $config['bucket']);

                return new Filesystem($adapter);
            });
        }

        /**
         * Register the application services.
         *
         * @return void
         */
        public function register()
        {
            // Not needed
        }
    }

在bootstrap/app.php中的容器绑定下添加以下内容


Websight\GcsProvider\CloudStorageServiceProvider的启动方法中有什么东西正在使用文件系统,它无法解决。@我向服务提供程序发布了一个问题吗?我收到一个错误php artisan list php致命错误:达到最大函数嵌套级别“256”,正在中止!在第580行的/var/www/folder/vendor/laravel/lumen framework/src/Application.php中,php堆栈跟踪:PHP1。{main}/var/www/folder/artisan:0这似乎是Laravel 5.3.0的问题,在5.3.1中得到了修复。在Lumen 5.5中,我添加了上述代码,并在app/config/filesystems.php中添加了一个从这里复制的配置文件。在Lumen 5.6中,我还必须在composer.json:league/flysystem:^1.0.8中添加flysystem依赖性
$app->singleton('filesystem', function ($app) {
    return $app->loadComponent('filesystems', 'Illuminate\Filesystem\FilesystemServiceProvider', 'filesystem');
});