Edit report at http://bugs.php.net/bug.php?id=53251&edit=1
ID: 53251
Comment by: greno at verizon dot 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:
I think these phpt tests will work. I ran them from the command line
and they ran fine. Had no idea what to name them so you may have to
adjust.
http://greno-misc.googlecode.com/files/bindtextdomaintests.zip
.
Previous Comments:
------------------------------------------------------------------------
[2010-11-25 01:34:39] [email protected]
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
------------------------------------------------------------------------
[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] [email protected]
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] [email protected]
"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.
------------------------------------------------------------------------
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