r110337 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110336‎ | r110337 | r110338 >
Date:22:54, 30 January 2012
Author:maxsem
Status:deferred
Tags:
Comment:
rm database-related stuff, not needed
Modified paths:
  • /trunk/extensions/ArticleEmblems/ArticleEmblems.hooks.php (modified) (history)
  • /trunk/extensions/ArticleEmblems/ArticleEmblems.php (modified) (history)
  • /trunk/extensions/ArticleEmblems/patches (deleted) (history)

Diff [purge]

Index: trunk/extensions/ArticleEmblems/ArticleEmblems.hooks.php
@@ -15,29 +15,6 @@
1616 /* Static Methods */
1717
1818 /**
19 - * LoadExtensionSchemaUpdates hook
20 - *
21 - * @param $updater DatabaseUpdater
22 - */
23 - public static function loadExtensionSchemaUpdates( $updater = null ) {
24 - if ( $updater === null ) {
25 - global $wgExtNewTables;
26 - $wgExtNewTables[] = array( 'articleemblems', dirname( __FILE__ ) . '/patches/ArticleEmblems.sql' );
27 - } else {
28 - $updater->addExtensionUpdate( array( 'addTable', 'articleemblems', dirname( __FILE__ ) . '/patches/ArticleEmblems.sql', true ) );
29 - }
30 - return true;
31 - }
32 -
33 - /**
34 - * ParserTestTables hook
35 - */
36 - public static function parserTestTables( &$tables ) {
37 - $tables[] = 'articleemblems';
38 - return true;
39 - }
40 -
41 - /**
4219 * ParserInit hook
4320 *
4421 * @param $parser Parser
@@ -61,23 +38,6 @@
6239 }
6340
6441 /**
65 - * ArticleSaveComplete hook
66 - *
67 - * @param $article Article
68 - */
69 - public static function articleSaveComplete( &$article ) {
70 - $articleId = $article->getId();
71 - $dbw = wfGetDB( DB_MASTER );
72 - $dbw->delete( 'articleemblems', array( 'ae_article' => $articleId ), __METHOD__ );
73 - $emblems = array();
74 - foreach ( self::$emblems as $emblem ) {
75 - $emblems[] = array( 'ae_article' => $articleId, 'ae_value' => $emblem );
76 - }
77 - $dbw->insert( 'articleemblems', array_reverse( $emblems ), __METHOD__ );
78 - return true;
79 - }
80 -
81 - /**
8242 * ArticleViewHeader hook
8343 *
8444 * @param $article Article
Index: trunk/extensions/ArticleEmblems/ArticleEmblems.php
@@ -22,11 +22,10 @@
2323 );
2424 $wgAutoloadClasses['ArticleEmblemsHooks'] = dirname( __FILE__ ) . '/ArticleEmblems.hooks.php';
2525 $wgExtensionMessagesFiles['ArticleEmblems'] = dirname( __FILE__ ) . '/ArticleEmblems.i18n.php';
26 -$wgHooks['LoadExtensionSchemaUpdates'][] = 'ArticleEmblemsHooks::loadExtensionSchemaUpdates';
 26+
2727 $wgHooks['ParserFirstCallInit'][] = 'ArticleEmblemsHooks::parserInit';
28 -$wgHooks['ParserTestTables'][] = 'ArticleEmblemsHooks::parserTestTables';
2928 $wgHooks['ArticleViewHeader'][] = 'ArticleEmblemsHooks::articleViewHeader';
30 -$wgHooks['ArticleSaveComplete'][] = 'ArticleEmblemsHooks::articleSaveComplete';
 29+
3130 $wgResourceModules['ext.articleEmblems'] = array(
3231 'styles' => 'ext.articleEmblems.css',
3332 'localBasePath' => dirname( __FILE__ ) . '/modules',

Status & tagging log