Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31479 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64669 invoked by uid 1010); 7 Aug 2007 17:23:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 64654 invoked from network); 7 Aug 2007 17:23:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Aug 2007 17:23:34 -0000 Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:48631] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/10-62500-49AA8B64 for ; Tue, 07 Aug 2007 13:23:34 -0400 Received: (qmail 20401 invoked by uid 507); 7 Aug 2007 17:12:53 -0000 Received: from unknown (HELO ?192.168.1.102?) (postmaster%schlueters.de@82.135.71.124) by mail4.netbeat.de with ESMTPA; 7 Aug 2007 17:12:53 -0000 To: jani.taskinen@iki.fi Cc: internals@lists.php.net In-Reply-To: <46B89A27.60503@sci.fi> References: <1186501615.2772.38.camel@johannes.nop> <46B89A27.60503@sci.fi> Content-Type: text/plain; charset=utf-8 Date: Tue, 07 Aug 2007 19:12:45 +0200 Message-ID: <1186506765.2772.42.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-1.fc7) Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [PATCH] Getopt with longopts and windows support - part 2 From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) 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 > > >