Hi Andi,

Looks a bit weird. Can you explain the logic you are catching here?

It's slightly less weird than trying to read an INI file called "hello.php" :)

If you don't stipulate a path after -c at present CGI/CLI take the next element entered as being the path to the INI file. If the next element happens to be another switch it'll fail silently (having reverted to the default INI settings along the way of course). If it happens to be a filename (because -c was the final switch) things are worse. Zend doesn't check for a specific filename in the interests of flexibility, so it'll quite happily parse "hello.php" as an INI file. Depending on the contents of "hello.php" you'll see a startup crash, or the process might hang - if you're very lucky you'll get an ini_error message from Zend, but it's a misleading one in that situation since it says there's a problem in "hello.php".

So checking whether -c is the final switch prevents the target file being read as an INI file, and checking whether the next element is another switch prevents silent failure/INI resetting. If there's a better way to do either, please educate me.

- Steph


Andi

At 07:02 PM 6/13/2006, Steph Fox wrote:
Please can someone either apply this or give me a good reason not to?

Diffs are against PHP_5_2. Please say if you need them specifically for other branches.

- Steph


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to