MWHttpRequest: Include the request ID in outgoing HTTP requests
[lhc/web/wiklou.git] / maintenance / Maintenance.php
index c786ce8..f3c2e12 100644 (file)
@@ -23,7 +23,7 @@
 // Bail on old versions of PHP, or if composer has not been run yet to install
 // dependencies.
 require_once __DIR__ . '/../includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'cli' );
+wfEntryPointCheck( 'text' );
 
 use MediaWiki\Shell\Shell;
 
@@ -1326,7 +1326,6 @@ abstract class Maintenance {
                        $this->output( "done.\n" );
                }
 
-               # Done
                $this->commitTransaction( $dbw, __METHOD__ );
        }
 
@@ -1349,11 +1348,10 @@ abstract class Maintenance {
         * @return IMaintainableDatabase
         */
        protected function getDB( $db, $groups = [], $wiki = false ) {
-               if ( is_null( $this->mDb ) ) {
+               if ( $this->mDb === null ) {
                        return wfGetDB( $db, $groups, $wiki );
-               } else {
-                       return $this->mDb;
                }
+               return $this->mDb;
        }
 
        /**