On Tue, 2007-08-07 at 19:13 +0300, Jani Taskinen wrote:
> Thread safe for CGI and CLI ? :)
> Or do you find the function useful outside those SAPIs?

Well David's plan is to use the implementation for PHP-level getopt()
and I can imagine doing crazy stuff, so if we can make it thread-safe in
a good way we should do that - I've seen to many people doing too crazy
stuff...

Of course that's not high priority...

johannes
> --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

Reply via email to