If you are writting your own message sources, pay attention to the loadCatalogue method. It details how the resources are loaded and cached. See also the existing message source types as examples.
The following example instantiates a MySQL message source, set the culture, set the cache handler, and use the source in a message formatter. The messages are store in a database named "messages". The source parameter for the actory method is a PEAR DB style DSN.
Factory method to instantiate a new MessageSource depending on the
source type. The allowed source types are 'XLIFF', 'SQLite', 'MySQL', and 'gettext'. The source parameter is dependent on the source type. For 'gettext' and 'XLIFF', it should point to the directory where the messages are stored. For database types, e.g. 'SQLite' and 'MySQL', it should be a PEAR DB style DSN string.
Custom message source are possible by supplying the a filename parameter in the factory method.