Edit report at http://bugs.php.net/bug.php?id=53251&edit=1
ID: 53251 Updated by: paj...@php.net Reported by: jeanseb at au-fil-du dot net Summary: bindtextdomain with null directory doesn't return the previously set Status: Feedback Type: Bug Package: Gettext related Operating System: Debian 5.0.6 PHP Version: 5.3.3 Block user comment: N Private report: N New Comment: It is TS on windows now (our builds). But the key part is in my question in the 2nd comment. Questions like to be answered from time to time you know :) Previous Comments: ------------------------------------------------------------------------ [2010-11-24 23:43:15] greno at verizon dot net Gettext is not thread-safe. You cannot run PHP gettext in anything but a non-threaded CGI or prefork mode. We run our webservers prefork to support PHP gettext. And for any production webserver it is best to run either CGI or prefork so that your connections are completely isolated. And PHP gettext performs correctly when used w/CGI or preforking webservers. . ------------------------------------------------------------------------ [2010-11-24 23:39:00] paj...@php.net Besides our little difference about virtual CWD, please try the attached patch against 5.3. It checks if the given directory is empty or NULL (dir length == 0) and if yes, calls bindtextdomain with NULL. Is it what you expect? ------------------------------------------------------------------------ [2010-11-24 23:38:42] paj...@php.net The following patch has been added/updated: Patch Name: Test_if_NULL_or_empty Revision: 1290638321 URL: http://bugs.php.net/patch-display.php?bug=53251&patch=Test_if_NULL_or_empty&revision=1290638321 ------------------------------------------------------------------------ [2010-11-24 23:23:44] paj...@php.net Using your script: it happens exactly what I explained earlier. The library does not find the locale because its CWD is not the same as the script CWD (which is a virtual CWD, created by the engine and specific to the engine). I suppose you use Apache in a non thread safe mode, that won't show you the effect I was referring to as it happens only with threaded SAPI. ------------------------------------------------------------------------ [2010-11-24 20:44:02] greno at verizon dot net The patch upload apparently won't take a zip. The PHP bindtextdomain brokenness demonstration app can be found here: http://greno-misc.googlecode.com/files/testbindtextdomain.zip . ------------------------------------------------------------------------ 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 http://bugs.php.net/bug.php?id=53251 -- Edit this bug report at http://bugs.php.net/bug.php?id=53251&edit=1