Merge "Documentation: Remove paragraph about not creating a 2nd WebRequest"
[lhc/web/wiklou.git] / maintenance / patchSql.php
index 1f39355..1f77bdb 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Maintenance
  */
 
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
 
 /**
  * Maintenance script that manually runs an SQL patch outside of the general updaters.
@@ -33,7 +33,10 @@ class PatchSql extends Maintenance {
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Run an SQL file into the DB, replacing prefix and charset vars";
-               $this->addArg( 'patch-name', 'Name of the patch file, either full path or in maintenance/archives' );
+               $this->addArg(
+                       'patch-name',
+                       'Name of the patch file, either full path or in maintenance/archives'
+               );
        }
 
        public function getDbType() {
@@ -41,7 +44,7 @@ class PatchSql extends Maintenance {
        }
 
        public function execute() {
-               $dbw = wfGetDB( DB_MASTER );
+               $dbw = $this->getDB( DB_MASTER );
                foreach ( $this->mArgs as $arg ) {
                        $files = array(
                                $arg,
@@ -62,4 +65,4 @@ class PatchSql extends Maintenance {
 }
 
 $maintClass = "PatchSql";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;