Bug #53251 [Com]: bindtextdomain with null directory doesn't return the previously set

From: Date: Mon, 29 Aug 2011 09:26:09 +0000
Subject: Bug #53251 [Com]: bindtextdomain with null directory doesn't return the previously set
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-163098@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=53251&edit=1

 ID:                 53251
 Comment by:         qing0088 at hotmail dot com
 Reported by:        jeanseb at au-fil-du dot net
 Summary:            bindtextdomain with null directory doesn't return
                     the previously set
 Status:             Assigned
 Type:               Bug
 Package:            Gettext related
 Operating System:   Debian 5.0.6
 PHP Version:        5.3.3
 Assigned To:        pajoye
 Block user comment: N
 Private report:     N

 New Comment:

http://www.wholesaleusajerseys.us/nfl-jerseys-c-8.html	Wholesale
NFL Jerseys
http://www.wholesaleusajerseys.us/nhl-jerseys-c-92.html	Wholesale
NHL Jerseys
http://www.wholesaleusajerseys.us/soccer-country-c-153.html	Wholesale
Soccer Jerseys


Previous Comments:
------------------------------------------------------------------------
[2010-11-26 23:12:03] greno at verizon dot net

Please, I do read and consider all of your comments.

And I understand the concern about the TS build.  

I was merely trying to convey that I have not seen or read about any evidence that is convincing
that using gettext in threads would be successful given the current state of the underlying GNU
gettext library.

I based this on things like this:

Checking latest gettext manual here:
http://www.gnu.org/software/gettext/manual/gettext.html#PHP

It shows that PHP 'uses' not 'emulates' the GNU underlying gettext library.  The
GNU library is not thread-safe.

Checking PHP gettext in the manual:
http://www.php.net/manual/en/gettext.requirements.php

It shows a comment stating that PHP gettext is not thread-safe and even gives an example of one of
the environment variables that can drive the underlying GNU gettext library.  The comment supports
other places of information that basically assert the same thing.



I certainly agree, if you need to put some type of ifdef TSMODE or whatever in the patch OK, please
by all means put it in there.  That only would apply to the threaded model so it would be a NOP to
those using the non-threaded model.  If you need to force the fact that the bound directory must
exist for whatever reason in the threaded model, OK, that's some limitation of the threaded
model. It deviates from the defined GNU bindtextdomain behavior but to get a threaded model working
maybe that's a necessary tradeoff.


My only goal is to get a patch in PHP 5.2 and 5.3 asap to fix the current brokenness of
bindtextdomain.


.

------------------------------------------------------------------------
[2010-11-26 21:03:57] pajoye@php.net

I really appreciate your feedback but it tends to be a monologue. You totally ignore any comment you
disagree with or don't care about.

I explained already many times why and when we should care about that. I even pointed to the gettext
documentation telling that. So let say that unless you have something new to say, the problem is
identified and will be fixed asap.

------------------------------------------------------------------------
[2010-11-26 20:51:39] greno at verizon dot net

Gettext is not thread-safe.  You shouldn't need to worry about trying to get gettext working in
threads.  The underlying gettext library would first have to be made thread-safe and no longer able
to be driven by environment variables.

Gettext can be driven by environment variables and unless you have a way to set up completely
different environments for each thread, then there is never going to be a way to reliably use
gettext in threads.  One thread could set an env var to one value and another thread in the same
process set the env var to a different value and both of these threads would see the value set by
the latest thread.  And gettext would behave according to the latest setting which would totally
screw up the earlier thread.


.

------------------------------------------------------------------------
[2010-11-26 20:43:18] pajoye@php.net

Thanks for the patch. But it is sadly not correct. We have to get the realpath of the directory
argument in TS mode.

------------------------------------------------------------------------
[2010-11-26 20:37:50] greno at verizon dot net

I've attached a patch (fix_broken_bindtextdomain) to the bug which should correct the
bindtextdomain problem.  

And I prepared phpt tests (see my second set of phpt tests zip file in a previous posting) that can
test the bindtextdomain NULL arg functionality.  

So everything is here and available to fix bindtextdomain in PHP 5.2.15 and 5.3.3.


.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=53251


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=53251&edit=1


Thread (49 messages)

« previous php.bugs (#163098) next »