Open joanhey opened 1 year ago
Hmm, that appears to be reasonable. @kelunik, @clue, thoughts?
I guess it should be another function instead of a boolean parameter? I haven't felt any need for it, yet.
The problem is that any app or framework, normally use a link to phpinfo()
to show the information.
So another parameter to phpinfo() or another function don't work, without change the code in the app or fw.
Example:
If you use Amp, React, or something similar, you'll want the HTML as string anyway instead of writing to the output buffer. But I've read the docs now, switching to text mode on CLI magically isn't really helpful in that case.
The image from before is Symfony with Workerman. But also work with Slim, Laravel, Lumen, Yii, CakePHP, KumbiaPHP, ... and the apps using these frameworks.
And for that we need to use the output buffers, to show all the pages.
So it is NOT a problem for the phpinfo()
too.
I'll show you a video with Workerman and Symfony.
And the problem with phpinfo()
now. Of course, we can create a new phpinfo()
in Workerman, but why not use the one from PHP.
https://user-images.githubusercontent.com/249085/206700896-7866889b-8c75-4762-b002-b6ac3ec1963f.mp4
Description
Every time exist more CLI app frameworks: amp, react, workerman, ...
And
phpinfo(int $what = INFO_ALL): bool
allways return an string output without HTML. Every framework can create an html output, but I think that will be better return the same than in other SAPIs. Now it's hardcoded in the C code the output.~Please add another parameter $html~
~
phpinfo(int $what = INFO_ALL, $html = true): bool
~ Or add a option inphp.ini
,phpinfo.html=false
, perhaps it's easier. By default for CLI will be false. But will be changed easily for any CLI framework.Thank you !!