Index: trunk/extensions/GeoData/GeoData.php |
— | — | @@ -23,6 +23,7 @@ |
24 | 24 | $wgAPIListModules['geosearch'] = 'ApiQueryGeoSearch'; |
25 | 25 | $wgAPIPropModules['coordinates'] = 'ApiQueryCoordinates'; |
26 | 26 | |
| 27 | +$wgHooks['LoadExtensionSchemaUpdates'][] = 'GeoDataHooks::onLoadExtensionSchemaUpdates'; |
27 | 28 | $wgHooks['ParserFirstCallInit'][] = 'GeoDataHooks::onParserFirstCallInit'; |
28 | 29 | $wgHooks['UnitTestsList'][] = 'GeoDataHooks::onUnitTestsList'; |
29 | 30 | $wgHooks['LanguageGetMagic'][] = 'GeoDataHooks::onLanguageGetMagic'; |
Index: trunk/extensions/GeoData/GeoDataHooks.php |
— | — | @@ -1,6 +1,24 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class GeoDataHooks { |
| 5 | + /** |
| 6 | + * LoadExtensionSchemaUpdates hook handler |
| 7 | + * @see https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates |
| 8 | + * @param DatabaseUpdater $updater |
| 9 | + */ |
| 10 | + public static function onLoadExtensionSchemaUpdates( DatabaseUpdater $updater ) { |
| 11 | + if ( $updater->getDB()->getType() != 'mysql' ) { |
| 12 | + throw new MWException( 'GeoData extension currently supports only MySQL' ); |
| 13 | + } |
| 14 | + $updater->addExtensionTable( 'geo_tags', dirname( __FILE__ ) . '/GeoData.sql' ); |
| 15 | + return true; |
| 16 | + } |
| 17 | + |
| 18 | + /** |
| 19 | + * UnitTestsList hook handler |
| 20 | + * @see: https://www.mediawiki.org/wiki/Manual:Hooks/UnitTestsList |
| 21 | + * @param Array $files |
| 22 | + */ |
5 | 23 | public static function onUnitTestsList( &$files ) { |
6 | 24 | $dir = dirname( __FILE__ ) . "/tests"; |
7 | 25 | $files[] = "$dir/ParseCoordTest.php"; |