* (bug 14526) Unescaped SQL in list=backlinks
* Added 'hidden' flag to list=allcategories and prop=categoryinfo output
* Added nocreate parameter to action=edit
+* (bug 14402) Added smaxage parameter to api.php
=== Languages updated in 1.13 ===
$this->mRequest = & $request;
- $this->mSquidMaxage = 0;
+ $this->mSquidMaxage = -1; // flag for executeActionWithErrorHandling()
$this->mCommit = false;
}
$this->printResult(true);
}
+ $params = $this->extractRequestParams();
+ if($this->mSquidMaxage == -1)
+ # Nobody called setCacheMaxAge(), use the smaxage parameter
+ $this->mSquidMaxage = $params['smaxage'];
+
// Set the cache expiration at the last moment, as any errors may change the expiration.
// if $this->mSquidMaxage == 0, the expiry time is set to the first second of unix epoch
$expires = $this->mSquidMaxage == 0 ? 1 : time() + $this->mSquidMaxage;
'maxlag' => array (
ApiBase :: PARAM_TYPE => 'integer'
),
+ 'smaxage' => array (
+ ApiBase :: PARAM_TYPE => 'integer',
+ ApiBase :: PARAM_DFLT => 0
+ ),
);
}
'format' => 'The format of the output',
'action' => 'What action you would like to perform',
'version' => 'When showing help, include version for each module',
- 'maxlag' => 'Maximum lag'
+ 'maxlag' => 'Maximum lag',
+ 'smaxage' => 'Cache the result for this many seconds. Errors are never cached',
);
}