Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50116 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50340 invoked from network); 6 Nov 2010 21:32:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2010 21:32:39 -0000 Authentication-Results: pb1.pair.com header.from=greno@verizon.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=greno@verizon.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain verizon.net designates 206.46.173.7 as permitted sender) X-PHP-List-Original-Sender: greno@verizon.net X-Host-Fingerprint: 206.46.173.7 vms173007pub.verizon.net Solaris 10 1203 Received: from [206.46.173.7] ([206.46.173.7:36499] helo=vms173007pub.verizon.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/79-19689-679C5DC4 for ; Sat, 06 Nov 2010 16:32:38 -0500 Received: from [192.168.1.46] ([unknown] [72.91.189.24]) by vms173007.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LBH007M0FU7Y0C0@vms173007.mailsrvcs.net> for internals@lists.php.net; Sat, 06 Nov 2010 16:32:31 -0500 (CDT) Message-ID: <4CD5C9F2.50405@verizon.net> Date: Sat, 06 Nov 2010 17:34:42 -0400 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-version: 1.0 To: internals@lists.php.net References: <4CD463AB.2090702@verizon.net> <4CD5BF73.7090600@daylessday.org> In-reply-to: <4CD5BF73.7090600@daylessday.org> Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit Subject: Re: [PHP-DEV] php gettext bindtextdomain behavior From: greno@verizon.net (Gerry Reno) On 11/06/2010 04:49 PM, Antony Dovgal wrote: > On 11/05/2010 11:06 PM, Gerry Reno wrote: > >> In PHP 5.2.4 (my version) the gettext bindtextdomain function is not >> returning the existing directory settings when the directory argument is >> NULL. >> That is the expected behavior for bindtextdomain with GNU and it works >> this way elsewhere such as in python. >> > >> With PHP what happens is that is just returns the current directory >> rather than the existing bindtextdomain directory setting. >> >> PHP EXAMPLE: >> bindtextdomain("messages", "./locale"); >> textdomain("messages"); >> >> print bindtextdomain("messages",NULL)."\n"; >> print textdomain(NULL)."\n"; >> >> ACTUAL: (incorrect) >> # php test.php >> /var/www/htdocs >> messages >> >> EXPECTED: >> # php test.php >> ./locale >> messages >> >> Can PHP gettext bindtextdomain be fixed to correctly return the existing >> setting when called with a NULL directory argument? >> > PHP of course just calls GNU textdomain() and you see the result the original function returns, > not some PHP-specific result. > And no, I cannot reproduce this with PHP 5.3.4-dev or PHP 5.2.15-dev. > You might want to update your PHP and try again. > > If you're still able to reproduce it - make sure the problem doesn't appear > to be in some distro-specific patch, i.e. get the original source tarball > from php.net and check if the problem actually exists there. > After that you're welcome to fill a bug-report. > > The function 'textdomain' is not the problem. It is 'bindtextdomain' that has the problem. I tried this on a newer PHP 5.3.2 installation and it has the exact same problem. root@grp-01-23-02:/tmp# php --version PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:49:46) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies root@grp-01-23-02:/tmp# cat test.php root@grp-01-23-02:/tmp# php test.php /tmp messages The correct output should have been: ./locale messages