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: make test TESTS=/path/to/php/ext/gettext/tests from your build directory. or you can run run-test.php manually, see the howto links for the details or php run-tests.php --help Previous Comments: ------------------------------------------------------------------------ [2010-11-25 01:31:51] greno at verizon dot net How do you run a phpt test from the command line? . ------------------------------------------------------------------------ [2010-11-25 01:19:33] paj...@php.net It would be very helpful if you can write it as phpt :) See http://qa.php.net/write-test.php ------------------------------------------------------------------------ [2010-11-25 01:17:32] greno at verizon dot net If it can pass the following tests on Linux then it should be Ok: http://greno-misc.googlecode.com/files/testbindtextdomain.php . ------------------------------------------------------------------------ [2010-11-25 00:44:22] paj...@php.net "That warning is just to make sure that people understand that when you use relative domain dir setting that if you chdir() then the domain dir is going to follow as well since it is relative" It is not "just" a warning, it is exactly what I explained, php uses chdir before you even get the hand (pls keep in mind TS and NTS sapi). "bindtextdomain(domain, NULL) just needs to return whatever setting you gave to it previously." That's where it could be hard. However I could modify the patch (mines, not the other) to: 1. make a path absolute only when a TS SAPI is used (php builds in TS mode) 2. pass NULL when NULL is given, empty string may be considered as '.', for BC reasons Doing so will create no wtf for the users and it will do what you are looking for. ------------------------------------------------------------------------ [2010-11-25 00:15:59] greno at verizon dot net That warning is just to make sure that people understand that when you use relative domain dir setting that if you chdir() then the domain dir is going to follow as well since it is relative. I mean it shouldn't even be necessary to give such a warning. Only total newbies would not understand how relative and absolute would behave. In many cases using relative setting is exactly what you want because you have a bunch of standalone apps with their own translation stores and you are just integrating as-is. So relative mapping works very well in this case. If you are building one humongous app and you want all translations from everywhere to be in one translation store then absolute mapping makes sense in that case. The are good and valid use cases for both types of bindings. bindtextdomain(domain, NULL) just needs to return whatever setting you gave to it previously. If it was relative then you return the exact same relative setting (eg: ./locale ) and if it was absolute then you return the exact same absolute setting (eg: /absolutepath/locale ). . ------------------------------------------------------------------------ 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