Changeset 2471 for trunk/framework/I18N/core/MessageSource.php
- Timestamp:
- 07/01/2008 08:45:46 AM (6 months ago)
- Files:
-
- 1 modified
-
trunk/framework/I18N/core/MessageSource.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/framework/I18N/core/MessageSource.php
r2470 r2471 35 35 * 36 36 * # XLIFF -- using XML XLIFF format to store the translation messages. 37 * # SQLite -- Store the translation messages in a SQLite database.38 * # MySQL -- Using a MySQL database to store the messages.39 37 * # gettext -- Translated messages are stored in the gettext format. 38 * # Database -- Use an existing TDbConnection to store the messages. 39 * # SQLite -- (Deprecated) Store the translation messages in a SQLite database. 40 * # MySQL -- (Deprecated) Using a MySQL database to store the messages. 40 41 * 41 42 * A custom message source can be instantiated by specifying the filename … … 51 52 * See also the existing message source types as examples. 52 53 * 53 * The following example instantiates a MySQLmessage source, set the culture,54 * The following example instantiates a Database message source, set the culture, 54 55 * set the cache handler, and use the source in a message formatter. 55 * The messages are store in a database named "messages". The source parameter56 * for the actory method is a PEAR DB style DSN.56 * The messages are stored using an existing connection. The source parameter 57 * for the factory method must contain a valid ConnectionID. 57 58 * <code> 58 * $dsn = 'mysql://username:password@localhost/messages';59 * $source = MessageSource::factory(' MySQL', $dsn);59 * // db1 must be already configured 60 * $source = MessageSource::factory('Database', 'db1'); 60 61 * 61 62 * //set the culture and cache, store the cache in the /tmp directory. … … 113 114 * For 'gettext' and 'XLIFF', 'source' should point to the directory 114 115 * where the messages are stored. 115 * For 'Database', 'source' shouldbe a valid connection id.116 * If (deprecated) 'MySQL' is used, 'source' must contain a valid117 * DSN.116 * For 'Database', 'source' must be a valid connection id. 117 * If one of the deprecated types 'MySQL' or 'SQLite' is used, 118 * 'source' must contain a valid DSN. 118 119 * 119 120 * Custom message source are possible by supplying the a filename parameter … … 128 129 static function &factory($type, $source='.', $filename='') 129 130 { 130 $types = array('XLIFF', 'MySQL', 'Database', 'gettext');131 $types = array('XLIFF','gettext','Database','MySQL','SQLite'); 131 132 132 133 if(empty($filename) && !in_array($type, $types))
