* @ingroup Ajax
*/
+use MediaWiki\MediaWikiServices;
+
/**
* @defgroup Ajax Ajax
*/
/**
* Load up our object with user supplied data
+ * @param Config $config
*/
function __construct( Config $config ) {
$this->config = $config;
if ( !empty( $_GET["rsargs"] ) ) {
$this->args = $_GET["rsargs"];
} else {
- $this->args = array();
+ $this->args = [];
}
break;
case 'post':
if ( !empty( $_POST["rsargs"] ) ) {
$this->args = $_POST["rsargs"];
} else {
- $this->args = array();
+ $this->args = [];
}
break;
default:
# Or we could throw an exception:
# throw new MWException( __METHOD__ . ' called without any data (mode empty).' );
}
-
}
/**
$result = new AjaxResponse( $result );
}
+ // Make sure DB commit succeeds before sending a response
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+ $lbFactory->commitMasterChanges( __METHOD__ );
+
$result->sendHeaders();
$result->printText();
}
}
}
-
}
}