Code cleanup: normalize case for intval(), strval(), floatval() calls.
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 16 Aug 2005 23:36:16 +0000 (23:36 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 16 Aug 2005 23:36:16 +0000 (23:36 +0000)
34 files changed:
config/index.php
includes/Article.php
includes/DateFormatter.php
includes/Group.php
includes/Image.php
includes/ImagePage.php
includes/Linker.php
includes/QueryPage.php
includes/Revision.php
includes/Sanitizer.php
includes/SearchEngine.php
includes/Skin.php
includes/SkinTemplate.php
includes/SpecialImport.php
includes/SpecialSearch.php
includes/Title.php
includes/User.php
includes/WebRequest.php
includes/normal/UtfNormal.php
includes/normal/UtfNormalBench.php
includes/normal/UtfNormalGenerate.php
includes/normal/UtfNormalTest.php
irc/rcdumper.php
maintenance/FiveUpgrade.inc
maintenance/benchmarkPurge.php
maintenance/cleanupDupes.inc
maintenance/dumpBackup.php
maintenance/importDump.php
maintenance/importLogs.inc
maintenance/importPhase2.php
maintenance/rebuildrecentchanges.inc
maintenance/updaters.inc
maintenance/userDupes.inc
tests/SearchEngineTest.php

index 8d99bb3..8952fce 100644 (file)
@@ -271,9 +271,9 @@ if( empty( $memlimit ) || $memlimit == -1 ) {
        print "<li>PHP is configured with no <tt>memory_limit</tt>.</li>\n";
 } else {
        print "<li>PHP's <tt>memory_limit</tt> is " . htmlspecialchars( $memlimit ) . ". <strong>If this is too low, installation may fail!</strong> ";
-       $n = IntVal( $memlimit );
+       $n = intval( $memlimit );
        if( preg_match( '/^([0-9]+)[Mm]$/', trim( $memlimit ), $m ) ) {
-               $n = IntVal( $m[1] * (1024*1024) );
+               $n = intval( $m[1] * (1024*1024) );
        }
        if( $n < 20*1024*1024 ) {
                print "Attempting to raise limit to 20M... ";
index 6515a27..c318ce1 100644 (file)
@@ -249,7 +249,7 @@ class Article {
                # Query variables :P
                $oldid = $wgRequest->getVal( 'oldid' );
                if ( isset( $oldid ) ) {
-                       $oldid = IntVal( $oldid );
+                       $oldid = intval( $oldid );
                        if ( $wgRequest->getVal( 'direction' ) == 'next' ) {
                                $nextid = $this->mTitle->getNextRevisionID( $oldid );
                                if ( $nextid  ) {
@@ -329,7 +329,7 @@ class Article {
 
        function pageDataFromId( &$dbr, $id ) {
                return $this->pageData( $dbr, array(
-                       'page_id' => IntVal( $id ) ) );
+                       'page_id' => intval( $id ) ) );
        }
 
        /**
@@ -1996,7 +1996,7 @@ class Article {
                }
 
                # Get the last edit not by this guy
-               $user = IntVal( $current->getUser() );
+               $user = intval( $current->getUser() );
                $user_text = $dbw->addQuotes( $current->getUserText() );
                $s = $dbw->selectRow( 'revision',
                        array( 'rev_id', 'rev_timestamp' ),
index f5cad86..eee039a 100755 (executable)
@@ -193,14 +193,14 @@ class DateFormatter
                                        break;
                                case 'j': # ordinary day of month
                                        if ( !isset($bits['j']) ) {
-                                               $text .= IntVal( $bits['d'] );
+                                               $text .= intval( $bits['d'] );
                                        } else {
                                                $text .= $bits['j'];
                                        }
                                        break;
                                case 'F': # long month
                                        if ( !isset( $bits['F'] ) ) {
-                                               $m = IntVal($bits['m']);
+                                               $m = intval($bits['m']);
                                                if ( $m > 12 || $m < 1 ) {
                                                        $fail = true;
                                                } else {
@@ -259,7 +259,7 @@ class DateFormatter
        function makeIsoYear( $year ) {
                # Assumes the year is in a nice format, as enforced by the regex
                if ( substr( $year, -2 ) == 'BC' ) {
-                       $num = IntVal(substr( $year, 0, -3 )) - 1;
+                       $num = intval(substr( $year, 0, -3 )) - 1;
                        # PHP bug note: sprintf( "%04d", -1 ) fails poorly
                        $text = sprintf( '-%04d', $num );
 
@@ -274,9 +274,9 @@ class DateFormatter
         */
        function makeNormalYear( $iso ) {
                if ( $iso{0} == '-' ) {
-                       $text = (IntVal( substr( $iso, 1 ) ) + 1) . ' BC';
+                       $text = (intval( substr( $iso, 1 ) ) + 1) . ' BC';
                } else {
-                       $text = IntVal( $iso );
+                       $text = intval( $iso );
                }
                return $text;
        }
index cfaeb46..e820135 100644 (file)
@@ -47,7 +47,7 @@ class Group {
                }
 
                // be sure it's an integer
-               $this->id = IntVal($this->id);
+               $this->id = intval($this->id);
                
                if($this->id) {
                        // By ID
@@ -341,7 +341,7 @@ class Group {
        
        function getId() { return $this->id; }
        function setId($id) {
-               $this->id = IntVal($id);
+               $this->id = intval($id);
                $this->dataLoaded = false;
        }
        
index 1314b4a..a741aab 100644 (file)
@@ -916,7 +916,7 @@ class Image
                global $wgUseSquid, $wgInternalServer;
                global $wgThumbnailScriptPath, $wgSharedThumbnailScriptPath;
                
-               $width = IntVal( $width );
+               $width = intval( $width );
 
                $this->load();
                if ( ! $this->exists() )
@@ -1288,8 +1288,8 @@ class Image
                        array(
                                'img_name' => $this->name,
                                'img_size'=> $this->size,
-                               'img_width' => IntVal( $this->width ),
-                               'img_height' => IntVal( $this->height ),
+                               'img_width' => intval( $this->width ),
+                               'img_height' => intval( $this->height ),
                                'img_bits' => $this->bits,
                                'img_media_type' => $this->type,
                                'img_major_mime' => $major,
@@ -1634,12 +1634,12 @@ function wfScaleSVGUnit( $length ) {
                '%'  => 2.0, // Fake it!
                );
        if( preg_match( '/^(\d+)(em|ex|px|pt|pc|cm|mm|in|%|)$/', $length, $matches ) ) {
-               $length = FloatVal( $matches[1] );
+               $length = floatval( $matches[1] );
                $unit = $matches[2];
                return round( $length * $unitLength[$unit] );
        } else {
                // Assume pixels
-               return round( FloatVal( $length ) );
+               return round( floatval( $length ) );
        }
 }
 
index 9d1c285..4d090d5 100644 (file)
@@ -139,7 +139,7 @@ class ImagePage extends Article {
                if( $wgUser->getOption( 'imagesize' ) == '' ) {
                        $sizeSel = User::getDefaultOption( 'imagesize' );
                } else {
-                       $sizeSel = IntVal( $wgUser->getOption( 'imagesize' ) );
+                       $sizeSel = intval( $wgUser->getOption( 'imagesize' ) );
                }
                if( !isset( $wgImageLimits[$sizeSel] ) ) {
                        $sizeSel = User::getDefaultOption( 'imagesize' );
index 81c290c..322a517 100644 (file)
@@ -332,7 +332,7 @@ class Linker {
         */
        function makeSizeLinkObj( $size, $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
                global $wgUser;
-               $threshold = IntVal( $wgUser->getOption( 'stubthreshold' ) );
+               $threshold = intval( $wgUser->getOption( 'stubthreshold' ) );
                if( $size < $threshold ) {
                        return $this->makeStubLinkObj( $nt, $text, $query, $trail, $prefix );
                } else {
index d6ec768..b7ff539 100644 (file)
@@ -332,7 +332,7 @@ class QueryPage {
                if( !isset( $row->title ) ) {
                        return NULL;
                }
-               $title = Title::MakeTitle( IntVal( $row->namespace ), $row->title );
+               $title = Title::MakeTitle( intval( $row->namespace ), $row->title );
                if( $title ) {
                        if( isset( $row->timestamp ) ) {
                                $date = $row->timestamp;
index 0e17611..03baf4b 100644 (file)
@@ -24,7 +24,7 @@ class Revision {
        function newFromId( $id ) {
                return Revision::newFromConds(
                        array( 'page_id=rev_page',
-                              'rev_id' => IntVal( $id ) ) );
+                              'rev_id' => intval( $id ) ) );
        }
 
        /**
@@ -40,7 +40,7 @@ class Revision {
         */
        function newFromTitle( &$title, $id = 0 ) {
                if( $id ) {
-                       $matchId = IntVal( $id );
+                       $matchId = intval( $id );
                } else {
                        $matchId = 'page_latest';
                }
@@ -64,14 +64,14 @@ class Revision {
         */
        function loadFromPageId( &$db, $pageid, $id = 0 ) {
                if( $id ) {
-                       $matchId = IntVal( $id );
+                       $matchId = intval( $id );
                } else {
                        $matchId = 'page_latest';
                }
                $ret = Revision::loadFromConds(
                        $db,
                        array( "rev_id=$matchId",
-                              'rev_page' => IntVal( $pageid ),
+                              'rev_page' => intval( $pageid ),
                               'page_id=rev_page' ) );
                return $ret;
        }
@@ -89,7 +89,7 @@ class Revision {
         */
        function loadFromTitle( &$db, $title, $id = 0 ) {
                if( $id ) {
-                       $matchId = IntVal( $id );
+                       $matchId = intval( $id );
                } else {
                        $matchId = 'page_latest';
                }
@@ -240,15 +240,15 @@ class Revision {
         */
        function Revision( $row ) {
                if( is_object( $row ) ) {
-                       $this->mId        = IntVal( $row->rev_id );
-                       $this->mPage      = IntVal( $row->rev_page );
-                       $this->mTextId    = IntVal( $row->rev_text_id );
+                       $this->mId        = intval( $row->rev_id );
+                       $this->mPage      = intval( $row->rev_page );
+                       $this->mTextId    = intval( $row->rev_text_id );
                        $this->mComment   =         $row->rev_comment;
                        $this->mUserText  =         $row->rev_user_text;
-                       $this->mUser      = IntVal( $row->rev_user );
-                       $this->mMinorEdit = IntVal( $row->rev_minor_edit );
+                       $this->mUser      = intval( $row->rev_user );
+                       $this->mMinorEdit = intval( $row->rev_minor_edit );
                        $this->mTimestamp =         $row->rev_timestamp;
-                       $this->mDeleted   = IntVal( $row->rev_deleted );
+                       $this->mDeleted   = intval( $row->rev_deleted );
 
                        $this->mCurrent   = ( $row->rev_id == $row->page_latest );
                        $this->mTitle     = Title::makeTitle( $row->page_namespace,
@@ -263,18 +263,18 @@ class Revision {
                        // Build a new revision to be saved...
                        global $wgUser;
 
-                       $this->mId        = isset( $row['id']         ) ? IntVal( $row['id']         ) : null;
-                       $this->mPage      = isset( $row['page']       ) ? IntVal( $row['page']       ) : null;
-                       $this->mTextId    = isset( $row['text_id']    ) ? IntVal( $row['text_id']    ) : null;
-                       $this->mUserText  = isset( $row['user_text']  ) ? StrVal( $row['user_text']  ) : $wgUser->getName();
-                       $this->mUser      = isset( $row['user']       ) ? IntVal( $row['user']       ) : $wgUser->getId();
-                       $this->mMinorEdit = isset( $row['minor_edit'] ) ? IntVal( $row['minor_edit'] ) : 0;
-                       $this->mTimestamp = isset( $row['timestamp']  ) ? StrVal( $row['timestamp']  ) : wfTimestamp( TS_MW );
-                       $this->mDeleted   = isset( $row['deleted']    ) ? IntVal( $row['deleted']    ) : 0;
+                       $this->mId        = isset( $row['id']         ) ? intval( $row['id']         ) : null;
+                       $this->mPage      = isset( $row['page']       ) ? intval( $row['page']       ) : null;
+                       $this->mTextId    = isset( $row['text_id']    ) ? intval( $row['text_id']    ) : null;
+                       $this->mUserText  = isset( $row['user_text']  ) ? strval( $row['user_text']  ) : $wgUser->getName();
+                       $this->mUser      = isset( $row['user']       ) ? intval( $row['user']       ) : $wgUser->getId();
+                       $this->mMinorEdit = isset( $row['minor_edit'] ) ? intval( $row['minor_edit'] ) : 0;
+                       $this->mTimestamp = isset( $row['timestamp']  ) ? strval( $row['timestamp']  ) : wfTimestamp( TS_MW );
+                       $this->mDeleted   = isset( $row['deleted']    ) ? intval( $row['deleted']    ) : 0;
 
                        // Enforce spacing trimming on supplied text
-                       $this->mComment   = isset( $row['comment']    ) ?  trim( StrVal( $row['comment'] ) ) : null;
-                       $this->mText      = isset( $row['text']       ) ? rtrim( StrVal( $row['text']    ) ) : null;
+                       $this->mComment   = isset( $row['comment']    ) ?  trim( strval( $row['comment'] ) ) : null;
+                       $this->mText      = isset( $row['text']       ) ? rtrim( strval( $row['text']    ) ) : null;
 
                        $this->mTitle     = null; # Load on demand if needed
                        $this->mCurrent   = false;
index b9b3b50..c2604ba 100644 (file)
@@ -727,7 +727,7 @@ class Sanitizer {
        }
        
        function decCharReference( $codepoint ) {
-               $point = IntVal( $codepoint );
+               $point = intval( $codepoint );
                if( Sanitizer::validateCodepoint( $point ) ) {
                        return sprintf( '&#%d;', $point );
                } else {
index b335a38..abc4d58 100644 (file)
@@ -129,8 +129,8 @@ class SearchEngine {
         * @access public
         */
        function setLimitOffset( $limit, $offset = 0 ) {
-               $this->limit = IntVal( $limit );
-               $this->offset = IntVal( $offset );
+               $this->limit = intval( $limit );
+               $this->offset = intval( $offset );
        }
 
        /**
index 3481aa5..35b7e7d 100644 (file)
@@ -318,7 +318,7 @@ END;
                                $red = "&redirect={$redirect}";
                        }
                        if ( !empty($oldid) && ! isset( $diff ) ) {
-                               $oid = "&oldid=" . IntVal( $oldid );
+                               $oid = "&oldid=" . intval( $oldid );
                        }
                        $s = $wgTitle->getFullURL( "action=edit{$oid}{$red}" );
                        $s = 'document.location = "' .$s .'";';
index daf9f5b..a3d8073 100644 (file)
@@ -564,7 +564,7 @@ class SkinTemplate extends Skin {
 
                        wfProfileIn( "$fname-edit" );
                        if ( $this->mTitle->userCanEdit() ) {
-                               $oid = ( $oldid && ! isset( $diff ) ) ? '&oldid='.IntVal( $oldid ) : false;
+                               $oid = ( $oldid && ! isset( $diff ) ) ? '&oldid='.intval( $oldid ) : false;
                                $istalk = $this->mTitle->isTalkPage();
                                $istalkclass = $istalk?' istalk':'';
                                $content_actions['edit'] = array(
@@ -581,7 +581,7 @@ class SkinTemplate extends Skin {
                                        );
                                }
                        } else {
-                               $oid = ( $oldid && ! isset( $diff ) ) ? '&oldid='.IntVal( $oldid ) : '';
+                               $oid = ( $oldid && ! isset( $diff ) ) ? '&oldid='.intval( $oldid ) : '';
                                $content_actions['viewsource'] = array(
                                        'class' => ($action == 'edit') ? 'selected' : false,
                                        'text' => wfMsg('viewsource'),
@@ -664,7 +664,7 @@ class SkinTemplate extends Skin {
                        if( $wgUser->isLoggedIn() || $wgValidationForAnons ) { # and $action != 'submit' ) {
                                # Validate tab. TODO: add validation to logged-in user rights
                                if($wgUseValidation && ( $action == "" || $action=='view' ) ){ # && $wgUser->isAllowed('validate')){
-                                       if ( $oldid ) $oid = IntVal( $oldid ) ; # Use the oldid
+                                       if ( $oldid ) $oid = intval( $oldid ) ; # Use the oldid
                                        else
                                                {# Trying to get the current article revision through this weird stunt
                                                $tid = $this->mTitle->getArticleID();
index 07b2df5..5765a50 100644 (file)
@@ -181,7 +181,7 @@ class WikiRevision {
                # Sneak a single revision into place
                $user = User::newFromName( $this->getUser() );
                if( $user ) {
-                       $userId = IntVal( $user->getId() );
+                       $userId = intval( $user->getId() );
                        $userText = $user->getName();
                } else {
                        $userId = 0;
index 4981c74..265ded6 100644 (file)
@@ -337,7 +337,7 @@ class SpecialSearch {
 
                $lines = explode( "\n", $text );
 
-               $max = IntVal( $contextchars ) + 1;
+               $max = intval( $contextchars ) + 1;
                $pat1 = "/(.*)($terms)(.{0,$max})/i";
 
                $lineno = 0;
index 3a7be81..d95db8c 100644 (file)
@@ -216,7 +216,7 @@ class Title {
                $t =& new Title();
                $t->mInterwiki = '';
                $t->mFragment = '';
-               $t->mNamespace = IntVal( $ns );
+               $t->mNamespace = intval( $ns );
                $t->mDbkeyform = str_replace( ' ', '_', $title );
                $t->mArticleID = ( $ns >= 0 ) ? -1 : 0;
                $t->mUrlform = wfUrlencode( $t->mDbkeyform );
@@ -2014,8 +2014,8 @@ wfdebug("title: articleid = ".$this->mArticleID."\n");
        function getPreviousRevisionID( $revision ) {
                $dbr =& wfGetDB( DB_SLAVE );
                return $dbr->selectField( 'revision', 'rev_id',
-                       'rev_page=' . IntVal( $this->getArticleId() ) .
-                       ' AND rev_id<' . IntVal( $revision ) . ' ORDER BY rev_id DESC' );
+                       'rev_page=' . intval( $this->getArticleId() ) .
+                       ' AND rev_id<' . intval( $revision ) . ' ORDER BY rev_id DESC' );
        }
 
        /**
@@ -2027,8 +2027,8 @@ wfdebug("title: articleid = ".$this->mArticleID."\n");
        function getNextRevisionID( $revision ) {
                $dbr =& wfGetDB( DB_SLAVE );
                return $dbr->selectField( 'revision', 'rev_id',
-                       'rev_page=' . IntVal( $this->getArticleId() ) .
-                       ' AND rev_id>' . IntVal( $revision ) . ' ORDER BY rev_id' );
+                       'rev_page=' . intval( $this->getArticleId() ) .
+                       ' AND rev_id>' . intval( $revision ) . ' ORDER BY rev_id' );
        }
 
        /**
index ad9b7e1..4b55c83 100644 (file)
@@ -516,7 +516,7 @@ class User {
                                }
                        } else {
                                wfDebug( "$fname: adding record for $key $summary\n" );
-                               $wgMemc->add( $key, 1, IntVal( $period ) );
+                               $wgMemc->add( $key, 1, intval( $period ) );
                        }
                        $wgMemc->incr( $key );
                }
@@ -596,7 +596,7 @@ class User {
                                return new User();
                        }
                } else if ( isset( $_COOKIE["{$wgDBname}UserID"] ) ) {
-                       $sId = IntVal( $_COOKIE["{$wgDBname}UserID"] );
+                       $sId = intval( $_COOKIE["{$wgDBname}UserID"] );
                        $_SESSION['wsUserID'] = $sId;
                } else {
                        return new User();
@@ -660,7 +660,7 @@ class User {
                }
 
                # Paranoia
-               $this->mId = IntVal( $this->mId );
+               $this->mId = intval( $this->mId );
 
                /** Anonymous user */
                if( !$this->mId ) {
index 31195eb..87fc023 100644 (file)
@@ -172,7 +172,7 @@ class WebRequest {
         * @return int
         */
        function getInt( $name, $default = 0 ) {
-               return IntVal( $this->getVal( $name, $default ) );
+               return intval( $this->getVal( $name, $default ) );
        }
        
        /**
@@ -185,7 +185,7 @@ class WebRequest {
        function getIntOrNull( $name ) {
                $val = $this->getVal( $name );
                return is_numeric( $val )
-                       ? IntVal( $val )
+                       ? intval( $val )
                        : null;
        }
        
index 55f420e..c6183b5 100644 (file)
@@ -573,8 +573,8 @@ class UtfNormal {
                                                 | (ord( $c{1} ) & 0x3f) <<  6
                                                 | (ord( $c{2} ) & 0x3f) )
                                               - UNICODE_HANGUL_FIRST;
-                                       $l = IntVal( $index / UNICODE_HANGUL_NCOUNT );
-                                       $v = IntVal( ($index % UNICODE_HANGUL_NCOUNT) / UNICODE_HANGUL_TCOUNT);
+                                       $l = intval( $index / UNICODE_HANGUL_NCOUNT );
+                                       $v = intval( ($index % UNICODE_HANGUL_NCOUNT) / UNICODE_HANGUL_TCOUNT);
                                        $t = $index % UNICODE_HANGUL_TCOUNT;
                                        $out .= "\xe1\x84" . chr( 0x80 + $l ) . "\xe1\x85" . chr( 0xa1 + $v );
                                        if( $t >= 25 ) {
index dbf69f4..a504eef 100644 (file)
@@ -97,7 +97,7 @@ function benchmarkForm( &$u, &$data, $form ) {
        sort( $deltas );
        $delta = $deltas[0]; # Take shortest time
        
-       $rate = IntVal( strlen( $data ) / $delta );
+       $rate = intval( strlen( $data ) / $delta );
        $same = (0 == strcmp( $data, $out ) );
        
        printf( " %20s %6.1fms %8d bytes/s (%s)\n", $form, $delta*1000.0, $rate, ($same ? 'no change' : 'changed' ) );
index efe25de..1c00e2b 100644 (file)
@@ -99,7 +99,7 @@ while( false !== ($line = fgets( $in ) ) ) {
        $source = codepointToUtf8( hexdec( $codepoint ) );
 
        if( $canonicalCombiningClass != 0 ) {
-               $combiningClass[$source] = IntVal( $canonicalCombiningClass );
+               $combiningClass[$source] = intval( $canonicalCombiningClass );
        }
        
        if( $decompositionMapping === '' ) continue;
index 90c2ea1..0bbc801 100644 (file)
@@ -141,8 +141,8 @@ if( $ok ) {
 ## ------
 
 function reportResults( &$total, &$success, &$failure ) {
-       $percSucc = IntVal( $success * 100 / $total );
-       $percFail = IntVal( $failure * 100 / $total );
+       $percSucc = intval( $success * 100 / $total );
+       $percFail = intval( $failure * 100 / $total );
        print "\n";
        print "$success tests successful ($percSucc%)\n";
        print "$failure tests failed ($percFail%)\n\n";
index 2adbd50..32f46d7 100644 (file)
@@ -89,7 +89,7 @@ while (1) {
                if ((isset($highest) && ($a > $highest)) || (isset($lowest) && $a <= $lowest))
                        continue;
                $user = str_replace($bad, $empty, $row->rc_user_text);
-               $lastid = IntVal($row->rc_last_oldid);
+               $lastid = intval($row->rc_last_oldid);
                $flag = ($row->rc_minor ? "M" : "") . ($row->rc_new ? "N" : "");
                $stupid_urlencode = array("%2F", "%3A");
                $haha_take_that = array("/", ":");
index 4c8fcbc..42e5efb 100644 (file)
@@ -375,7 +375,7 @@ class FiveUpgrade {
                        INDEX usertext_timestamp (rev_user_text,rev_timestamp)
                        ) TYPE=InnoDB", $fname );
 
-               $maxold = IntVal( $this->dbw->selectField( 'old', 'max(old_id)', '', $fname ) );
+               $maxold = intval( $this->dbw->selectField( 'old', 'max(old_id)', '', $fname ) );
                $this->log( "Last old record is {$maxold}" );
 
                global $wgLegacySchemaConversion;
index 9f45433..45552c1 100644 (file)
@@ -52,7 +52,7 @@ if( !$wgUseSquid ) {
        printf( "There are %d defined squid servers:\n", count( $wgSquidServers ) );
        #echo implode( "\n", $wgSquidServers ) . "\n";
        if( isset( $options['count'] ) ) {
-               $lengths = array( IntVal( $options['count'] ) );
+               $lengths = array( intval( $options['count'] ) );
        } else {
                $lengths = array( 1, 10, 100 );
        }
index 12c296f..8b1ea5e 100644 (file)
@@ -47,7 +47,7 @@ END
                        echo "Just a demo...\n";
                }
                while( $row = $dbw->fetchObject( $res ) ) {
-                       $ns = IntVal( $row->cur_namespace );
+                       $ns = intval( $row->cur_namespace );
                        $title = $dbw->addQuotes( $row->cur_title );
                        
                        # Get the first responding ID; that'll be the one we keep.
index b934120..c7266e9 100644 (file)
@@ -133,7 +133,7 @@ if( isset( $options['quiet'] ) ) {
        $dumper->reporting = false;
 }
 if( isset( $options['report'] ) ) {
-       $dumper->reportingInterval = IntVal( $options['report'] );
+       $dumper->reportingInterval = intval( $options['report'] );
 }
 if( isset( $options['server'] ) ) {
        $dumper->server = $options['server'];
index 314c44c..21894a6 100644 (file)
@@ -115,7 +115,7 @@ if( isset( $options['quiet'] ) ) {
        $reader->reporting = false;
 }
 if( isset( $options['report'] ) ) {
-       $reader->reportingInterval = IntVal( $options['report'] );
+       $reader->reportingInterval = intval( $options['report'] );
 }
 if( isset( $options['dry-run'] ) ) {
        $reader->dryRun = true;
index c31f1c7..1ce9b73 100644 (file)
@@ -116,7 +116,7 @@ class LogImporter {
                                        'log_type' => $this->type,
                                        'log_action' => preg_replace( '!^.*/!', '', $action ),
                                        'log_timestamp' => $date,
-                                       'log_user' => IntVal( User::idFromName( $user->getText() ) ),
+                                       'log_user' => intval( User::idFromName( $user->getText() ) ),
                                        'log_namespace' => $target->getNamespace(),
                                        'log_title' => $target->getDBkey(),
                                        'log_comment' => wfUnescapeWikiText( $comment ),
index e53097b..27f99b4 100644 (file)
@@ -158,7 +158,7 @@ class Phase2Importer {
                print " ($total total)\n";
                
                while( $row = wfFetchObject( $res ) ) {
-                       $id = IntVal( $row->user_id );
+                       $id = intval( $row->user_id );
                        $list = explode( "\n", $row->user_watch );
                        foreach( $list as $page ) {
                                $title = $this->titleCache->fetch( $page );
@@ -310,7 +310,7 @@ class Phase2Importer {
                print " ($total total)\n";
                
                while( $row = wfFetchObject( $res ) ) {
-                       $id = IntVal( $row->user_id );
+                       $id = intval( $row->user_id );
                        $option = wfStrencode( $this->rewriteUserOptions( $row->user_options ) );
                        wfQuery( "UPDATE user SET user_options='$option' WHERE user_id=$id LIMIT 1", DB_MASTER );
                        if( ++$n % 50 == 0 ) {
index 4c23901..b7c54b7 100644 (file)
@@ -83,14 +83,14 @@ function rebuildRecentChangesTablePass2()
                $new = 0;
                if( $obj->rc_cur_id != $lastCurId ) {
                        # Switch! Look up the previous last edit, if any
-                       $lastCurId = IntVal( $obj->rc_cur_id );
+                       $lastCurId = intval( $obj->rc_cur_id );
                        $emit = $obj->rc_timestamp;
                        $sql2 = "SELECT old_id FROM $old,$cur " .
                                "WHERE old_namespace=cur_namespace AND old_title=cur_title AND cur_id={$lastCurId} ".
                                "AND old_timestamp<'{$emit}' ORDER BY old_timestamp DESC LIMIT 1";
                        $res2 = $dbw->query( $sql2 );
                        if( $row = $dbw->fetchObject( $res2 ) ) {
-                               $lastOldId = IntVal( $row->old_id );
+                               $lastOldId = intval( $row->old_id );
                        } else {
                                # No previous edit
                                $lastOldId = 0;
@@ -104,7 +104,7 @@ function rebuildRecentChangesTablePass2()
                        $sql3 = "UPDATE $recentchanges SET rc_last_oldid=$lastOldId,rc_new=$new,rc_type=$new " .
                                "WHERE rc_cur_id={$lastCurId} AND rc_this_oldid={$obj->rc_this_oldid}";
                        $dbw->query( $sql3 );
-                       $lastOldId = IntVal( $obj->rc_this_oldid );
+                       $lastOldId = intval( $obj->rc_this_oldid );
                }
        }
        $dbw->freeResult( $res );
index 2676b35..5cde1e5 100644 (file)
@@ -500,7 +500,7 @@ function do_pagelinks_update() {
 function do_pagelinks_namespace( $namespace ) {
        global $wgDatabase, $wgContLang;
 
-       $ns = IntVal( $namespace );
+       $ns = intval( $namespace );
        echo "Cleaning up broken links for namespace $ns... ";
 
        $pagelinks = $wgDatabase->tableName( 'pagelinks' );
index 10704df..db2487d 100644 (file)
@@ -273,7 +273,7 @@ class UserDupes {
         */
        function editCountOn( $table, $field, $userid ) {
                $fname = 'UserDupes::editCountOn';
-               return IntVal( $this->db->selectField(
+               return intval( $this->db->selectField(
                        $table,
                        'COUNT(*)',
                        array( $field => $userid ),
index 6f3e8d4..1c732b3 100644 (file)
@@ -77,7 +77,7 @@ END
        function fetchIds( &$results ) {
                $matches = array();
                while( $row = $results->fetchObject() ) {
-                       $matches[] = IntVal( $row->page_id );
+                       $matches[] = intval( $row->page_id );
                }
                $results->free();
                # Search is not guaranteed to return results in a certain order;