Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32516 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33781 invoked by uid 1010); 1 Oct 2007 14:05:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 33765 invoked from network); 1 Oct 2007 14:05:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Oct 2007 14:05:36 -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:1726] helo=outbound.mailhop.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F6/B3-25534-DAEF0074 for ; Mon, 01 Oct 2007 10:05:33 -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.68) (envelope-from ) id 1IcLtq-0003Jh-JB; Mon, 01 Oct 2007 10:05:30 -0400 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/BsSuDUmcWoIHjewXRMW+B0FDkjY/VyNA= Reply-To: jani.taskinen@iki.fi To: David Soria Parra Cc: internals@lists.php.net In-Reply-To: References: Content-Type: text/plain Date: Mon, 01 Oct 2007 17:05:28 +0300 Message-ID: <1191247528.3349.2.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) Patch applied to HEAD / PHP_5_3. --Jani 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. > > 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. > -- Patches/Donations: http://pecl.php.net/~jani/