Add comment

Remove unused wfGetDb()
This commit is contained in:
Sam Reed 2011-07-18 22:23:42 +00:00
parent 4b12070e70
commit fcebee405f
2 changed files with 7 additions and 4 deletions

View file

@ -346,13 +346,13 @@ class Block {
protected function initFromRow( $row ) {
$this->setTarget( $row->ipb_address );
$this->setBlocker( User::newFromId( $row->ipb_by ) );
$this->mReason = $row->ipb_reason;
$this->mTimestamp = wfTimestamp( TS_MW, $row->ipb_timestamp );
$this->mAuto = $row->ipb_auto;
$this->mHideName = $row->ipb_deleted;
$this->mId = $row->ipb_id;
// I wish I didn't have to do this
$db = wfGetDB( DB_SLAVE );
if ( $row->ipb_expiry == $db->getInfinity() ) {
@ -643,7 +643,6 @@ class Block {
$autoblock->mHideName = $this->mHideName;
$autoblock->prevents( 'editownusertalk', $this->prevents( 'editownusertalk' ) );
$dbr = wfGetDB( DB_SLAVE );
if ( $this->mExpiry == 'infinity' ) {
# Original block was indefinite, start an autoblock now
$autoblock->mExpiry = Block::getAutoblockExpiry( $timestamp );

View file

@ -82,6 +82,8 @@ class WikiPage extends Page {
* Always override this for all subclasses (until we use PHP with LSB)
*
* @param $id Int article ID to load
*
* @return WikiPage
*/
public static function newFromID( $id ) {
$t = Title::newFromID( $id );
@ -278,6 +280,8 @@ class WikiPage extends Page {
/**
* Return the list of revision fields that should be selected to create
* a new page.
*
* @return array
*/
public static function selectFields() {
return array(
@ -535,7 +539,7 @@ class WikiPage extends Page {
* Revision::FOR_THIS_USER to be displayed to $wgUser
* Revision::RAW get the text regardless of permissions
* @return String|false The text of the current revision
*/
*/
public function getText( $audience = Revision::FOR_PUBLIC ) {
$this->loadLastEdit();
if ( $this->mLastRevision ) {