Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31476 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76920 invoked by uid 1010); 7 Aug 2007 15:00:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 76889 invoked from network); 7 Aug 2007 15:00:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Aug 2007 15:00:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=jani.taskinen@sci.fi; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jani.taskinen@sci.fi; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sci.fi from 63.208.196.171 cause and error) X-PHP-List-Original-Sender: jani.taskinen@sci.fi X-Host-Fingerprint: 63.208.196.171 outbound.mailhop.org FreeBSD 4.6-4.9 Received: from [63.208.196.171] ([63.208.196.171:1258] helo=outbound.mailhop.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/65-21017-70988B64 for ; Tue, 07 Aug 2007 11:00:32 -0400 Received: from pc128.sanomamagazines.fi ([194.211.146.128] helo=[10.26.8.44]) by outbound.mailhop.org with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.63) (envelope-from ) id 1IIQXO-000BK0-1z; Tue, 07 Aug 2007 10:59:58 -0400 X-MHO-User: U2FsdGVkX19OG+u0HOwJjV8VXpStaVQAoNQg7fvZNCM= X-MHO-User: U2FsdGVkX18TlwjuXojLRGsk2JaUCCxtufUiH6HNVeo= X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 194.211.146.128 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+m+ZuNWs9N93v0Nt4f50ooMB/YVqijJk8= Reply-To: jani.taskinen@iki.fi To: Marcus Boerger Cc: internals@lists.php.net, David Soria Parra In-Reply-To: <257742794.20070807142252@marcus-boerger.de> References: <257742794.20070807142252@marcus-boerger.de> Content-Type: text/plain Date: Tue, 07 Aug 2007 17:59:56 +0300 Message-ID: <1186498796.3401.0.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] Getopt with longopts and windows support - part 2 From: jani.taskinen@sci.fi (Jani Taskinen) Yes, I know about this. I was wondering about this thing long time ago..just never got around doing anything about it.. :D But let's wait for PHP 5.3 branch to get opened first. --Jani On Tue, 2007-08-07 at 14:22 +0200, Marcus Boerger wrote: > Hello Jani, > > David has a point here. So first of all we should move getopt > implementation out of CLI/CGI and into main. Could you do that > first Jani? > > marcus > > Monday, August 6, 2007, 3:57:26 PM, you 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. > > > It addes main/getopt.c main/php_getopt.h to the build system and uses the > > php_getopt function in the ext/standard/basic_functions.c. Furthermore it > > removes all HAVE_GETOPT and HARTMUT_0 switches. it also enable longopts > > for both win and linux in the form > > > > $opt = getopt("a", array("param:", "param2")); > > > Where ":" in the longopts marks that the parameter takes an argument. > > > The main/getopt.c and main/php_getopt.h is in fact taken from > > sapi/cli/getopt.c and sapi/cli/php_getopt.h but is slightly modified. > > > http://experimentalworks.net/~dsp/getopt.patch.tar.gz > > > It also runs on windows. > > > To apply the patch: > > 1) remove > > sapi/cli/getopt.c sapi/cli/php_getopt.h > > sapi/cgi/getopt.c sapi/cgi/php_getopt.h > > > 2) add main/getopt.c and main/php_getopt.h frm the archive > > 3) apply the patch. > > > > > Best regards, > Marcus >