Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50114 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45439 invoked from network); 6 Nov 2010 20:50:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Nov 2010 20:50:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=tony@daylessday.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tony@daylessday.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain daylessday.org designates 89.208.40.236 as permitted sender) X-PHP-List-Original-Sender: tony@daylessday.org X-Host-Fingerprint: 89.208.40.236 mail.daylessday.org Linux 2.6 Received: from [89.208.40.236] ([89.208.40.236:43531] helo=daylessday.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/A8-19689-A7FB5DC4 for ; Sat, 06 Nov 2010 15:50:03 -0500 Received: from think.site (ppp83-237-194-117.pppoe.mtu-net.ru [83.237.194.117]) by daylessday.org (Postfix) with ESMTPSA id C6996BFA0A2 for ; Sat, 6 Nov 2010 23:49:59 +0300 (MSK) Message-ID: <4CD5BF73.7090600@daylessday.org> Date: Sat, 06 Nov 2010 23:49:55 +0300 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101026 SUSE/3.0.10 Thunderbird/3.0.10 MIME-Version: 1.0 To: internals@lists.php.net References: <4CD463AB.2090702@verizon.net> In-Reply-To: <4CD463AB.2090702@verizon.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] php gettext bindtextdomain behavior From: tony@daylessday.org (Antony Dovgal) 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. -- Wbr, Antony Dovgal --- http://pinba.org - realtime statistics for PHP