Merge "mw.widgets.DateInputWidget: Make placeholder label configurable"
[lhc/web/wiklou.git] / includes / deferred / DeferredUpdates.php
index adad908..5583588 100644 (file)
@@ -42,9 +42,6 @@ class DeferredUpdates {
        /** @var DeferrableUpdate[] Updates to be deferred until after request end */
        private static $postSendUpdates = array();
 
-       /** @var bool Defer updates fully even in CLI mode */
-       private static $forceDeferral = false;
-
        const ALL = 0; // all updates
        const PRESEND = 1; // for updates that should run before flushing output buffer
        const POSTSEND = 2; // for updates that should run after flushing output buffer
@@ -108,10 +105,6 @@ class DeferredUpdates {
                        $queue[] = $update;
                }
 
-               if ( self::$forceDeferral ) {
-                       return; // do not run
-               }
-
                // CLI scripts may forget to periodically flush these updates,
                // so try to handle that rather than OOMing and losing them entirely.
                // Try to run the updates as soon as there is no current wiki transaction.
@@ -156,7 +149,7 @@ class DeferredUpdates {
                        foreach ( $otherUpdates as $update ) {
                                try {
                                        $update->doUpdate();
-                                       wfGetLBFactory()->commitMasterChanges();
+                                       wfGetLBFactory()->commitMasterChanges( __METHOD__ );
                                } catch ( Exception $e ) {
                                        // We don't want exceptions thrown during deferred updates to
                                        // be reported to the user since the output is already sent
@@ -165,7 +158,7 @@ class DeferredUpdates {
                                        }
                                        // Make sure incomplete transactions are not committed and end any
                                        // open atomic sections so that other DB updates have a chance to run
-                                       wfGetLBFactory()->rollbackMasterChanges();
+                                       wfGetLBFactory()->rollbackMasterChanges( __METHOD__ );
                                }
                        }
 
@@ -181,13 +174,4 @@ class DeferredUpdates {
                self::$preSendUpdates = array();
                self::$postSendUpdates = array();
        }
-
-       /**
-        * @note This method is intended for testing purposes
-        * @param bool $value Whether to *always* defer updates, even in CLI mode
-        * @since 1.27
-        */
-       public static function forceDeferral( $value ) {
-               self::$forceDeferral = $value;
-       }
 }