X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FAjaxResponse.php;h=3e42c086507bd4becaecf49a20aa2a94a52b8637;hb=89b792dccbb1e4b83b2977f68f4d2b79baade626;hp=6c2782c0fab892fda18a8bf9eedc45dc122c3288;hpb=bee82be112de5180a255655958b151d11340182e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index 6c2782c0fa..3e42c08650 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -20,6 +20,7 @@ * @file * @ingroup Ajax */ +use MediaWiki\MediaWikiServices; /** * Handle responses for Ajax requests (send headers, print @@ -82,7 +83,7 @@ class AjaxResponse { function __construct( $text = null, Config $config = null ) { $this->mCacheDuration = null; $this->mVary = null; - $this->mConfig = $config ?: ConfigFactory::getDefaultInstance()->makeConfig( 'main' ); + $this->mConfig = $config ?: MediaWikiServices::getInstance()->getMainConfig(); $this->mDisabled = false; $this->mText = ''; @@ -161,7 +162,7 @@ class AjaxResponse { // For back-compat, it is supported that mResponseCode be a string like " 200 OK" // (with leading space and the status message after). Cast response code to an integer // to take advantage of PHP's conversion rules which will turn " 200 OK" into 200. - // http://php.net/string#language.types.string.conversion + // https://secure.php.net/manual/en/language.types.string.php#language.types.string.conversion $n = intval( trim( $this->mResponseCode ) ); HttpStatus::header( $n ); } @@ -303,10 +304,10 @@ class AjaxResponse { */ function storeInMemcached( $mckey, $expiry = 86400 ) { ObjectCache::getMainWANInstance()->set( $mckey, - array( + [ 'timestamp' => wfTimestampNow(), 'value' => $this->mText - ), $expiry + ], $expiry ); return true;