r104433 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104432‎ | r104433 | r104434 >
Date:15:01, 28 November 2011
Author:petrb
Status:deferred
Tags:
Comment:
cosmetic fix :)
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.status.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.status.php
@@ -31,7 +31,7 @@
3232 * @param $values
3333 * @return true
3434 */
35 - public static function setCache( $user, $values, $type, $time = null ) {
 35+ private static function setCache( $user, $values, $type, $time = null ) {
3636 global $wgOnlineStatusBar_WriteTime, $wgMemc;
3737 // get a key
3838 $cache_key = self::getCacheKey( $user, $type );
@@ -47,7 +47,7 @@
4848 * @param $user string
4949 * @param $type string
5050 */
51 - public static function getCache( $user, $type ) {
 51+ private static function getCache( $user, $type ) {
5252 global $wgMemc;
5353 // get a key
5454 $cache_key = self::getCacheKey( $user, $type );
@@ -73,7 +73,7 @@
7474 if ( $result == '' ) {
7575 $dbr = wfGetDB( DB_SLAVE );
7676 $result = $dbr->selectField( 'online_status', 'timestamp', array( 'username' => $user->getName(),
77 - "timestamp > " . $dbr->addQuotes( $dbr->timestamp( $t_time ) ) ),
 77+ 'timestamp > ' . $dbr->addQuotes( $dbr->timestamp( $t_time ) ) ),
7878 __METHOD__, array( 'LIMIT 1', 'ORDER BY timestamp DESC' ) );
7979 // cache it
8080 self::setCache( $user->getName(), $result, "n" );
@@ -165,7 +165,7 @@
166166 }
167167 }
168168 // if user doesn't want to be tracked leave it as well for privacy reasons
169 - if ( $wgUser->isLoggedIn() && !$wgUser->getOption ( "OnlineStatusBar_active", $wgOnlineStatusBarDefaultEnabled ) ) {
 169+ if ( $wgUser->isLoggedIn() && !$wgUser->getOption ( 'OnlineStatusBar_active', $wgOnlineStatusBarDefaultEnabled ) ) {
170170 return false;
171171 }
172172 $user_status = self::getStatus( $wgUser, true );
@@ -204,7 +204,7 @@
205205 // Check if we actually need to delete something before we write to master
206206 $dbr = wfGetDB( DB_SLAVE );
207207 $time = OnlineStatusBar::getTimeoutDate();
208 - $result = $dbr->selectField( 'online_status', 'timestamp', array( "timestamp < " . $dbr->addQuotes( $dbr->timestamp( $time ) ) ),
 208+ $result = $dbr->selectField( 'online_status', 'timestamp', array( 'timestamp < ' . $dbr->addQuotes( $dbr->timestamp( $time ) ) ),
209209 __METHOD__, array( 'LIMIT 1' ) );
210210 if ( $result === false ) {
211211 // no need for delete
@@ -213,7 +213,7 @@
214214
215215 // calculate time and convert it back to mediawiki format
216216 $dbw = wfGetDB( DB_MASTER );
217 - $dbw->delete( 'online_status', array( "timestamp < " . $dbw->addQuotes( $dbw->timestamp( $time ) ) ), __METHOD__ );
 217+ $dbw->delete( 'online_status', array( 'timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $time ) ) ), __METHOD__ );
218218 self::setCache( 'null', 'true', 'delete', 3600 ); // remember we deleted it for 1 hour so that we avoid calling this too many times
219219 return 0;
220220 }
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php
@@ -171,6 +171,6 @@
172172 }
173173
174174 // do we track them
175 - return $user->getOption( "OnlineStatusBar_active", $wgOnlineStatusBarDefaultEnabled );
 175+ return $user->getOption( 'OnlineStatusBar_active', $wgOnlineStatusBarDefaultEnabled );
176176 }
177177 }
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php
@@ -160,10 +160,10 @@
161161 case 'nostalgia':
162162 case 'chick':
163163 case 'cologneblue':
164 - $out->addModules( 'ext.OnlineStatusBar.' . $skin->getSkinName() );
 164+ $out->addModuleStyles( 'ext.OnlineStatusBar.' . $skin->getSkinName() );
165165 break;
166166 default:
167 - $out->addModules( 'ext.OnlineStatusBar' );
 167+ $out->addModuleStyles( 'ext.OnlineStatusBar' );
168168 }
169169 return true;
170170 }

Status & tagging log