the store type from $wgObjectCaches. The default is the local database.
* Interface message overrides in the MediaWiki namespace will now be cached in
memcached and APC (if available), rather than memcached and local files.
+* $wgTransactionalTimeLimit was added, which controls the request time limit
+ for potentially slow POST requests that need to be as atomic as possible.
==== External libraries ====
* Update es5-shim from v4.0.0 to v4.1.5.
*/
$wgMemoryLimit = "50M";
+/**
+ * The minimum amount of time that MediaWiki needs for "slow" write request,
+ * particularly ones with multiple non-atomic writes that *should* be as
+ * transactional as possible; MediaWiki will call set_time_limit() if needed.
+ * @since 1.26
+ */
+$wgTransactionalTimeLimit = 120;
+
/** @} */ # end performance hacks }
/************************************************************************//**
}
/**
- * Set PHP's memory limit to the larger of php.ini or $wgMemoryLimit;
+ * Set PHP's memory limit to the larger of php.ini or $wgMemoryLimit
*
- * @return int Value the memory limit was set to.
+ * @return int Prior memory limit
*/
function wfMemoryLimit() {
global $wgMemoryLimit;
return $memlimit;
}
+/**
+ * Set PHP's time limit to the larger of php.ini or $wgTransactionalTimeLimit
+ *
+ * @return int Prior time limit
+ * @since 1.26
+ */
+function wfTransactionalTimeLimit() {
+ global $wgTransactionalTimeLimit;
+
+ $timeLimit = ini_get( 'max_execution_time' );
+ // Note that CLI scripts use 0
+ if ( $timeLimit > 0 && $wgTransactionalTimeLimit > $timeLimit ) {
+ set_time_limit( $wgTransactionalTimeLimit );
+ }
+
+ ignore_user_abort( true ); // ignore client disconnects
+
+ return $timeLimit;
+}
+
/**
* Converts shorthand byte notation to integer form
*
* @throws ErrorPageError
*/
abstract public function show();
+
+ /**
+ * Call wfTransactionalTimeLimit() if this request was POSTed
+ * @since 1.26
+ */
+ protected function useTransactionalTimeLimit() {
+ if ( $this->getRequest()->wasPosted() ) {
+ wfTransactionalTimeLimit();
+ }
+ }
}
}
public function show() {
+ $this->useTransactionalTimeLimit();
+
$out = $this->getOutput();
if ( $this->getContext()->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
$out->addModuleStyles( array(
}
public function show() {
+ $this->useTransactionalTimeLimit();
+
if ( $this->getContext()->getConfig()->get( 'UseMediaWikiUIEverywhere' ) ) {
$out = $this->getOutput();
$out->addModuleStyles( array(
}
public function onSubmit( $data ) {
+ $this->useTransactionalTimeLimit();
+
$source = $this->page->getFile()->getArchiveVirtualUrl(
$this->getRequest()->getText( 'oldimage' )
);
}
public function onView() {
+ // TODO: use $this->useTransactionalTimeLimit(); when POST only
+ wfTransactionalTimeLimit();
+
$details = null;
$request = $this->getRequest();
return $this->getResult()->getData();
}
+ /**
+ * Call wfTransactionalTimeLimit() if this request was POSTed
+ * @since 1.26
+ */
+ protected function useTransactionalTimeLimit() {
+ if ( $this->getRequest()->wasPosted() ) {
+ wfTransactionalTimeLimit();
+ }
+ }
+
/**@}*/
}
* result object.
*/
public function execute() {
+ $this->useTransactionalTimeLimit();
+
$params = $this->extractRequestParams();
$pageObj = $this->getTitleOrPageId( $params, 'fromdbmaster' );
*/
class ApiEditPage extends ApiBase {
public function execute() {
+ $this->useTransactionalTimeLimit();
+
$user = $this->getUser();
$params = $this->extractRequestParams();
protected $params;
public function execute() {
+ $this->useTransactionalTimeLimit();
+
$this->params = $this->extractRequestParams();
// Extract the file and archiveName from the request parameters
$this->validateParameters();
}
public function execute() {
+ $this->useTransactionalTimeLimit();
+
$params = $this->extractRequestParams();
$rotation = $params['rotation'];
class ApiImport extends ApiBase {
public function execute() {
+ $this->useTransactionalTimeLimit();
+
$user = $this->getUser();
$params = $this->extractRequestParams();
class ApiMove extends ApiBase {
public function execute() {
+ $this->useTransactionalTimeLimit();
+
$user = $this->getUser();
$params = $this->extractRequestParams();
class ApiRevisionDelete extends ApiBase {
public function execute() {
+ $this->useTransactionalTimeLimit();
+
$params = $this->extractRequestParams();
$user = $this->getUser();
private $mUser = null;
public function execute() {
+ $this->useTransactionalTimeLimit();
+
$user = $this->getUser();
$params = $this->extractRequestParams();
class ApiUndelete extends ApiBase {
public function execute() {
+ $this->useTransactionalTimeLimit();
+
$params = $this->extractRequestParams();
if ( !$this->getUser()->isAllowed( 'undelete' ) ) {
protected function getGroupName() {
return 'other';
}
+
+ /**
+ * Call wfTransactionalTimeLimit() if this request was POSTed
+ * @since 1.26
+ */
+ protected function useTransactionalTimeLimit() {
+ if ( $this->getRequest()->wasPosted() ) {
+ wfTransactionalTimeLimit();
+ }
+ }
}
* @throws ReadOnlyError
*/
function execute( $par ) {
+ $this->useTransactionalTimeLimit();
+
$this->setHeaders();
$this->outputHeader();
}
public function execute( $par ) {
+ $this->useTransactionalTimeLimit();
+
$this->checkPermissions();
$this->checkReadOnly();
}
public function execute( $par ) {
+ $this->useTransactionalTimeLimit();
+
$this->checkReadOnly();
$this->setHeaders();
}
public function execute( $par ) {
+ $this->useTransactionalTimeLimit();
+
$this->checkPermissions();
$this->checkReadOnly();
}
function execute( $par ) {
+ $this->useTransactionalTimeLimit();
+
$user = $this->getUser();
$this->setHeaders();
* @throws UserBlockedError
*/
public function execute( $par ) {
+ $this->useTransactionalTimeLimit();
+
$this->setHeaders();
$this->outputHeader();
* @return bool Success
*/
public function execute( $subPage ) {
+ $this->useTransactionalTimeLimit();
+
$this->stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash( $this->getUser() );
$this->checkPermissions();