Thread safe for CGI and CLI ? :)
Or do you find the function useful outside those SAPIs?
--Jani
Johannes Schlüter kirjoitti:
David,
On Mon, 2007-08-06 at 09:57 -0400, David Soria Parra wrote:
Hi internals,
so based on a discussion of php.pecl we thought about using the php_getopt
for the PHP_FUNCTION(getopt) instead of the system provided getopt. Here
is the patch for that. Hopefully someone is reviewing and commiting the
patch as i don't have karma.
The idea is good imo, but there are a few things we have to do:
- We need more tests, as far as I saw using grep we just have a single
testcase for getopt() which is certainly not enough when replacing the
implementation.
- The current implementation is not thread-safe, I don't know about the
glibc implementation but if we use our own implementation for
PHP's getopt function that should be threadsafe.
- If you move php_getopt to main you have to mark it as PHPAPI so the
SAPIs can use it.
Maybe there's more, didn't do a deeper review of the patch, yet, since
I'd like to wait a) until Jani moved the files and b) we have more
tests :-)
johannes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php