[horde] language
Jan Schneider
jan at horde.org
Wed Dec 17 08:18:49 PST 2003
Zitat von Johan Fredriksson <eskil at e.kth.se>:
> > > > Why? We'd completely bork all of our translations, create a huge
> > > > amount of work, and abandon a format that's fast, standard, widely
> > > > used, and has a huge number of tools available for it. I really
> > > > don't see a benefit here.
> > >
> > > The benefit is clear: Get rid of a not thread-safe prerequisite
> > > to get horde run perfectly with modern webserver technology.
> >
> > If we would get rid of gettext usage, this wouldn't make PHP thread
> > safe in any way.
>
> PHP in itself is treadsafe and does use multithreading to some extent.
> But gettext is not and will never be bacause the selected locale is
> in all other contexts a global setting which should effect all processes.
> That is why the selected locale is stored in the environment.
You are right that the PHP core, that is the Zend Engine is thread-safe. But
this is no longer true as soon as you start using extensions. PHP
extensions link against so many external libraries (that link against other
libraries and so on) that you can't even know if your special version is
thread safe.
See the PHP mailing lists for extensive dicussions about this topic.
> What we need to solve this problem is thread-safe wrappers for the
> gettext-functions in PHP. Functions that use mutex-blocks to alter
> the environment, call the function, and restore the environment before
> exiting the mutex. Then the selected locale can be stored in a
> PHP-session
> variable or whatever.
This might be a solution. Bruno Haible (the current maintainer of gettext)
might also have something in mind, because when he announced the latest
version, he said that gettext for PHP is not yet thread safe. That "yet"
leads to hope.
But this is getting way offtopic for Horde and should probably moved to
either the PHP or the gettext developers lists.
Jan.
--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft
More information about the horde
mailing list