On the flight to #sflive today I bashed my way through a really dirty
reimplementation of the Intl extension, on the understanding that it's
just there to give you a taste of Symfony 2 and firmly push you toward
installing the intl extension properly. It's going well, except for the
ResourceBundle class, which I set aside to look at later when I got
back to the Internet. (Yes, I downloaded the single-file version of
the PHP manual to use on the plane. Chrome parsed it eventually (: )

Unfortunately ResourceBundle is a real bear. This class is used to
load collections of localized strings, not from a text file but from a
binary file. This is fine I suppose for performance reasons - the idea
is that the intl extension contains some libraries from the ICU
project that take full advantage of that to make things zip right
along.

But when I look at the task of reimplementing a "stub" version of this
class I have concerns. There seems to be no good substitute for a full
reimplementation. The format is defined only by this header file:

http://bugs.icu-project.org/trac/browser/icu/trunk/source/common/uresdata.h

That looks like a pretty ugly project (although I suppose you can get
it done with unpack() and friends).

Now, if I could make some assumptions about how ResourceBundle was
really going to be used in the Symfony framework core - if I knew, for
instance, that it would only be used to load what seem to be the
"standard" ICU locale resource files that are packaged by
Symfony/Component/Locale/Resources/data/update-data.php, and nothing
else within the core of Symfony - then I could fake it pretty well: I
could simply grab the results for 'en' and ensure that the relevant
methods return that information. I could even build a tool that keeps
this up to date, taking advantage of the fact that I have the real
intl tools at my disposal.

But to do that I need to know for certain that Symfony itself won't be
using .res files for a more general purpose. Is this a sound
assumption?

(I am perfectly fine with the fact that individual web developers
might decide to do projects requiring support for loading arbitrary
.res files they have made. They can go get real intl (: )

-- 
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to