-
-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lumen compatability #247
Lumen compatability #247
Conversation
b184a29
to
fff245e
Compare
$this->publishes([ | ||
__DIR__ . '/../../../../stubs/laravel.php' => $this->app->configPath('insights.php'), | ||
], 'config'); | ||
if (strpos($this->app->version(), 'Lumen') !== 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you double check that this code is working as expected in a normal lararel application?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a method called version
in Laravel, and that one just returns a version number in Laravel.
However I think a "better" way to do this is to check $this->app
implements Illuminate\Contracts\Foundation\Application
, because then we know it's a Laravel project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I did write the instanceof version first and changed it, I'll switch back to... always trust your initial thoughts!
4f20c54
to
2f3cfee
Compare
2f3cfee
to
842ea54
Compare
Made the requested changes and rebased onto the current version of master. I can also confirm that I have tested it with a Laravel installation and the service provider still works as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect.
Following the conversion in #235 this PR updates the Laravel service provider to detect when it is being used in a Lumen application and avoid calling
$this->publishes
as the publish command is not available.We could potentially make a separate Lumen service provider if preferred.
With the above changes in mind, I also updated the documentation to provide steps for install phpinsights in a Lumen app.