Changeset 2470 for trunk/framework/I18N/core/MessageSource.php
- Timestamp:
- 06/30/2008 12:04:42 PM (5 months ago)
- Files:
-
- 1 modified
-
trunk/framework/I18N/core/MessageSource.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/framework/I18N/core/MessageSource.php
r1398 r2470 109 109 /** 110 110 * Factory method to instantiate a new MessageSource depending on the 111 * source type. The allowed source types are 'XLIFF', 'SQLite', 112 * 'MySQL', and 'gettext'. The source parameter is dependent on the 113 * source type. For 'gettext' and 'XLIFF', it should point to the directory 114 * where the messages are stored. For database types, e.g. 'SQLite' and 115 * 'MySQL', it should be a PEAR DB style DSN string. 111 * source type. The allowed source types are 'XLIFF', 'gettext' and 112 * 'Database'. The source parameter depends on the source type. 113 * For 'gettext' and 'XLIFF', 'source' should point to the directory 114 * where the messages are stored. 115 * For 'Database', 'source' should be a valid connection id. 116 * If (deprecated) 'MySQL' is used, 'source' must contain a valid 117 * DSN. 116 118 * 117 119 * Custom message source are possible by supplying the a filename parameter … … 119 121 * 120 122 * @param string the message source type. 121 * @param string the location of the resource .123 * @param string the location of the resource or the ConnectionID. 122 124 * @param string the filename of the custom message source. 123 125 * @return MessageSource a new message source of the specified type. … … 126 128 static function &factory($type, $source='.', $filename='') 127 129 { 128 $types = array('XLIFF', ' SQLite', 'MySQL', 'gettext');129 130 if(empty($filename) && in_array($type, $types) == false)130 $types = array('XLIFF', 'MySQL', 'Database', 'gettext'); 131 132 if(empty($filename) && !in_array($type, $types)) 131 133 throw new Exception('Invalid type "'.$type.'", valid types are '. 132 134 implode(', ', $types));
