Reply to Re: Get locales without shell access?

Your name:

Reply:


Posted by Tim Hunt on 10/13/06 14:56

Rik wrote:
> Kim André Akerø wrote:
> > Rik wrote:
> >
> >> Hi all,
> >>
> >> is there a in PHP to get the available locales without shellacces
> >> (i.e. locale -a)?
> >>
> >> Grtz,
> >
> > Does this do anything for you? ->
> >
> > <pre><?php passthru("locale -a"); ?></pre>
> >
> > The <pre></pre> is just for the sake of formatting. Whether or not the
> > above code line will work, depends on the system configuration (ie.
> > the ability to run external commands may be disabled by the
> > administrator).
>
> Well, that's the problem: I cannot start external programs. Here on my own
> server it's no problem, but it's for a dynamic package that has to work on
> a lot of different servers, where running an external program is often
> blocked. Looping through hundreds of possibilities and checking for false
> is a big pain in this case, but the only solution I've found so far.
>
> Grtz,
> --
> Rik Wasmus

Hi

Not totally sure about this but you may be able to open the directory
the locale files are stored in. If the NLSPATH or XNLSPATH variables
are set in $_ENV and the file permissions/php settings allow it then
you could check what translation files are in the locale directory.

There's not much chance of it working on every server though, safe_mode
and open_basedir just get in the way. Would making a link to the
locale dir in a readable directory let the locale dir be checked?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация