r107614 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107613‎ | r107614 | r107615 >
Date:01:27, 30 December 2011
Author:johnduhart
Status:ok
Tags:
Comment:
Autoloading classes
getID -> getId
Modified paths:
  • /trunk/extensions/TweetANew/TweetANew.body.php (modified) (history)
  • /trunk/extensions/TweetANew/TweetANew.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TweetANew/TweetANew.body.php
@@ -62,7 +62,6 @@
6363 }
6464
6565 # Make connection to Twitter
66 - require_once( 'lib/tmhOAuth.php' ); // include connection
6766 $connection = new tmhOAuth( array(
6867 'consumer_key' => $wgTweetANewTwitter['ConsumerKey'],
6968 'consumer_secret' => $wgTweetANewTwitter['ConsumerSecret'],
@@ -160,7 +159,7 @@
161160 $dbr = wfGetDB( DB_SLAVE );
162161 $res = $dbr->select( 'revision',
163162 array( 'rev_timestamp' ),
164 - array( 'rev_page' => $article->getID() ),
 163+ array( 'rev_page' => $article->getId() ),
165164 __METHOD__,
166165 array( 'ORDER BY' => 'rev_id DESC', 'LIMIT' => '2' )
167166 );
@@ -191,8 +190,6 @@
192191 }
193192
194193 # Make connection to Twitter
195 - # TODO: Can this be autoloaded?
196 - require_once( 'lib/tmhOAuth.php' ); // include connection
197194 $connection = new tmhOAuth( array(
198195 'consumer_key' => $wgTweetANewTwitter['ConsumerKey'],
199196 'consumer_secret' => $wgTweetANewTwitter['ConsumerSecret'],
Index: trunk/extensions/TweetANew/TweetANew.php
@@ -151,7 +151,11 @@
152152 */
153153
154154 $dir = dirname(__FILE__) . '/';
 155+
155156 $wgAutoloadClasses['TweetANew'] = $dir . 'TweetANew.body.php';
 157+$wgAutoloadClasses['tmhOAuth'] = $dir . 'lib/tmhOAuth.php';
 158+$wgAutoloadClasses['tmhUtilities'] = $dir . 'lib/tmhUtilities.php';
 159+
156160 $wgExtensionMessagesFiles['TweetANew'] = $dir . 'TweetANew.i18n.php';
157161
158162 /**

Status & tagging log