laravel / octane

Supercharge your Laravel application's performance.
https://laravel.com/docs/octane
MIT License
3.75k stars 291 forks source link

artisan octane:install cannot update the .env file on Lumen #284

Closed FrontEndCoffee closed 3 years ago

FrontEndCoffee commented 3 years ago

Description:

In order to update the .env file when setting up Octane, the install command tries to resolve the path of the .env file. This is done through the app()->environmentFile() function. Only, this function is not defined in the Lumen Application class.

The error message is really clear, but I'm including it anyway:

In InstallCommand.php line 63:

  Call to undefined method Laravel\Lumen\Application::environmentFile()

The line of code in the install command (in latest 1.x commit): https://github.com/laravel/octane/blob/3ab6e1c221659a2ad0ead019ccbcc151a0e6ae06/src/Commands/InstallCommand.php#L63

Steps To Reproduce:

FrontEndCoffee commented 3 years ago

I have manually completed the octane installation, however, I can see that there is more that doesn't work with lumen. Both StartRoadRunnerCommand and StartSwooleCommand use the Laravel\Octane\Commands\Concerns\InteractsWithEnvironmentVariables trait that has the same problem as the piece of code in the InstallCommand.

And thus, running php artisan octane:start results in:

In InteractsWithEnvironmentVariables.php line 23:

  Call to undefined method Laravel\Lumen\Application::environmentPath()
nunomaduro commented 3 years ago

Since Lumen is a totally separate framework from Laravel, it does not intentionally offer compatibility with any additional Laravel libraries like Cashier, Octane, Passport, Scout, etc. If your application requires the functionality provided by these libraries, please use the Laravel framework.