Mass convert NULL -> null. Left strings and comments alone, obviously.
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 11 Dec 2009 21:07:27 +0000 (21:07 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 11 Dec 2009 21:07:27 +0000 (21:07 +0000)
64 files changed:
includes/AjaxDispatcher.php
includes/AjaxResponse.php
includes/Article.php
includes/ChangesList.php
includes/DatabaseFunctions.php
includes/DefaultSettings.php
includes/Exif.php
includes/GlobalFunctions.php
includes/Hooks.php
includes/ImagePage.php
includes/LinkCache.php
includes/Linker.php
includes/LogPage.php
includes/MagicWord.php
includes/Math.php
includes/MimeMagic.php
includes/Namespace.php
includes/QueryPage.php
includes/RecentChange.php
includes/Sanitizer.php
includes/Skin.php
includes/SkinTemplate.php
includes/SpecialPage.php
includes/Title.php
includes/User.php
includes/WatchedItem.php
includes/WebRequest.php
includes/Wiki.php
includes/api/ApiDelete.php
includes/api/ApiFormatYaml_spyc.php
includes/api/ApiProtect.php
includes/api/ApiQueryInfo.php
includes/api/ApiQueryUserInfo.php
includes/api/ApiQueryUsers.php
includes/api/ApiRollback.php
includes/api/ApiUndelete.php
includes/db/Database.php
includes/db/DatabaseIbm_db2.php
includes/db/DatabaseMssql.php
includes/db/DatabasePostgres.php
includes/db/DatabaseSqlite.php
includes/db/LoadBalancer.php
includes/filerepo/ArchivedFile.php
includes/filerepo/File.php
includes/filerepo/Image.php
includes/json/Services_JSON.php
includes/memcached-client.php
includes/normal/Utf8Test.php
includes/normal/UtfNormal.php
includes/parser/Parser.php
includes/search/SearchEngine.php
includes/search/SearchSqlite.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialContributions.php
includes/specials/SpecialExport.php
includes/specials/SpecialMovepage.php
includes/specials/SpecialNewpages.php
includes/specials/SpecialSearch.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUserlogin.php
includes/upload/UploadBase.php
index.php
t/inc/Database.t
tests/DatabaseTest.php

index c489cf1..9971ad5 100644 (file)
@@ -101,7 +101,7 @@ class AjaxDispatcher {
                        try {
                                $result = call_user_func_array($func, $this->args);
 
-                               if ( $result === false || $result === NULL ) {
+                               if ( $result === false || $result === null ) {
                                        wfDebug( __METHOD__ . ' ERROR while dispatching ' 
                                                        . $this->func_name . "(" . var_export( $this->args, true ) . "): " 
                                                        . "no data returned\n" );
index 26b6f44..646019d 100644 (file)
@@ -37,9 +37,9 @@ class AjaxResponse {
        /** Content of our HTTP response */
        private $mText;
 
-       function __construct( $text = NULL ) {
-               $this->mCacheDuration = NULL;
-               $this->mVary = NULL;
+       function __construct( $text = null ) {
+               $this->mCacheDuration = null;
+               $this->mVary = null;
 
                $this->mDisabled = false;
                $this->mText = '';
index a8813e4..20c01c7 100644 (file)
@@ -499,7 +499,7 @@ class Article {
         *
         * @param $x Mixed: FIXME
         */
-       public function forUpdate( $x = NULL ) {
+       public function forUpdate( $x = null ) {
                return wfSetVar( $this->mForUpdate, $x );
        }
 
@@ -614,7 +614,7 @@ class Article {
                } else {
                        $titleObj = Title::newFromRedirect( $text );
                }
-               return $titleObj !== NULL;
+               return $titleObj !== null;
        }
 
        /**
@@ -1596,7 +1596,7 @@ class Article {
                                'page_latest'      => $revision->getId(),
                                'page_touched'     => $dbw->timestamp(),
                                'page_is_new'      => ($lastRevision === 0) ? 1 : 0,
-                               'page_is_redirect' => $rt !== NULL ? 1 : 0,
+                               'page_is_redirect' => $rt !== null ? 1 : 0,
                                'page_len'         => strlen( $text ),
                        ),
                        $conditions,
@@ -1688,7 +1688,7 @@ class Article {
         * @param $section empty/null/false or a section number (0, 1, 2, T1, T2...)
         * @return string Complete article text, or null if error
         */
-       public function replaceSection( $section, $text, $summary = '', $edittime = NULL ) {
+       public function replaceSection( $section, $text, $summary = '', $edittime = null ) {
                wfProfileIn( __METHOD__ );
                if( strval( $section ) == '' ) {
                        // Whole-page edit; let the whole text through
index 70a5dcb..e09258e 100644 (file)
@@ -45,7 +45,7 @@ class ChangesList {
         */
        public static function newFromUser( &$user ) {
                $sk = $user->getSkin();
-               $list = NULL;
+               $list = null;
                if( wfRunHooks( 'FetchChangesList', array( &$user, &$sk, &$list ) ) ) {
                        return $user->getOption( 'usenewrc' ) ?
                                new EnhancedChangesList( $sk ) : new OldChangesList( $sk );
@@ -504,7 +504,7 @@ class OldChangesList extends ChangesList {
        /**
         * Format a line using the old system (aka without any javascript).
         */
-       public function recentChangesLine( &$rc, $watched = false, $linenumber = NULL ) {
+       public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
                global $wgLang, $wgRCShowChangedSize, $wgUser;
                wfProfileIn( __METHOD__ );
                # Should patrol-related stuff be shown?
@@ -915,10 +915,10 @@ class EnhancedChangesList extends ChangesList {
                        $last = 0;
                        $first = count($block) - 1;
                        # Some events (like logs) have an "empty" size, so we need to skip those...
-                       while( $last < $first && $block[$last]->mAttribs['rc_new_len'] === NULL ) {
+                       while( $last < $first && $block[$last]->mAttribs['rc_new_len'] === null ) {
                                $last++;
                        }
-                       while( $first > $last && $block[$first]->mAttribs['rc_old_len'] === NULL ) {
+                       while( $first > $last && $block[$first]->mAttribs['rc_old_len'] === null ) {
                                $first--;
                        }
                        # Get net change
index 52e9a8c..2df5611 100644 (file)
@@ -58,7 +58,7 @@ function wfIgnoreSQLErrors( $newstate, $dbi = DB_LAST ) {
        if ( $db !== false ) {
                return $db->ignoreErrors( $newstate );
        } else {
-               return NULL;
+               return null;
        }
 }
 
index 321f338..ee0b959 100644 (file)
@@ -313,7 +313,7 @@ $wgUrlProtocols = array(
 /** internal name of virus scanner. This servers as a key to the $wgAntivirusSetup array.
  * Set this to NULL to disable virus scanning. If not null, every file uploaded will be scanned for viruses.
  */
-$wgAntivirus= NULL;
+$wgAntivirus= null;
 
 /** Configuration for different virus scanners. This an associative array of associative arrays:
  * it contains on setup array per known scanner type. The entry is selected by $wgAntivirus, i.e.
@@ -380,11 +380,11 @@ $wgVerifyMimeType= true;
 /** Sets the mime type definition file to use by MimeMagic.php. */
 $wgMimeTypeFile= "includes/mime.types";
 #$wgMimeTypeFile= "/etc/mime.types";
-#$wgMimeTypeFile= NULL; #use built-in defaults only.
+#$wgMimeTypeFile= null; #use built-in defaults only.
 
 /** Sets the mime type info file to use by MimeMagic.php. */
 $wgMimeInfoFile= "includes/mime.info";
-#$wgMimeInfoFile= NULL; #use built-in defaults only.
+#$wgMimeInfoFile= null; #use built-in defaults only.
 
 /** Switch for loading the FileInfo extension by PECL at runtime.
  * This should be used only if fileinfo is installed as a shared object
@@ -397,7 +397,7 @@ $wgLoadFileinfoExtension= false;
  * The name of the file to process will be appended to the command given here.
  * If not set or NULL, mime_content_type will be used if available.
  */
-$wgMimeDetectorCommand= NULL; # use internal mime_content_type function, available since php 4.3.0
+$wgMimeDetectorCommand= null; # use internal mime_content_type function, available since php 4.3.0
 #$wgMimeDetectorCommand= "file -bi"; #use external mime detector (Linux)
 
 /** Switch for trivial mime detection. Used by thumb.php to disable all fance
@@ -2443,13 +2443,13 @@ $wgEnableCreativeCommonsRdf = false;
 /** Override for copyright metadata.
  * TODO: these options need documentation
  */
-$wgRightsPage = NULL;
-$wgRightsUrl = NULL;
-$wgRightsText = NULL;
-$wgRightsIcon = NULL;
+$wgRightsPage = null;
+$wgRightsUrl = null;
+$wgRightsText = null;
+$wgRightsIcon = null;
 
 /** Set this to some HTML to override the rights icon with an arbitrary logo */
-$wgCopyrightIcon = NULL;
+$wgCopyrightIcon = null;
 
 /** Set this to true if you want detailed copyright information forms on Upload. */
 $wgUseCopyrightUpload = false;
@@ -2924,7 +2924,7 @@ $wgOverrideSiteFeed = array();
 #            102 => "Aide",
 #            103 => "Discussion_Aide"
 #            );
-$wgExtraNamespaces = NULL;
+$wgExtraNamespaces = null;
 
 /**
  * Namespace aliases
@@ -3533,7 +3533,7 @@ $wgRateLimits = array(
                'subnet' => null,
                ),
        'mailpassword' => array(
-               'anon' => NULL,
+               'anon' => null,
                ),
        'emailuser' => array(
                'user' => null,
index 971d019..594e633 100644 (file)
@@ -558,7 +558,7 @@ class Exif {
         * @param $fname String:
         * @param $action Mixed: , default NULL.
         */
-       function debug( $in, $fname, $action = NULL ) {
+       function debug( $in, $fname, $action = null ) {
                if ( !$this->log ) {
                        return;
                }
index 57c33c4..4d1f1f5 100644 (file)
@@ -1277,7 +1277,7 @@ function wfSetBit( &$dest, $bit, $state = true ) {
  * "days=7&limit=100". Options in the first array override options in the second.
  * Options set to "" will not be output.
  */
-function wfArrayToCGI( $array1, $array2 = NULL )
+function wfArrayToCGI( $array1, $array2 = null )
 {
        if ( !is_null( $array2 ) ) {
                $array1 = $array1 + $array2;
@@ -1717,7 +1717,7 @@ function mimeTypeMatch( $type, $avail ) {
                } elseif( array_key_exists( '*/*', $avail ) ) {
                        return '*/*';
                } else {
-                       return NULL;
+                       return null;
                }
        }
 }
@@ -1759,7 +1759,7 @@ function wfNegotiateType( $cprefs, $sprefs ) {
        }
 
        $bestq = 0;
-       $besttype = NULL;
+       $besttype = null;
 
        foreach( array_keys( $combine ) as $type ) {
                if( $combine[$type] > $bestq ) {
index faf7fb9..dec1c44 100644 (file)
@@ -49,10 +49,10 @@ function wfRunHooks($event, $args = array()) {
 
        foreach ($wgHooks[$event] as $index => $hook) {
 
-               $object = NULL;
-               $method = NULL;
-               $func = NULL;
-               $data = NULL;
+               $object = null;
+               $method = null;
+               $func = null;
+               $data = null;
                $have_data = false;
                $closure = false;
 
index 700bb76..40cbe7c 100644 (file)
@@ -1021,7 +1021,7 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager {
                $this->mImagePage = $imagePage;
                $this->mTitle = clone( $imagePage->getTitle() );
                $this->mTitle->setFragment( '#filehistory' );
-               $this->mImg = NULL;
+               $this->mImg = null;
                $this->mHist = array();
                $this->mRange = array( 0, 0 ); // display range
        }
index a6d2185..8d03576 100644 (file)
@@ -33,7 +33,7 @@ class LinkCache {
        /**
         * General accessor to get/set whether SELECT FOR UPDATE should be used
         */
-       public function forUpdate( $update = NULL ) {
+       public function forUpdate( $update = null ) {
                return wfSetVar( $this->mForUpdate, $update );
        }
 
@@ -57,7 +57,7 @@ class LinkCache {
                if ( array_key_exists( $dbkey, $this->mGoodLinkFields ) ) {
                        return $this->mGoodLinkFields[$dbkey][$field];
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
@@ -72,7 +72,7 @@ class LinkCache {
         * @param int $len
         * @param int $redir
         */
-       public function addGoodLinkObj( $id, $title, $len = -1, $redir = NULL ) {
+       public function addGoodLinkObj( $id, $title, $len = -1, $redir = null ) {
                $dbkey = $title->getPrefixedDbKey();
                $this->mGoodLinks[$dbkey] = intval( $id );
                $this->mGoodLinkFields[$dbkey] = array(
@@ -114,7 +114,7 @@ class LinkCache {
         * @param $redir bool, is redirect?
         * @return integer
         */
-       public function addLink( $title, $len = -1, $redir = NULL ) {
+       public function addLink( $title, $len = -1, $redir = null ) {
                $nt = Title::newFromDBkey( $title );
                if( $nt ) {
                        return $this->addLinkObj( $nt, $len, $redir );
@@ -130,7 +130,7 @@ class LinkCache {
         * @param $redir bool, is redirect?
         * @return integer
         */
-       public function addLinkObj( &$nt, $len = -1, $redirect = NULL ) {
+       public function addLinkObj( &$nt, $len = -1, $redirect = null ) {
                global $wgAntiLockFlags, $wgProfiler;
                wfProfileIn( __METHOD__ );
 
index b967a87..c0258c0 100644 (file)
@@ -934,7 +934,7 @@ class Linker {
         * @param mixed $title Title object (to generate link to the section in autocomment) or null
         * @param bool $local Whether section links should refer to local page
         */
-       function formatComment($comment, $title = NULL, $local = false) {
+       function formatComment($comment, $title = null, $local = false) {
                wfProfileIn( __METHOD__ );
 
                # Sanitize text a bit:
@@ -1188,7 +1188,7 @@ class Linker {
         *
         * @return string
         */
-       function commentBlock( $comment, $title = NULL, $local = false ) {
+       function commentBlock( $comment, $title = null, $local = false ) {
                // '*' used to be the comment inserted by the software way back
                // in antiquity in case none was provided, here for backwards
                // compatability, acc. to brion -ævar
index 8cd9dea..24a9b09 100644 (file)
@@ -166,7 +166,7 @@ class LogPage {
         * @static
         * @return HTML string
         */
-       public static function actionText( $type, $action, $title = NULL, $skin = NULL
+       public static function actionText( $type, $action, $title = null, $skin = null
                $params = array(), $filterWikilinks = false ) 
        {
                global $wgLang, $wgContLang, $wgLogActions, $wgMessageCache;
@@ -385,7 +385,7 @@ class LogPage {
                
                $this->doer = $doer;
 
-               $this->actionText = LogPage::actionText( $this->type, $action, $target, NULL, $params );
+               $this->actionText = LogPage::actionText( $this->type, $action, $target, null, $params );
 
                return $this->saveContent();
        }
index aad267b..60e3d98 100644 (file)
@@ -343,7 +343,7 @@ class MagicWord {
                $matches = array();
                $matchcount = preg_match( $this->getVariableStartToEndRegex(), $text, $matches );
                if ( $matchcount == 0 ) {
-                       return NULL;
+                       return null;
                } else {
                        # multiple matched parts (variable match); some will be empty because of
                        # synonyms. The variable will be the second non-empty one so remove any
index ea9ff58..70f4b81 100644 (file)
@@ -104,14 +104,14 @@ class MathRenderer {
                                } else {
                                        $this->conservativeness = 0;
                                }
-                               $this->mathml = NULL;
+                               $this->mathml = null;
                        } else if ($retval == 'X') {
-                               $this->html = NULL;
+                               $this->html = null;
                                $this->mathml = substr ($contents, 33);
                                $this->conservativeness = 0;
                        } else if ($retval == '+') {
-                               $this->html = NULL;
-                               $this->mathml = NULL;
+                               $this->html = null;
+                               $this->mathml = null;
                                $this->conservativeness = 0;
                        } else {
                                $errbit = htmlspecialchars( substr($contents, 1) );
index 5e28ebe..39c82c9 100644 (file)
@@ -118,19 +118,19 @@ class MimeMagic {
        * Mapping of media types to arrays of mime types.
        * This is used by findMediaType and getMediaType, respectively
        */
-       var $mMediaTypes= NULL;
+       var $mMediaTypes= null;
 
        /** Map of mime type aliases
        */
-       var $mMimeTypeAliases= NULL;
+       var $mMimeTypeAliases= null;
 
        /** map of mime types to file extensions (as a space seprarated list)
        */
-       var $mMimeToExt= NULL;
+       var $mMimeToExt= null;
 
        /** map of file extensions types to mime types (as a space seprarated list)
        */
-       var $mExtToMime= NULL;
+       var $mExtToMime= null;
 
        /** IEContentAnalyzer instance
         */
@@ -328,7 +328,7 @@ class MimeMagic {
        */
        function guessTypesForExtension( $ext ) {
                $m = $this->getTypesForExtension( $ext );
-               if ( is_null( $m ) ) return NULL;
+               if ( is_null( $m ) ) return null;
 
                $m = trim( $m );
                $m = preg_replace( '/\s.*$/', '', $m );
@@ -345,7 +345,7 @@ class MimeMagic {
                $ext = $this->getExtensionsForType( $mime );
 
                if ( !$ext ) {
-                       return NULL;  //unknown
+                       return null;  //unknown
                }
 
                $ext = explode( ' ', $ext );
@@ -508,7 +508,7 @@ class MimeMagic {
                /*
                 * look for shell scripts
                 */
-               $script_type = NULL;
+               $script_type = null;
 
                # detect by shebang
                if ( substr( $head, 0, 2) == "#!" ) {
@@ -631,7 +631,7 @@ class MimeMagic {
        function detectMimeType( $file, $ext = true ) {
                global $wgMimeDetectorCommand;
 
-               $m = NULL;
+               $m = null;
                if ( $wgMimeDetectorCommand ) {
                        $fn = wfEscapeShellArg( $file );
                        $m = `$wgMimeDetectorCommand $fn`;
@@ -678,7 +678,7 @@ class MimeMagic {
                        $m = strtolower( $m );
 
                        if ( strpos( $m, 'unknown' ) !== false ) {
-                               $m = NULL;
+                               $m = null;
                        } else {
                                wfDebug( __METHOD__.": magic mime type of $file: $m\n" );
                                return $m;
@@ -723,7 +723,7 @@ class MimeMagic {
        *
        * @return (int?string?) a value to be used with the MEDIATYPE_xxx constants.
        */
-       function getMediaType( $path = NULL, $mime = NULL ) {
+       function getMediaType( $path = null, $mime = null ) {
                if( !$mime && !$path ) return MEDIATYPE_UNKNOWN;
 
                # If mime type is unknown, guess it
@@ -756,7 +756,7 @@ class MimeMagic {
                }
 
                # Check for entry for file extension
-               $e = NULL;
+               $e = null;
                if ( $path ) {
                        $i = strrpos( $path, '.' );
                        $e = strtolower( $i ? substr( $path, $i + 1 ) : '' );
index a9601b4..4efc7a8 100644 (file)
@@ -151,7 +151,7 @@ class MWNamespace {
                if ( array_key_exists( $name, $xNamespaces ) ) {
                        return $xNamespaces[$name];
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
index 9d89ac3..a50c882 100644 (file)
@@ -490,7 +490,7 @@ class QueryPage {
         */
        function feedResult( $row ) {
                if( !isset( $row->title ) ) {
-                       return NULL;
+                       return null;
                }
                $title = Title::MakeTitle( intval( $row->namespace ), $row->title );
                if( $title ) {
@@ -509,7 +509,7 @@ class QueryPage {
                                $this->feedItemAuthor( $row ),
                                $comments);
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
index 64ab5ab..f42c38e 100644 (file)
@@ -77,7 +77,7 @@ class RecentChange
                        $dbr->freeResult( $res );
                        return self::newFromRow( $row );
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
@@ -451,8 +451,8 @@ class RecentChange
                        'rc_ip'         => $ip,
                        'rc_new'        => 0, # obsolete
                        'rc_patrolled'  => 1,
-                       'rc_old_len'    => NULL,
-                       'rc_new_len'    => NULL,
+                       'rc_old_len'    => null,
+                       'rc_new_len'    => null,
                        'rc_deleted'    => 0,
                        'rc_logid'              => 0, # notifyMove not used anymore
                        'rc_log_type'   => null,
@@ -519,8 +519,8 @@ class RecentChange
                        'rc_ip' => $ip,
                        'rc_patrolled' => 1,
                        'rc_new'        => 0, # obsolete
-                       'rc_old_len'    => NULL,
-                       'rc_new_len'    => NULL,
+                       'rc_old_len'    => null,
+                       'rc_new_len'    => null,
                        'rc_deleted'    => 0,
                        'rc_logid'              => $newId,
                        'rc_log_type'   => $type,
@@ -581,7 +581,7 @@ class RecentChange
         * @return mixed
         */
        public function getAttribute( $name ) {
-               return isset( $this->mAttribs[$name] ) ? $this->mAttribs[$name] : NULL;
+               return isset( $this->mAttribs[$name] ) ? $this->mAttribs[$name] : null;
        }
 
        public function getAttributes() {
@@ -700,7 +700,7 @@ class RecentChange
                if( $new === 0 ) {
                        $new = $this->mAttribs['rc_new_len'];
                }
-               if( $old === NULL || $new === NULL ) {
+               if( $old === null || $new === null ) {
                        return '';
                }
                return ChangesList::showCharacterDifference( $old, $new );
index b1a3796..bdc8362 100644 (file)
@@ -475,7 +475,7 @@ class Sanitizer {
                                                        $brace = '/>';
                                                } else if( isset( $htmlsingle[$t] ) ) {
                                                        # Hack to not close $htmlsingle tags
-                                                       $brace = NULL;
+                                                       $brace = null;
                                                } else if( isset( $tabletags[$t] )
                                                &&  in_array($t ,$tagstack) ) {
                                                        // New table tag but forgot to close the previous one
index 2d428a1..0777292 100644 (file)
@@ -401,8 +401,8 @@ class Skin extends Linker {
                        'wgAction' => $wgRequest->getText( 'action', 'view' ),
                        'wgArticleId' => $wgTitle->getArticleId(),
                        'wgIsArticle' => $wgOut->isArticle(),
-                       'wgUserName' => $wgUser->isAnon() ? NULL : $wgUser->getName(),
-                       'wgUserGroups' => $wgUser->isAnon() ? NULL : $wgUser->getEffectiveGroups(),
+                       'wgUserName' => $wgUser->isAnon() ? null : $wgUser->getName(),
+                       'wgUserGroups' => $wgUser->isAnon() ? null : $wgUser->getEffectiveGroups(),
                        'wgUserLanguage' => $wgLang->getCode(),
                        'wgContentLanguage' => $wgContLang->getCode(),
                        'wgBreakFrames' => $wgBreakFrames,
index e88b84e..0a7085f 100644 (file)
@@ -300,7 +300,7 @@ class SkinTemplate extends Skin {
                $tpl->set( 'capitalizeallnouns', $wgLang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' );
                $tpl->set( 'langname', $wgContLang->getLanguageName( $wgContLanguageCode ) );
                $tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) );
-               $tpl->set( 'username', $wgUser->isAnon() ? NULL : $this->username );
+               $tpl->set( 'username', $wgUser->isAnon() ? null : $this->username );
                $tpl->setRef( 'userpage', $this->userpage );
                $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
                $tpl->set( 'userlang', $wgLang->getCode() );
index a7556d7..39953c1 100644 (file)
@@ -277,7 +277,7 @@ class SpecialPage {
                $bits = explode( '/', $alias, 2 );
                $name = self::resolveAlias( $bits[0] );
                if( !isset( $bits[1] ) ) { // bug 2087
-                       $par = NULL;
+                       $par = null;
                } else {
                        $par = $bits[1];
                }
@@ -394,7 +394,7 @@ class SpecialPage {
                        }
                        return self::$mList[$name];
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
@@ -407,7 +407,7 @@ class SpecialPage {
                if ( $realName ) {
                        return self::getPage( $realName );
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
@@ -500,7 +500,7 @@ class SpecialPage {
                $bits = explode( '/', $title->getDBkey(), 2 );
                $name = $bits[0];
                if( !isset( $bits[1] ) ) { // bug 2087
-                       $par = NULL;
+                       $par = null;
                } else {
                        $par = $bits[1];
                }
@@ -703,18 +703,18 @@ Perhaps no page aliases are defined for it?" );
        /**#@+
          * Accessor and mutator
          */
-       function name( $x = NULL ) { return wfSetVar( $this->mName, $x ); }
-       function restrictions( $x = NULL) {
+       function name( $x = null ) { return wfSetVar( $this->mName, $x ); }
+       function restrictions( $x = null) {
                # Use the one below this
                wfDeprecated( __METHOD__ );
                return wfSetVar( $this->mRestriction, $x );
        }
-       function restriction( $x = NULL) { return wfSetVar( $this->mRestriction, $x ); }
-       function listed( $x = NULL) { return wfSetVar( $this->mListed, $x ); }
-       function func( $x = NULL) { return wfSetVar( $this->mFunction, $x ); }
-       function file( $x = NULL) { return wfSetVar( $this->mFile, $x ); }
-       function includable( $x = NULL ) { return wfSetVar( $this->mIncludable, $x ); }
-       function including( $x = NULL ) { return wfSetVar( $this->mIncluding, $x ); }
+       function restriction( $x = null) { return wfSetVar( $this->mRestriction, $x ); }
+       function listed( $x = null) { return wfSetVar( $this->mListed, $x ); }
+       function func( $x = null) { return wfSetVar( $this->mFunction, $x ); }
+       function file( $x = null) { return wfSetVar( $this->mFile, $x ); }
+       function includable( $x = null ) { return wfSetVar( $this->mIncludable, $x ); }
+       function including( $x = null ) { return wfSetVar( $this->mIncluding, $x ); }
        /**#@-*/
 
        /**
index 939d92e..1e70208 100644 (file)
@@ -92,7 +92,7 @@ class Title {
                if( $t->secureAndSplit() )
                        return $t;
                else
-                       return NULL;
+                       return null;
        }
 
        /**
@@ -146,7 +146,7 @@ class Title {
                        }
                        return $t;
                } else {
-                       $ret = NULL;
+                       $ret = null;
                        return $ret;
                }
        }
@@ -180,7 +180,7 @@ class Title {
                if( $t->secureAndSplit() ) {
                        return $t;
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
@@ -197,7 +197,7 @@ class Title {
                if( $row !== false ) {
                        $title = Title::newFromRow( $row );
                } else {
-                       $title = NULL;
+                       $title = null;
                }
                return $title;
        }
@@ -232,7 +232,7 @@ class Title {
 
                $t->mArticleID = isset($row->page_id) ? intval($row->page_id) : -1;
                $t->mLength = isset($row->page_len) ? intval($row->page_len) : -1;
-               $t->mRedirect = isset($row->page_is_redirect) ? (bool)$row->page_is_redirect : NULL;
+               $t->mRedirect = isset($row->page_is_redirect) ? (bool)$row->page_is_redirect : null;
                $t->mLatestID = isset($row->page_latest) ? $row->page_latest : false;
 
                return $t;
@@ -278,7 +278,7 @@ class Title {
                if( $t->secureAndSplit() ) {
                        return $t;
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
@@ -413,7 +413,7 @@ class Title {
                        array( 'page_namespace','page_title' ),
                        array( 'page_id' => $id ), 
                        __METHOD__ );
-               if ( $s === false ) { return NULL; }
+               if ( $s === false ) { return null; }
 
                $n = self::makeName( $s->page_namespace, $s->page_title );
                return $n;
@@ -1871,7 +1871,7 @@ class Title {
         * Loads a string into mRestrictions array
         * @param $res \type{Resource} restrictions as an SQL result.
         */
-       private function loadRestrictionsFromResultWrapper( $res, $oldFashionedRestrictions = NULL ) {
+       private function loadRestrictionsFromResultWrapper( $res, $oldFashionedRestrictions = null ) {
                $rows = array();
                $dbr = wfGetDB( DB_SLAVE );
                
@@ -1882,7 +1882,7 @@ class Title {
                $this->loadRestrictionsFromRows( $rows, $oldFashionedRestrictions );
        }
        
-       public function loadRestrictionsFromRows( $rows, $oldFashionedRestrictions = NULL ) {
+       public function loadRestrictionsFromRows( $rows, $oldFashionedRestrictions = null ) {
                $dbr = wfGetDB( DB_SLAVE );
                
                $restrictionTypes = $this->getRestrictionTypes();
@@ -1896,7 +1896,7 @@ class Title {
 
                # Backwards-compatibility: also load the restrictions from the page record (old format).
 
-               if ( $oldFashionedRestrictions === NULL ) {
+               if ( $oldFashionedRestrictions === null ) {
                        $oldFashionedRestrictions = $dbr->selectField( 'page', 'page_restrictions', 
                                array( 'page_id' => $this->getArticleId() ), __METHOD__ );
                }
@@ -1958,7 +1958,7 @@ class Title {
        /**
         * Load restrictions from the page_restrictions table
         */
-       public function loadRestrictions( $oldFashionedRestrictions = NULL ) {
+       public function loadRestrictions( $oldFashionedRestrictions = null ) {
                if( !$this->mRestrictionsLoaded ) {
                        if ($this->exists()) {
                                $dbr = wfGetDB( DB_SLAVE );
@@ -3353,14 +3353,14 @@ class Title {
        public function getFirstRevision( $flags=0 ) {
                $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
                $pageId = $this->getArticleId($flags);
-               if( !$pageId ) return NULL;
+               if( !$pageId ) return null;
                $row = $db->selectRow( 'revision', '*',
                        array( 'rev_page' => $pageId ),
                        __METHOD__,
                        array( 'ORDER BY' => 'rev_timestamp ASC', 'LIMIT' => 1 )
                );
                if( !$row ) {
-                       return NULL;
+                       return null;
                } else {
                        return new Revision( $row );
                }
@@ -3539,7 +3539,7 @@ class Title {
         * @param Database $db, optional db
         * @return \type{\string} Last touched timestamp
         */
-       public function getTouched( $db = NULL ) {
+       public function getTouched( $db = null ) {
                $db = isset($db) ? $db : wfGetDB( DB_SLAVE );
                $touched = $db->selectField( 'page', 'page_touched', $this->pageCond(), __METHOD__ );
                return $touched;
@@ -3550,7 +3550,7 @@ class Title {
         * @param User $user
         * @return mixed string/NULL
         */
-       public function getNotificationTimestamp( $user = NULL ) {
+       public function getNotificationTimestamp( $user = null ) {
                global $wgUser, $wgShowUpdatedMarker;
                // Assume current user if none given
                if( !$user ) $user = $wgUser;
index 84b4dc2..ffe5433 100644 (file)
@@ -2327,7 +2327,7 @@ class User {
                        $dbw = wfGetDB( DB_MASTER );
                        $dbw->update( 'watchlist',
                                        array( /* SET */
-                                               'wl_notificationtimestamp' => NULL
+                                               'wl_notificationtimestamp' => null
                                        ), array( /* WHERE */
                                                'wl_title' => $title->getDBkey(),
                                                'wl_namespace' => $title->getNamespace(),
@@ -2354,7 +2354,7 @@ class User {
                        $dbw = wfGetDB( DB_MASTER );
                        $dbw->update( 'watchlist',
                                array( /* SET */
-                                       'wl_notificationtimestamp' => NULL
+                                       'wl_notificationtimestamp' => null
                                ), array( /* WHERE */
                                        'wl_user' => $currentUser
                                ), __METHOD__
index a2c1f03..d1c1529 100644 (file)
@@ -62,7 +62,7 @@ class WatchedItem {
                        'wl_user' => $this->id,
                        'wl_namespace' => MWNamespace::getSubject($this->ns),
                        'wl_title' => $this->ti,
-                       'wl_notificationtimestamp' => NULL
+                       'wl_notificationtimestamp' => null
                  ), __METHOD__, 'IGNORE' );
 
                // Every single watched page needs now to be listed in watchlist;
@@ -72,7 +72,7 @@ class WatchedItem {
                        'wl_user' => $this->id,
                        'wl_namespace' => MWNamespace::getTalk($this->ns),
                        'wl_title' => $this->ti,
-                       'wl_notificationtimestamp' => NULL
+                       'wl_notificationtimestamp' => null
                  ), __METHOD__, 'IGNORE' );
 
                wfProfileOut( __METHOD__ );
index 22057d4..28472e6 100644 (file)
@@ -248,7 +248,7 @@ class WebRequest {
         * @param $default string: optional default (or NULL)
         * @return string
         */
-       public function getVal( $name, $default = NULL ) {
+       public function getVal( $name, $default = null ) {
                $val = $this->getGPCVal( $this->data, $name, $default );
                if( is_array( $val ) ) {
                        $val = $default;
@@ -281,7 +281,7 @@ class WebRequest {
         * @param $default array: optional default (or NULL)
         * @return array
         */
-       public function getArray( $name, $default = NULL ) {
+       public function getArray( $name, $default = null ) {
                $val = $this->getGPCVal( $this->data, $name, $default );
                if( is_null( $val ) ) {
                        return null;
@@ -300,7 +300,7 @@ class WebRequest {
         * @param $default array: option default (or NULL)
         * @return array of ints
         */
-       public function getIntArray( $name, $default = NULL ) {
+       public function getIntArray( $name, $default = null ) {
                $val = $this->getArray( $name, $default );
                if( is_array( $val ) ) {
                        $val = array_map( 'intval', $val );
@@ -356,7 +356,7 @@ class WebRequest {
        public function getCheck( $name ) {
                # Checkboxes and buttons are only present when clicked
                # Presence connotes truth, abscense false
-               $val = $this->getVal( $name, NULL );
+               $val = $this->getVal( $name, null );
                return isset( $val );
        }
 
@@ -559,7 +559,7 @@ class WebRequest {
         */
        public function getFileTempname( $key ) {
                if( !isset( $_FILES[$key] ) ) {
-                       return NULL;
+                       return null;
                }
                return $_FILES[$key]['tmp_name'];
        }
@@ -601,7 +601,7 @@ class WebRequest {
         */
        public function getFileName( $key ) {
                if( !isset( $_FILES[$key] ) ) {
-                       return NULL;
+                       return null;
                }
                $name = $_FILES[$key]['name'];
 
index 631cd03..0a6c263 100644 (file)
@@ -109,7 +109,7 @@ class MediaWiki {
                if( $wgRequest->getVal( 'printable' ) === 'yes' ) {
                        $wgOut->setPrintable();
                }
-               $ret = NULL;
+               $ret = null;
                if( $curid = $wgRequest->getInt( 'curid' ) ) {
                        # URLs like this are generated by RC, because rc_title isn't always accurate
                        $ret = Title::newFromID( $curid );
index 267df2a..ebfaf3e 100644 (file)
@@ -70,7 +70,7 @@ class ApiDelete extends ApiBase {
                if(!$titleObj->exists())
                        $this->dieUsageMsg(array('notanarticle'));
 
-               $reason = (isset($params['reason']) ? $params['reason'] : NULL);
+               $reason = (isset($params['reason']) ? $params['reason'] : null);
                if ($titleObj->getNamespace() == NS_FILE) {
                        $retval = self::deleteFile($params['token'], $titleObj, $params['oldimage'], $reason, false);
                        if(count($retval))
@@ -115,7 +115,7 @@ class ApiDelete extends ApiBase {
         * @param string $reason - Reason for the deletion. Autogenerated if NULL
         * @return Title::getUserPermissionsErrors()-like array
         */
-       public static function delete(&$article, $token, &$reason = NULL)
+       public static function delete(&$article, $token, &$reason = null)
        {
                global $wgUser;
                if($article->isBigDeletion() && !$wgUser->isAllowed('bigdelete')) {
@@ -149,7 +149,7 @@ class ApiDelete extends ApiBase {
                return array(array('cannotdelete', $article->mTitle->getPrefixedText()));
        }
 
-       public static function deleteFile($token, &$title, $oldimage, &$reason = NULL, $suppress = false)
+       public static function deleteFile($token, &$title, $oldimage, &$reason = null, $suppress = false)
        {
                $errors = self::getPermissionsError($title, $token);
                if (count($errors)) return $errors;
index f16b2c8..e339534 100644 (file)
@@ -114,7 +114,7 @@ class Spyc {
                if (is_array($value)) {
                        // It has children.  What to do?
                        // Make it the right kind of item
-                       $string = $this->_dumpNode($key,NULL,$indent);
+                       $string = $this->_dumpNode($key,null,$indent);
                        // Add the indent
                        $indent += $this->_dumpIndent;
                        // Yamlize the array
index 0f0ecfe..bfc35d6 100644 (file)
@@ -40,7 +40,7 @@ class ApiProtect extends ApiBase {
                global $wgUser, $wgRestrictionTypes, $wgRestrictionLevels;
                $params = $this->extractRequestParams();
 
-               $titleObj = NULL;
+               $titleObj = null;
                if(!isset($params['title']))
                        $this->dieUsageMsg(array('missingparam', 'title'));
                if(!isset($params['token']))
index 7381679..bde712b 100644 (file)
@@ -540,7 +540,7 @@ class ApiQueryInfo extends ApiQueryBase {
        public function getAllowedParams() {
                return array (
                        'prop' => array (
-                               ApiBase :: PARAM_DFLT => NULL,
+                               ApiBase :: PARAM_DFLT => null,
                                ApiBase :: PARAM_ISMULTI => true,
                                ApiBase :: PARAM_TYPE => array (
                                        'protection',
@@ -551,7 +551,7 @@ class ApiQueryInfo extends ApiQueryBase {
                                        'readable',
                                )),
                        'token' => array (
-                               ApiBase :: PARAM_DFLT => NULL,
+                               ApiBase :: PARAM_DFLT => null,
                                ApiBase :: PARAM_ISMULTI => true,
                                ApiBase :: PARAM_TYPE => array_keys($this->getTokenFunctions())
                        ),
index a3b8a98..143ec39 100644 (file)
@@ -144,7 +144,7 @@ class ApiQueryUserInfo extends ApiQueryBase {
        public function getAllowedParams() {
                return array (
                        'prop' => array (
-                               ApiBase :: PARAM_DFLT => NULL,
+                               ApiBase :: PARAM_DFLT => null,
                                ApiBase :: PARAM_ISMULTI => true,
                                ApiBase :: PARAM_TYPE => array (
                                        'blockinfo',
index 7bc8cdb..d697d87 100644 (file)
@@ -210,7 +210,7 @@ if (!defined('MEDIAWIKI')) {
        public function getAllowedParams() {
                return array (
                        'prop' => array (
-                               ApiBase :: PARAM_DFLT => NULL,
+                               ApiBase :: PARAM_DFLT => null,
                                ApiBase :: PARAM_ISMULTI => true,
                                ApiBase :: PARAM_TYPE => array (
                                        'blockinfo',
index b826c56..8ef63ae 100644 (file)
@@ -39,7 +39,7 @@ class ApiRollback extends ApiBase {
        public function execute() {
                $params = $this->extractRequestParams();
 
-               $titleObj = NULL;
+               $titleObj = null;
                if(!isset($params['title']))
                        $this->dieUsageMsg(array('missingparam', 'title'));
                if(!isset($params['user']))
index 9a1e927..6c831f3 100644 (file)
@@ -40,7 +40,7 @@ class ApiUndelete extends ApiBase {
                global $wgUser;
                $params = $this->extractRequestParams();
 
-               $titleObj = NULL;
+               $titleObj = null;
                if(!isset($params['title']))
                        $this->dieUsageMsg(array('missingparam', 'title'));
                if(!isset($params['token']))
index a5f85c0..179fba5 100644 (file)
@@ -50,7 +50,7 @@ abstract class DatabaseBase {
         * Fail function, takes a Database as a parameter
         * Set to false for default, 1 for ignore errors
         */
-       function failFunction( $function = NULL ) {
+       function failFunction( $function = null ) {
                return wfSetVar( $this->mFailFunction, $function );
        }
 
@@ -65,7 +65,7 @@ abstract class DatabaseBase {
        /**
         * Boolean, controls output of large amounts of debug information
         */
-       function debug( $debug = NULL ) {
+       function debug( $debug = null ) {
                return wfSetBit( $this->mFlags, DBO_DEBUG, $debug );
        }
 
@@ -73,7 +73,7 @@ abstract class DatabaseBase {
         * Turns buffering of SQL result sets on (true) or off (false).
         * Default is "on" and it should not be changed without good reasons.
         */
-       function bufferResults( $buffer = NULL ) {
+       function bufferResults( $buffer = null ) {
                if ( is_null( $buffer ) ) {
                        return !(bool)( $this->mFlags & DBO_NOBUFFER );
                } else {
@@ -88,7 +88,7 @@ abstract class DatabaseBase {
         * code should use lastErrno() and lastError() to handle the
         * situation as appropriate.
         */
-       function ignoreErrors( $ignoreErrors = NULL ) {
+       function ignoreErrors( $ignoreErrors = null ) {
                return wfSetBit( $this->mFlags, DBO_IGNORE, $ignoreErrors );
        }
 
@@ -96,14 +96,14 @@ abstract class DatabaseBase {
         * The current depth of nested transactions
         * @param $level Integer: , default NULL.
         */
-       function trxLevel( $level = NULL ) {
+       function trxLevel( $level = null ) {
                return wfSetVar( $this->mTrxLevel, $level );
        }
 
        /**
         * Number of errors logged, only useful when errors are ignored
         */
-       function errorCount( $count = NULL ) {
+       function errorCount( $count = null ) {
                return wfSetVar( $this->mErrorCount, $count );
        }
 
@@ -114,19 +114,19 @@ abstract class DatabaseBase {
        /**
         * Properties passed down from the server info array of the load balancer
         */
-       function getLBInfo( $name = NULL ) {
+       function getLBInfo( $name = null ) {
                if ( is_null( $name ) ) {
                        return $this->mLBInfo;
                } else {
                        if ( array_key_exists( $name, $this->mLBInfo ) ) {
                                return $this->mLBInfo[$name];
                        } else {
-                               return NULL;
+                               return null;
                        }
                }
        }
 
-       function setLBInfo( $name, $value = NULL ) {
+       function setLBInfo( $name, $value = null ) {
                if ( is_null( $value ) ) {
                        $this->mLBInfo = $name;
                } else {
@@ -304,7 +304,7 @@ abstract class DatabaseBase {
                global $wgOut, $wgDBprefix, $wgCommandLineMode;
                # Can't get a reference if it hasn't been set yet
                if ( !isset( $wgOut ) ) {
-                       $wgOut = NULL;
+                       $wgOut = null;
                }
 
                $this->mFailFunction = $failFunction;
@@ -1018,7 +1018,7 @@ abstract class DatabaseBase {
                $table = $this->tableName( $table );
                $res = $this->query( 'DESCRIBE '.$table, $fname );
                if ( !$res ) {
-                       return NULL;
+                       return null;
                }
 
                $found = false;
@@ -1040,7 +1040,7 @@ abstract class DatabaseBase {
        function indexExists( $table, $index, $fname = 'Database::indexExists' ) {
                $info = $this->indexInfo( $table, $index, $fname );
                if ( is_null( $info ) ) {
-                       return NULL;
+                       return null;
                } else {
                        return $info !== false;
                }
@@ -1060,7 +1060,7 @@ abstract class DatabaseBase {
                $sql = 'SHOW INDEX FROM '.$table;
                $res = $this->query( $sql, $fname );
                if ( !$res ) {
-                       return NULL;
+                       return null;
                }
 
                $result = array();
@@ -1115,7 +1115,7 @@ abstract class DatabaseBase {
        function indexUnique( $table, $index ) {
                $indexInfo = $this->indexInfo( $table, $index );
                if ( !$indexInfo ) {
-                       return NULL;
+                       return null;
                }
                return !$indexInfo[0]->Non_unique;
        }
@@ -1549,7 +1549,7 @@ abstract class DatabaseBase {
         * subclass will return an integer, and save the value for insertId()
         */
        function nextSequenceValue( $seqName ) {
-               return NULL;
+               return null;
        }
 
        /**
index 15d0b68..cc95b17 100644 (file)
@@ -123,19 +123,19 @@ class DatabaseIbm_db2 extends DatabaseBase {
         */
        
        /// Server port for uncataloged connections
-       protected $mPort = NULL;
+       protected $mPort = null;
        /// Whether connection is cataloged
-       protected $mCataloged = NULL;
+       protected $mCataloged = null;
        /// Schema for tables, stored procedures, triggers
-       protected $mSchema = NULL;
+       protected $mSchema = null;
        /// Whether the schema has been applied in this session
        protected $mSchemaSet = false;
        /// Result of last query
-       protected $mLastResult = NULL;
+       protected $mLastResult = null;
        /// Number of rows affected by last INSERT/UPDATE/DELETE
-       protected $mAffectedRows = NULL;
+       protected $mAffectedRows = null;
        /// Number of rows returned by last SELECT
-       protected $mNumRows = NULL;
+       protected $mNumRows = null;
        
        /// Connection config options - see constructor
        public $mConnOptions = array();
@@ -158,7 +158,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
        protected $mMode = self::REGULAR_MODE;
        
        /// Last sequence value used for a primary key
-       protected $mInsertId = NULL;
+       protected $mInsertId = null;
        
        /*
         * These can be safely inherited
@@ -415,7 +415,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
                global $wgOut, $wgDBmwschema;
                # Can't get a reference if it hasn't been set yet
                if ( !isset( $wgOut ) ) {
-                       $wgOut = NULL;
+                       $wgOut = null;
                }
                $this->mOut =& $wgOut;
                $this->mFailFunction = $failFunction;
@@ -646,7 +646,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
                        throw new DBUnexpectedError($this,  'SQL error: ' . htmlspecialchars( $error ) );
                }
                $this->mLastResult = $ret;
-               $this->mAffectedRows = NULL;    // Not calculated until asked for
+               $this->mAffectedRows = null;    // Not calculated until asked for
                return $ret;
        }
        
@@ -1004,7 +1004,7 @@ EOF;
                $this->freeResult( $res );
                return $this->mInsertId;
                */
-               return NULL;
+               return null;
        }
        
        /**
@@ -1162,7 +1162,7 @@ EOF;
                // remove primary keys
                foreach ($args as $ai => $row) {
                        foreach ($keys as $ki => $key) {
-                               if ($row[$key] == NULL) {
+                               if ($row[$key] == null) {
                                        unset($row[$key]);
                                }
                        }
@@ -1476,7 +1476,7 @@ EOF;
                // db2_ping() doesn't exist
                // Emulate
                $this->close();
-               if ($this->mCataloged == NULL) {
+               if ($this->mCataloged == null) {
                        return false;
                }
                else if ($this->mCataloged) {
@@ -1569,10 +1569,10 @@ WHERE si.name='$index' AND si.tbname='$table' AND sc.tbcreator='$this->mSchema'
 SQL;
                $res = $this->query( $sql, $fname );
                if ( !$res ) {
-                       return NULL;
+                       return null;
                }
                $row = $this->fetchObject( $res );
-               if ($row != NULL) return $row;
+               if ($row != null) return $row;
                else return false;
        }
        
index 923ffe4..c5ff676 100644 (file)
@@ -25,7 +25,7 @@ class DatabaseMssql extends DatabaseBase {
                        $failFunction = false, $flags = 0, $tablePrefix = 'get from global') {
 
                global $wgOut, $wgDBprefix, $wgCommandLineMode;
-               if (!isset($wgOut)) $wgOut = NULL; # Can't get a reference if it hasn't been set yet
+               if (!isset($wgOut)) $wgOut = null; # Can't get a reference if it hasn't been set yet
                $this->mOut =& $wgOut;
                $this->mFailFunction = $failFunction;
                $this->mFlags = $flags;
@@ -474,13 +474,13 @@ class DatabaseMssql extends DatabaseBase {
        function indexInfo( $table, $index, $fname = 'Database::indexInfo' ) {
 
                throw new DBUnexpectedError( $this, 'Database::indexInfo called which is not supported yet' );
-               return NULL;
+               return null;
 
                $table = $this->tableName( $table );
                $sql = 'SHOW INDEX FROM '.$table;
                $res = $this->query( $sql, $fname );
                if ( !$res ) {
-                       return NULL;
+                       return null;
                }
 
                $result = array();
index d864570..e1424b6 100644 (file)
@@ -69,10 +69,10 @@ SQL;
  * @ingroup Database
  */
 class DatabasePostgres extends DatabaseBase {
-       var $mInsertId = NULL;
-       var $mLastResult = NULL;
-       var $numeric_version = NULL;
-       var $mAffectedRows = NULL;
+       var $mInsertId = null;
+       var $mLastResult = null;
+       var $numeric_version = null;
+       var $mAffectedRows = null;
 
        function DatabasePostgres($server = false, $user = false, $password = false, $dbName = false,
                $failFunction = false, $flags = 0 )
@@ -578,7 +578,7 @@ class DatabasePostgres extends DatabaseBase {
                        $sql = mb_convert_encoding($sql,'UTF-8');
                }
                $this->mLastResult = pg_query( $this->mConn, $sql);
-               $this->mAffectedRows = NULL; // use pg_affected_rows(mLastResult)
+               $this->mAffectedRows = null; // use pg_affected_rows(mLastResult)
                return $this->mLastResult;
        }
 
@@ -713,7 +713,7 @@ class DatabasePostgres extends DatabaseBase {
                $sql = "SELECT indexname FROM pg_indexes WHERE tablename='$table'";
                $res = $this->query( $sql, $fname );
                if ( !$res ) {
-                       return NULL;
+                       return null;
                }
                while ( $row = $this->fetchObject( $res ) ) {
                        if ( $row->indexname == $this->indexName( $index ) ) {
@@ -730,7 +730,7 @@ class DatabasePostgres extends DatabaseBase {
                        ")'";
                $res = $this->query( $sql, $fname );
                if ( !$res )
-                       return NULL;
+                       return null;
                while ($row = $this->fetchObject( $res ))
                        return true;
                return false;
@@ -1192,7 +1192,7 @@ SQL;
                                $this->addQuotes($table),
                                $this->addQuotes($trigger)));
                if (!$res)
-                       return NULL;
+                       return null;
                $rows = $res->numRows();
                $this->freeResult( $res );
                return $rows;
@@ -1216,7 +1216,7 @@ SQL;
                        $this->addQuotes($constraint));
                $res = $this->query($SQL);
                if (!$res)
-                       return NULL;
+                       return null;
                $rows = $res->numRows();
                $this->freeResult($res);
                return $rows;
index 745bc71..d4a2a50 100644 (file)
@@ -126,9 +126,9 @@ class DatabaseSqlite extends DatabaseBase {
 
        function freeResult( $res ) {
                if ( $res instanceof ResultWrapper )
-                       $res->result = NULL;
+                       $res->result = null;
                else
-                       $res = NULL;
+                       $res = null;
        }
 
        function fetchObject($res) {
index 0b8ef05..48065f8 100644 (file)
@@ -831,7 +831,7 @@ class LoadBalancer {
                }
        }
 
-       function waitTimeout( $value = NULL ) {
+       function waitTimeout( $value = null ) {
                return wfSetVar( $this->mWaitTimeout, $value );
        }
 
index 4e9d554..7905088 100644 (file)
@@ -45,7 +45,7 @@ class ArchivedFile
                $this->description = '';
                $this->user = 0;
                $this->user_text = '';
-               $this->timestamp = NULL;
+               $this->timestamp = null;
                $this->deleted = 0;
                $this->dataLoaded = false;
                $this->exists = false;
index c020f7f..a6169e3 100644 (file)
@@ -1195,7 +1195,7 @@ abstract class File {
 
                        wfDebug(__METHOD__.": $path loaded, {$info['size']} bytes, {$info['mime']}.\n");
                } else {
-                       $info['mime'] = NULL;
+                       $info['mime'] = null;
                        $info['media_type'] = MEDIATYPE_UNKNOWN;
                        $info['metadata'] = '';
                        $info['sha1'] = '';
index bc94426..08ce219 100644 (file)
@@ -44,7 +44,7 @@ class Image extends LocalFile {
                        }
                        return $img;
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
index 23bf884..78e3bec 100644 (file)
@@ -136,14 +136,14 @@ class Services_JSON
                $this->use = $use;
        }
        
-       private static $mHavePear = NULL;
+       private static $mHavePear = null;
        /**
         * Returns cached result of class_exists('pear'), to avoid calling AutoLoader numerous times
         * in cases when PEAR is not present.
         * @return boolean
         */
        private static function pearInstalled() {
-               if ( self::$mHavePear === NULL ) {
+               if ( self::$mHavePear === null ) {
                        self::$mHavePear = class_exists( 'pear' );
                }
                return self::$mHavePear;
index 94d4c14..d63a4b8 100644 (file)
@@ -1066,10 +1066,10 @@ class MWMemcached
                if (!is_resource($f)) {
                        return;
                }
-               $n = stream_select($r=array($f), $w = NULL, $e = NULL, 0, 0);
+               $n = stream_select($r=array($f), $w = null, $e = null, 0, 0);
                while ($n == 1 && !feof($f)) {
                        fread($f, 1024);
-                       $n = stream_select($r=array($f), $w = NULL, $e = NULL, 0, 0);
+                       $n = stream_select($r=array($f), $w = null, $e = null, 0, 0);
                }
        }
 
index 353d11b..4c78b3d 100644 (file)
@@ -81,7 +81,7 @@ $longTests = array(
 # These tests are not in proper subsections
 $sectionTests = array( '3.4' );
 
-$section = NULL;
+$section = null;
 $test = '';
 $failed = 0;
 $success = 0;
index 4f8b129..e1352fd 100644 (file)
 require_once dirname(__FILE__).'/UtfNormalUtil.php';
 
 global $utfCombiningClass, $utfCanonicalComp, $utfCanonicalDecomp;
-$utfCombiningClass = NULL;
-$utfCanonicalComp = NULL;
-$utfCanonicalDecomp = NULL;
+$utfCombiningClass = null;
+$utfCanonicalComp = null;
+$utfCanonicalDecomp = null;
 
 # Load compatibility decompositions on demand if they are needed.
 global $utfCompatibilityDecomp;
-$utfCompatibilityDecomp = NULL;
+$utfCompatibilityDecomp = null;
 
 /**
  * For using the ICU wrapper
index 34f8bff..30a80b4 100644 (file)
@@ -1628,7 +1628,7 @@ class Parser
                        wfProfileOut( __METHOD__."-misc" );
                        wfProfileIn( __METHOD__."-title" );
                        $nt = Title::newFromText( $this->mStripState->unstripNoWiki( $link ) );
-                       if ( $nt === NULL ) {
+                       if ( $nt === null ) {
                                $s .= $prefix . '[[' . $line;
                                wfProfileOut( __METHOD__."-title" );
                                continue;
@@ -2758,7 +2758,7 @@ class Parser
                $isLocalObj = false;        # $text is a DOM node needing expansion in the current frame
 
                # Title object, where $text came from
-               $title = NULL;
+               $title = null;
 
                # $part1 is the bit before the first |, and must contain only title characters.
                # Various prefixes will be stripped from it later.
@@ -4730,9 +4730,9 @@ class Parser
        /**#@+
         * Accessor/mutator
         */
-       function Title( $x = NULL ) { return wfSetVar( $this->mTitle, $x ); }
-       function Options( $x = NULL ) { return wfSetVar( $this->mOptions, $x ); }
-       function OutputType( $x = NULL ) { return wfSetVar( $this->mOutputType, $x ); }
+       function Title( $x = null ) { return wfSetVar( $this->mTitle, $x ); }
+       function Options( $x = null ) { return wfSetVar( $this->mOptions, $x ); }
+       function OutputType( $x = null ) { return wfSetVar( $this->mOutputType, $x ); }
        /**#@-*/
 
        /**#@+
index dcc6934..952e9b2 100644 (file)
@@ -76,7 +76,7 @@ class SearchEngine {
                        # Exact match? No need to look further.
                        $title = Title::newFromText( $term );
                        if (is_null($title))
-                               return NULL;
+                               return null;
 
                        if ( $title->getNamespace() == NS_SPECIAL || $title->isExternal() || $title->exists() ) {
                                return $title;
@@ -158,7 +158,7 @@ class SearchEngine {
                        return SearchEngine::getNearMatch( $matches[1] );
                }
 
-               return NULL;
+               return null;
        }
 
        public static function legalSearchChars() {
index 0f11d44..b1cf6a6 100644 (file)
@@ -29,7 +29,7 @@ class SearchSqlite extends SearchEngine {
        var $strictMatching = true;
 
        // Cached because SearchUpdate keeps recreating our class
-       private static $fulltextSupported = NULL;
+       private static $fulltextSupported = null;
 
        /**
         * Creates an instance of this class
@@ -44,7 +44,7 @@ class SearchSqlite extends SearchEngine {
         * @return Boolean
         */
        function fulltextSearchSupported() {
-               if ( self::$fulltextSupported === NULL ) {
+               if ( self::$fulltextSupported === null ) {
                        $res = $this->db->selectField( 'updatelog', 'ul_key', array( 'ul_key' => 'fts3' ), __METHOD__ );
                        self::$fulltextSupported = $res && $this->db->numRows( $res ) > 0;
                }
index 89f5d34..a36cdca 100644 (file)
@@ -450,7 +450,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                if ( $t && $t->isLocal() ) {
                        return array( $t->getNamespace(), $t->getDBkey(), $t->getText() );
                } else if ( $t ) {
-                       return NULL;
+                       return null;
                }
 
                # try again, in case the problem was an empty pagename
@@ -459,7 +459,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                if ( $t && $t->isLocal() ) {
                        return array( $t->getNamespace(), '', '' );
                } else {
-                       return NULL;
+                       return null;
                }
        }
 }
index fae8281..ce3c9c9 100644 (file)
@@ -400,7 +400,7 @@ class SpecialContributions extends SpecialPage {
                                $comments
                        );
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
index d0423f2..6469640 100644 (file)
@@ -51,7 +51,7 @@ class SpecialExport extends SpecialPage {
                        $page = $wgRequest->getText( 'pages' );
                        $catname = $wgRequest->getText( 'catname' );
                        
-                       if ( $catname !== '' && $catname !== NULL && $catname !== false ) {
+                       if ( $catname !== '' && $catname !== null && $catname !== false ) {
                                $t = Title::makeTitleSafe( NS_MAIN, $catname );
                                if ( $t ) {
                                        /**
index 17066ca..15e155b 100644 (file)
@@ -546,7 +546,7 @@ class MovePageForm {
        }
 
        function showLogFragment( $title, &$out ) {
-               $out->addHTML( Xml::element( 'h2', NULL, LogPage::logName( 'move' ) ) );
+               $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'move' ) ) );
                LogEventsList::showLogExtract( $out, 'move', $title->getPrefixedText() );
        }
 
index 49938db..903ddab 100644 (file)
@@ -357,7 +357,7 @@ class SpecialNewpages extends SpecialPage {
                                $this->feedItemAuthor( $row ),
                                $comments);
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
index 7fb0f0b..a58c95d 100644 (file)
@@ -168,7 +168,7 @@ class SpecialSearch {
                        # mirror Go/Search behaviour of original request ..
                        $didYouMeanParams = array( 'search' => $textMatches->getSuggestionQuery() );
 
-                       if($this->fulltext != NULL)
+                       if($this->fulltext != null)
                                $didYouMeanParams['fulltext'] = $this->fulltext;
 
                        $stParams = array_merge(
index 916f092..443b845 100644 (file)
@@ -285,7 +285,7 @@ class PageArchive {
                if( $row ) {
                        return $this->getTextFromRow( $row );
                } else {
-                       return NULL;
+                       return null;
                }
        }
 
@@ -590,7 +590,7 @@ class UndeleteForm {
                if ( $this->mTarget !== "" ) {
                        $this->mTargetObj = Title::newFromURL( $this->mTarget );
                } else {
-                       $this->mTargetObj = NULL;
+                       $this->mTargetObj = null;
                }
                if( $this->mRestore || $this->mInvert ) {
                        $timestamps = array();
index 251231b..d16c6c6 100644 (file)
@@ -129,7 +129,7 @@ class LoginForm {
 
                $u = $this->addNewaccountInternal();
 
-               if ($u == NULL) {
+               if ($u == null) {
                        return;
                }
 
@@ -163,7 +163,7 @@ class LoginForm {
 
                # Create the account and abort if there's a problem doing so
                $u = $this->addNewAccountInternal();
-               if( $u == NULL )
+               if( $u == null )
                        return;
 
                # If we showed up language selection links, and one was in use, be
index 2bb8947..6aace66 100644 (file)
@@ -589,7 +589,7 @@ abstract class UploadBase {
 
                $match = $magic->isMatchingExtension( $extension, $mime );
 
-               if ( $match === NULL ) {
+               if ( $match === null ) {
                        wfDebug( __METHOD__ . ": no file extension known for mime type $mime, passing file\n" );
                        return true;
                } elseif( $match === true ) {
@@ -639,7 +639,7 @@ abstract class UploadBase {
                elseif( substr( $chunk, 0, 2 ) == "\xff\xfe" )
                        $enc = "UTF-16LE";
                else
-                       $enc = NULL;
+                       $enc = null;
 
                if( $enc )
                        $chunk = iconv( $enc, "ASCII//IGNORE", $chunk );
@@ -762,7 +762,7 @@ abstract class UploadBase {
 
                if ( !$wgAntivirus ) {
                        wfDebug( __METHOD__ . ": virus scanner disabled\n" );
-                       return NULL;
+                       return null;
                }
 
                if ( !$wgAntivirusSetup[$wgAntivirus] ) {
@@ -817,12 +817,12 @@ abstract class UploadBase {
                        if ( $wgAntivirusRequired ) {
                                return wfMsg( 'virus-scanfailed', array( $exitCode ) );
                        } else {
-                               return NULL;
+                               return null;
                        }
                } else if ( $mappedCode === AV_SCAN_ABORTED ) {
                        # scan failed because filetype is unknown (probably imune)
                        wfDebug( __METHOD__ . ": unsupported file type $file (code $exitCode).\n" );
-                       return NULL;
+                       return null;
                } else if ( $mappedCode === AV_NO_VIRUS ) {
                        # no virus found
                        wfDebug( __METHOD__ . ": file passed virus scan.\n" );
index 1cbba1e..ecaf210 100644 (file)
--- a/index.php
+++ b/index.php
@@ -59,7 +59,7 @@ $title = $wgRequest->getVal( 'title' );
 
 # Set title from request parameters
 $wgTitle = $mediaWiki->checkInitialQueries( $title, $action );
-if( $wgTitle === NULL ) {
+if( $wgTitle === null ) {
        unset( $wgTitle );
 }
 
index 0d1579c..9356248 100644 (file)
@@ -14,7 +14,7 @@ plan( 9 );
 
 $db = new DatabaseMysql( $wgDBserver, $wgDBuser, $wgDBpassword );
 
-cmp_ok( $db->addQuotes( NULL ), '==',
+cmp_ok( $db->addQuotes( null ), '==',
        'NULL', 'Add quotes to NULL' );
 
 cmp_ok( $db->addQuotes( 1234 ), '==',
index db46ad6..2369277 100644 (file)
@@ -10,7 +10,7 @@ class DatabaseTest extends PHPUnit_Framework_TestCase {
        function testAddQuotesNull() {
                $this->assertEquals(
                        'NULL',
-                       $this->db->addQuotes( NULL ) );
+                       $this->db->addQuotes( null ) );
        }
 
        function testAddQuotesInt() {