r88278 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88277‎ | r88278 | r88279 >
Date:23:21, 16 May 2011
Author:siebrand
Status:resolved (Comments)
Tags:
Comment:
(bug 29011) Remove hard coded text from Special:LockDb.

Who locked the database and when will be displayed in the content language, as reason, locker and timestamp are saved in $wgReadOnlyFile.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialLockdb.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -2167,6 +2167,7 @@
21682168 'unlockdbsuccesstext',
21692169 'lockfilenotwritable',
21702170 'databasenotlocked',
 2171+ 'lockedbyandtime',
21712172 ),
21722173 'movepage' => array(
21732174 'move-page',
Index: trunk/phase3/includes/specials/SpecialLockdb.php
@@ -122,8 +122,13 @@
123123 return;
124124 }
125125 fwrite( $fp, $this->reason );
126 - fwrite( $fp, "\n<p>(by " . $wgUser->getName() . " at " .
127 - $wgContLang->timeanddate( wfTimestampNow() ) . ")</p>\n" );
 126+ fwrite( $fp, "\n<p>" . wfMsgExt(
 127+ 'lockedbyandtime',
 128+ 'content',
 129+ $wgUser->getName(),
 130+ $wgContLang->date( wfTimestampNow() ),
 131+ $wgContLang->time( wfTimestampNow() )
 132+ ) . "</p>\n" );
128133 fclose( $fp );
129134
130135 $wgOut->redirect( $this->getTitle()->getFullURL( 'action=success' ) );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -3167,6 +3167,7 @@
31683168 'lockfilenotwritable' => 'The database lock file is not writable.
31693169 To lock or unlock the database, this needs to be writable by the web server.',
31703170 'databasenotlocked' => 'The database is not locked.',
 3171+'lockedbyandtime' => '(by $1 on $2 at $3)',
31713172
31723173 # Move page
31733174 'move-page' => 'Move $1',

Follow-up revisions

RevisionCommit summaryAuthorDate
r90704Follow-up r88278. Do not call $wfTimestampNow() twice, but use a temporary va...siebrand09:48, 24 June 2011
r90707Reduce calls to wfTimestampNow() by using temporary variable. Inspired by CR ...siebrand10:00, 24 June 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   02:40, 24 June 2011

Don't call wfTimestampNow() twice. Use one temporary variable.

Status & tagging log