JulienTant / Laravel-Env-Sync

A package that makes sure that your .env file is in sync with your .env.example
274 stars 25 forks source link

Lumen compatibility #12

Closed Ig0r-M-magic42 closed 5 years ago

Ig0r-M-magic42 commented 5 years ago

Background

Tried to set this repo with Lumen (5.7.6) and it was messing everything up. From composer file

$ composer require jtant/laravel-env-sync
Using version ^1.3 for jtant/laravel-env-sync
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 11 installs, 1 update, 22 removals
  - Removing illuminate/broadcasting (v5.7.11)
  - Removing illuminate/bus (v5.7.11)
  - Removing illuminate/cache (v5.7.11)
  - Removing illuminate/config (v5.7.11)
  - Removing illuminate/console (v5.7.11)
  - Removing illuminate/container (v5.7.11)
  - Removing illuminate/contracts (v5.7.11)
  - Removing illuminate/database (v5.7.11)
  - Removing illuminate/encryption (v5.7.11)
  - Removing illuminate/events (v5.7.11)
  - Removing illuminate/filesystem (v5.7.11)
  - Removing illuminate/hashing (v5.7.11)
  - Removing illuminate/http (v5.7.11)
  - Removing illuminate/log (v5.7.11)
  - Removing illuminate/pagination (v5.7.11)
  - Removing illuminate/pipeline (v5.7.11)
  - Removing illuminate/queue (v5.7.11)
  - Removing illuminate/session (v5.7.11)
  - Removing illuminate/support (v5.7.11)
  - Removing illuminate/translation (v5.7.11)
  - Removing illuminate/validation (v5.7.11)
  - Removing illuminate/view (v5.7.11)
  - Installing symfony/css-selector (v4.1.7): Loading from cache
  - Installing tijsverkoyen/css-to-inline-styles (2.2.1): Loading from cache
  - Installing symfony/routing (v4.1.7): Loading from cache
  - Installing doctrine/lexer (v1.0.1): Loading from cache
  - Installing egulias/email-validator (2.1.6): Loading from cache
  - Installing swiftmailer/swiftmailer (v6.1.3): Loading from cache
  - Installing paragonie/random_compat (v9.99.99): Loading from cache
  - Installing ramsey/uuid (3.8.0): Loading from cache
  - Installing league/flysystem (1.0.49): Loading from cache
  - Installing erusev/parsedown (1.7.1): Loading from cache
  - Updating laravel/framework (v5.7.11 => v5.7.11): Downloading (100%)         
  - Installing jtant/laravel-env-sync (1.3.5): Loading from cache

And php artisan was giving

$ php artisan
PHP Fatal error:  Uncaught ReflectionException: Class path.storage does not exist in ~/vendor/laravel/framework/src/Illuminate/Container/Container.php:779
Stack trace:
#0 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(779): ReflectionClass->__construct('path.storage')
#1 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(658): Illuminate\Container\Container->build('path.storage')
#2 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(609): Illuminate\Container\Container->resolve('path.storage', Array)
#3 ~/vendor/laravel/lumen-framework/src/Application.php(260): Illuminate\Container\Container->make('path.storage', Array)
#4 ~/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(121): Laravel\Lumen\Application->make('path.storage', Array)
#5 ~/vendor/laravel/framework/src/Illumi in ~/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 779

In Container.php line 779:

  Uncaught ReflectionException: Class path.storage does not exist in ~/vendor/laravel/framework/src/Illuminate/Container/Container.php:779   
  Stack trace:                                                                                                                                                           
  #0 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(779): ReflectionClass->__construct('path.storage')                    
  #1 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(658): Illuminate\Container\Container->build('path.storage')           
  #2 ~/vendor/laravel/framework/src/Illuminate/Container/Container.php(609): Illuminate\Container\Container->resolve('path.storage', Array)  
  #3 ~/vendor/laravel/lumen-framework/src/Application.php(260): Illuminate\Container\Container->make('path.storage', Array)                  
  #4 ~/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(121): Laravel\Lumen\Application->make('path.storage', Array)           
  #5 ~/vendor/laravel/framework/src/Illumi                                                                                         

PS

Have you intended to add lumen compatibility ?

Ig0r-M-magic42 commented 5 years ago

If not then it's okay if i use your project as a reflection to create Lumen supported file ?

ghost commented 5 years ago

I have created https://github.com/IgArI0K/lumen-env-sync

jesscarlos commented 5 years ago

I've created a PR which would fix your problem.

https://github.com/JulienTant/Laravel-Env-Sync/pull/16

Ig0r-M-magic42 commented 5 years ago

That can make https://github.com/IgArI0K/lumen-env-sync redundant.