I am using a shared hosting, i need to disable gettext extension for my application due i need to redeclare _(). Is it possible to disable an extension on php runtime or vie .htaccess ?
4 Answers
Wordpress uses __()
(two underscores) and php-gettext for translation. I'm assuming they had exactly this issue, when deciding to go for __()
.

- 81,211
- 44
- 156
- 212
-
the only way i guess, i will need to rename _() to __(), it will be so wasting of time :( – taras Dec 21 '09 at 16:47
-
1True, but at the moment PHP's own gettext support is really crappy. However, renaming can be quite fast: `/([^a-zA-Z0-9_])_\(/\1__(/` – Boldewyn Dec 21 '09 at 16:52
You can't. Your only option here to change php settings with an .htaccess file is to use
php_admin_value disable_functions
But as far as I know this only works for security related functions. The reason for this is that it would really kill performance if on every single request php had to rebuild the list of available functions which is what it would have to do if this was changeable on a per-server or per-directory basis.

- 1,918
- 11
- 11
-
i am using shared hosting, so i am not able to access the php.ini, no way to overcome that ? – taras Dec 21 '09 at 16:45
-
I'm quite sure it's impossible. On shared hosting, the points from my edited answer won't help you either, unfortunately. – Pekka Dec 21 '09 at 16:46
it also possible to disable to gettext extension. it might be a good enough solution if you're not on a shared server.
but, at the end of the day, i think the best practice is to use a different naming for that function.

- 1,647
- 21
- 16