http://www.mediawiki.org/wiki/Special:Code/MediaWiki/74141
Revision: 74141
Author: ialex
Date: 2010-10-02 13:51:06 +0000 (Sat, 02 Oct 2010)
Log Message:
-----------
Converted CategoryIntersection extension to use the new version of the
LoadExtensionSchemaUpdates hook
Modified Paths:
--------------
trunk/extensions/CategoryIntersection/CategoryIntersection.php
Modified: trunk/extensions/CategoryIntersection/CategoryIntersection.php
===================================================================
--- trunk/extensions/CategoryIntersection/CategoryIntersection.php
2010-10-02 13:45:35 UTC (rev 74140)
+++ trunk/extensions/CategoryIntersection/CategoryIntersection.php
2010-10-02 13:51:06 UTC (rev 74141)
@@ -95,12 +95,18 @@
# new tables needed (based on how ReaderFeedback extension does it)
$wgHooks['LoadExtensionSchemaUpdates'][] =
'efCategoryIntersectionSchemaUpdates';
-function efCategoryIntersectionSchemaUpdates() {
- global $wgDBtype, $wgExtNewTables;
- $base = dirname( __FILE__ );
- if ( $wgDBtype == 'mysql' ) {
- $wgExtNewTables[] = array( 'categoryintersections',
"$base/CategoryIntersection.sql" );
- }
- return true;
+function efCategoryIntersectionSchemaUpdates( $updater = null ) {
+ $base = dirname( __FILE__ );
+ if ( $updater === null ) {
+ global $wgDBtype, $wgExtNewTables;
+ if ( $wgDBtype == 'mysql' ) {
+ $wgExtNewTables[] = array( 'categoryintersections',
"$base/CategoryIntersection.sql" );
+ }
+ } else {
+ if ( $updater->getDB()->getType() == 'mysql' ) {
+ $updater->addExtensionUpdate( array( 'addTable',
'categoryintersections', "$base/CategoryIntersection.sql", true ) );
+ }
+ }
+ return true;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs