php gettext bindtextdomain behavior
| From: | Gerry Reno | Date: | Fri, 05 Nov 2010 20:06:03 +0000 |
| Subject: | php gettext bindtextdomain behavior | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-50108@lists.php.net to get a copy of this message | ||
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.
PYTHON EXAMPLE:
bindtextdomain("messages", "./locale");
textdomain("messages");
print bindtextdomain("messages",None);
print textdomain(None);
ACTUAL: (correct)
# python test.py
./locale
messages
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?
I was not sure if this was a bug so I thought I would present the issue on the internal list first.