r14659 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14658‎ | r14659 | r14660 >
Date:13:21, 8 June 2006
Author:midom
Status:old
Tags:
Comment:
screw global defines :)
Modified paths:
  • /trunk/phase3/includes/Block.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Block.php
@@ -5,13 +5,6 @@
66 */
77
88 /**
9 - * Some globals
10 - */
11 -define ( 'EB_KEEP_EXPIRED', 1 );
12 -define ( 'EB_FOR_UPDATE', 2 );
13 -define ( 'EB_RANGE_ONLY', 4 );
14 -
15 -/**
169 * The block class
1710 * All the functions in this class assume the object is either explicitly
1811 * loaded or filled. It is not load-on-demand. There are no accessors.
@@ -27,6 +20,10 @@
2821 /* public*/ var $mAddress, $mUser, $mBy, $mReason, $mTimestamp, $mAuto, $mId, $mExpiry,
2922 $mRangeStart, $mRangeEnd;
3023 /* private */ var $mNetworkBits, $mIntegerAddr, $mForUpdate, $mFromMaster, $mByName;
 24+
 25+ const EB_KEEP_EXPIRED = 1;
 26+ const EB_FOR_UPDATE = 2;
 27+ const EB_RANGE_ONLY = 4;
3128
3229 function Block( $address = '', $user = '', $by = 0, $reason = '',
3330 $timestamp = '' , $auto = 0, $expiry = '' )
@@ -258,7 +255,7 @@
259256 global $wgAntiLockFlags;
260257
261258 $block = new Block();
262 - if ( $flags & EB_FOR_UPDATE ) {
 259+ if ( $flags & Block::EB_FOR_UPDATE ) {
263260 $db =& wfGetDB( DB_MASTER );
264261 if ( $wgAntiLockFlags & ALF_NO_BLOCK_LOCK ) {
265262 $options = '';
@@ -270,7 +267,7 @@
271268 $db =& wfGetDB( DB_SLAVE );
272269 $options = '';
273270 }
274 - if ( $flags & EB_RANGE_ONLY ) {
 271+ if ( $flags & Block::EB_RANGE_ONLY ) {
275272 $cond = " AND ipb_range_start <> ''";
276273 } else {
277274 $cond = '';
@@ -287,11 +284,11 @@
288285
289286 while ( $row = $db->fetchObject( $res ) ) {
290287 $block->initFromRow( $row );
291 - if ( ( $flags & EB_RANGE_ONLY ) && $block->mRangeStart == '' ) {
 288+ if ( ( $flags & Block::EB_RANGE_ONLY ) && $block->mRangeStart == '' ) {
292289 continue;
293290 }
294291
295 - if ( !( $flags & EB_KEEP_EXPIRED ) ) {
 292+ if ( !( $flags & Block::EB_KEEP_EXPIRED ) ) {
296293 if ( $block->mExpiry && $now > $block->mExpiry ) {
297294 $block->delete();
298295 } else {

Status & tagging log