X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=blobdiff_plain;f=includes%2FAjaxResponse.php;h=323c5d30ac2778bde6a3a4116e1c12cba2cffa38;hb=4050efc657ef308a97574cf9acb71143acaac2b4;hp=dfcf4677af7329a89434c2281f39757821fe0288;hpb=0f81b58eece352aa867c61b0dfd7bd256ab6208b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index dfcf4677af..323c5d30ac 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -162,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. - // https://secure.php.net/manual/en/language.types.string.php#language.types.string.conversion + // https://www.php.net/manual/en/language.types.string.php#language.types.string.conversion $n = intval( trim( $this->mResponseCode ) ); HttpStatus::header( $n ); } @@ -179,8 +179,7 @@ class AjaxResponse { # If CDN caches are configured, tell them to cache the response, # and tell the client to always check with the CDN. Otherwise, # tell the client to use a cached copy, without a way to purge it. - - if ( $this->mConfig->get( 'UseSquid' ) ) { + if ( $this->mConfig->get( 'UseCdn' ) ) { # Expect explicit purge of the proxy cache, but require end user agents # to revalidate against the proxy on each visit. # Surrogate-Control controls our CDN, Cache-Control downstream caches @@ -282,7 +281,8 @@ class AjaxResponse { return false; } - $mcvalue = ObjectCache::getMainWANInstance()->get( $mckey ); + $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); + $mcvalue = $cache->get( $mckey ); if ( $mcvalue ) { # Check to see if the value has been invalidated if ( $touched <= $mcvalue['timestamp'] ) { @@ -304,11 +304,13 @@ class AjaxResponse { * @return bool */ function storeInMemcached( $mckey, $expiry = 86400 ) { - ObjectCache::getMainWANInstance()->set( $mckey, + $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); + $cache->set( $mckey, [ 'timestamp' => wfTimestampNow(), 'value' => $this->mText - ], $expiry + ], + $expiry ); return true;