phpinsights icon indicating copy to clipboard operation
phpinsights copied to clipboard

[Laravel] Allow to set command parameters from config file

Open eusonlito opened this issue 4 years ago • 3 comments

Q A
Bug report? no
Feature request? yes
Library version 1.13.0

Related with https://github.com/nunomaduro/phpinsights/issues/23 will be a great idea to allow set all commands parameters from config/insights.php when is used with php artisan insights.

Maybe something like:

'parameters' => '--format=json -d memory_limit=2000M -v',

or

'parameters' => [
    '--format=json',
    '-d memory_limit=2000M',
    '-v',
],

Parameters from command line must overwrite config parameters:

php artisan insights --format=html

And also an option to avoid use config will be great:

php artisan insights --no-config-parameters

Thanks!

eusonlito avatar Mar 10 '20 08:03 eusonlito

Hmm, I think passing it like that would be easy, but also quite limiting.
For example the -d memory_limit=2000M wouldn't work, as that has to be supplied before the file.

It might be worth doing something like this Carbonize 2020-03-10 at 10 09 51 as that is also what we have done with other parameters.

olivernybroe avatar Mar 10 '20 09:03 olivernybroe

Would be great, but my idea is set the parameters on config file as similar as console to avoid to users to know how to map console parameters on config file and to avoid to phpinsights developers create new docs with parameters to config map and code conversions.

But, for me, it's great :)

eusonlito avatar Mar 10 '20 09:03 eusonlito

I've added the requested feature in #441 . If there needs to be added more config options please put it in the PR! 😄

quintenbuis avatar Oct 23 '20 20:10 quintenbuis