Req #24334 [Opn->Csd]: php.ini settings override php-cli.ini settings
Edit report at https://bugs.php.net/bug.php?id=24334&edit=1
ID: 24334
Updated by: krakjoe@php.net
Reported by: otacon at octo dot sytes dot net
Summary: php.ini settings override php-cli.ini settings
-Status: Open
+Status: Closed
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: FreeBSD 4.8
PHP Version: 4.3.2
-Assigned To:
+Assigned To: krakjoe
Block user comment: N
Private report: N
New Comment:
SAPI specific files are independent ... I'm not sure when this change happened ... sorry about
the wait :)
Previous Comments:
------------------------------------------------------------------------
[2003-06-25 07:38:40] otacon at octo dot sytes dot net
Description:
------------
Let me just emphasize now that this is not a bug, just an example
leading into a change request.
Example Scenario:
When fgets(STDIN, [int]) is called in a PHP (CLI) shell script, the
script will not display previous output if the output buffer has not been
filled. The user is then left at a prompt, and the script pauses,
expecting input. This can be avoided by setting the "output_buffering =
0" in php.ini, or by adding ob_flush_implicit(true) to your script and
adding ob_flush() before every call to STDIN.
Change Request:
The second method makes for messy scripts. The first method
completely solves this, but only by editing php.ini because
output_buffering() may not be changed on-the-fly with ini_set().
Because the manipulated variable, "output_buffering = ...", affects
both environments, I am suggesting allowing an option for php-cli.ini to
override settings in php.ini.
php-cli.ini, in my php configuration directory, is parsed as an additional
file, but the values from php-cli.ini are overrided by the values in
php.ini. There is no independence of the CLI and webserver
environment, each of which is unique (static vs. dynamic). So, in this
case, I would not be able to choose output_buffering enabled for
webserver, and disabled for CLI.
Another instance of this problem arising could be in PHP-Gtk, yet
another dynamic user-interface involved in PHP development.
If it is at all possible to do this with PHP-4.3.2, (other than using the
redundant ob_flush() method), please inform me.
Patrick Clery
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=24334&edit=1
Thread (2 messages)