Merge "Show a warning in edit preview when a template loop is detected"
[lhc/web/wiklou.git] / includes / AjaxDispatcher.php
index 9142238..75fcff3 100644 (file)
@@ -21,6 +21,8 @@
  * @ingroup Ajax
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * @defgroup Ajax Ajax
  */
@@ -54,6 +56,7 @@ class AjaxDispatcher {
 
        /**
         * Load up our object with user supplied data
+        * @param Config $config
         */
        function __construct( Config $config ) {
                $this->config = $config;
@@ -90,7 +93,6 @@ class AjaxDispatcher {
                                # Or we could throw an exception:
                                # throw new MWException( __METHOD__ . ' called without any data (mode empty).' );
                }
-
        }
 
        /**
@@ -136,7 +138,8 @@ class AjaxDispatcher {
                                        }
 
                                        // Make sure DB commit succeeds before sending a response
-                                       wfGetLBFactory()->commitMasterChanges( __METHOD__ );
+                                       $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+                                       $lbFactory->commitMasterChanges( __METHOD__ );
 
                                        $result->sendHeaders();
                                        $result->printText();
@@ -156,6 +159,5 @@ class AjaxDispatcher {
                                }
                        }
                }
-
        }
 }