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.








--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to