"Michael Wallner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > l0t3k wrote: >> In ICU, resource bundles are cached for efficiency, but the cache is >> per-process, and i seem to recall that the cache is not currently >> flushed. >> Additionally the key is the ICU locale id, so its impossible without >> source >> changes to make this work for user-created resources without collision in >> shared hosting mode. > > Sounds like gettext() :) Could you elaborate? its actually worse than gettext().. suppose we have an Apache process handling PHP scripts in different web apps. When a script from app1 requests the resource bundle for "en_US" for example, ICU performs the search, and if found the internal resource bundle structure is cached. There is a lot that happens behind the scenes, for example : file system path search for "en_US", fall back to "en" if not found, searching for locales in .dat files and falling back to .res file if not found, etc. Caching here makes sense, but the problem is that the cache is process wide, and the cache key used is simply the ISO locale id passed to the constructor, even if a full path to the resource file was specified. There is nothing to distinguish two resource bundles using the same name in different web apps, so when app 2 requests a bundle for "en_US", the cache returns the bundle from app 1. The cache is also not flushed until the process dies.
Internally, the cache uses a ref count for resource bundles, and there is code to do a flush (its private), so technically there is a way to handle this, but not without hacking the ICU source. i did this about 2 years ago, but the machine i used was stolen ;-( clayton -- PHP Unicode & I18N Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php