* @package MediaWiki
*/
-/**
- * Some globals
- */
-define ( 'EB_KEEP_EXPIRED', 1 );
-define ( 'EB_FOR_UPDATE', 2 );
-define ( 'EB_RANGE_ONLY', 4 );
-
/**
* The block class
* All the functions in this class assume the object is either explicitly
/* public*/ var $mAddress, $mUser, $mBy, $mReason, $mTimestamp, $mAuto, $mId, $mExpiry,
$mRangeStart, $mRangeEnd;
/* private */ var $mNetworkBits, $mIntegerAddr, $mForUpdate, $mFromMaster, $mByName;
+
+ const EB_KEEP_EXPIRED = 1;
+ const EB_FOR_UPDATE = 2;
+ const EB_RANGE_ONLY = 4;
function Block( $address = '', $user = '', $by = 0, $reason = '',
$timestamp = '' , $auto = 0, $expiry = '' )
global $wgAntiLockFlags;
$block = new Block();
- if ( $flags & EB_FOR_UPDATE ) {
+ if ( $flags & Block::EB_FOR_UPDATE ) {
$db =& wfGetDB( DB_MASTER );
if ( $wgAntiLockFlags & ALF_NO_BLOCK_LOCK ) {
$options = '';
$db =& wfGetDB( DB_SLAVE );
$options = '';
}
- if ( $flags & EB_RANGE_ONLY ) {
+ if ( $flags & Block::EB_RANGE_ONLY ) {
$cond = " AND ipb_range_start <> ''";
} else {
$cond = '';
while ( $row = $db->fetchObject( $res ) ) {
$block->initFromRow( $row );
- if ( ( $flags & EB_RANGE_ONLY ) && $block->mRangeStart == '' ) {
+ if ( ( $flags & Block::EB_RANGE_ONLY ) && $block->mRangeStart == '' ) {
continue;
}
- if ( !( $flags & EB_KEEP_EXPIRED ) ) {
+ if ( !( $flags & Block::EB_KEEP_EXPIRED ) ) {
if ( $block->mExpiry && $now > $block->mExpiry ) {
$block->delete();
} else {