https://www.mediawiki.org/wiki/Special:Code/MediaWiki/108287
Revision: 108287
Author: maxsem
Date: 2012-01-06 22:14:54 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------
updater integration
Modified Paths:
--------------
trunk/extensions/GeoData/GeoData.php
trunk/extensions/GeoData/GeoDataHooks.php
Modified: trunk/extensions/GeoData/GeoData.php
===================================================================
--- trunk/extensions/GeoData/GeoData.php 2012-01-06 22:07:45 UTC (rev
108286)
+++ trunk/extensions/GeoData/GeoData.php 2012-01-06 22:14:54 UTC (rev
108287)
@@ -23,6 +23,7 @@
$wgAPIListModules['geosearch'] = 'ApiQueryGeoSearch';
$wgAPIPropModules['coordinates'] = 'ApiQueryCoordinates';
+$wgHooks['LoadExtensionSchemaUpdates'][] =
'GeoDataHooks::onLoadExtensionSchemaUpdates';
$wgHooks['ParserFirstCallInit'][] = 'GeoDataHooks::onParserFirstCallInit';
$wgHooks['UnitTestsList'][] = 'GeoDataHooks::onUnitTestsList';
$wgHooks['LanguageGetMagic'][] = 'GeoDataHooks::onLanguageGetMagic';
Modified: trunk/extensions/GeoData/GeoDataHooks.php
===================================================================
--- trunk/extensions/GeoData/GeoDataHooks.php 2012-01-06 22:07:45 UTC (rev
108286)
+++ trunk/extensions/GeoData/GeoDataHooks.php 2012-01-06 22:14:54 UTC (rev
108287)
@@ -1,6 +1,24 @@
<?php
class GeoDataHooks {
+ /**
+ * LoadExtensionSchemaUpdates hook handler
+ * @see
https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates
+ * @param DatabaseUpdater $updater
+ */
+ public static function onLoadExtensionSchemaUpdates( DatabaseUpdater
$updater ) {
+ if ( $updater->getDB()->getType() != 'mysql' ) {
+ throw new MWException( 'GeoData extension currently
supports only MySQL' );
+ }
+ $updater->addExtensionTable( 'geo_tags', dirname( __FILE__ ) .
'/GeoData.sql' );
+ return true;
+ }
+
+ /**
+ * UnitTestsList hook handler
+ * @see: https://www.mediawiki.org/wiki/Manual:Hooks/UnitTestsList
+ * @param Array $files
+ */
public static function onUnitTestsList( &$files ) {
$dir = dirname( __FILE__ ) . "/tests";
$files[] = "$dir/ParseCoordTest.php";
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs