language->getCode(), 'mwfile' ); return $vars; } /** * @param $context ResourceLoaderContext * @return string: JavaScript code */ public function getScript( ResourceLoaderContext $context ) { $this->language = Language::factory( $context->getLanguage() ); $out = ''; foreach ( $this->getData() as $key => $value ) { $out .= Xml::encodeJsCall( 'mw.config.set', array( $key, $value ) ); } return $out; } /** * @param $context ResourceLoaderContext * @return array|int|Mixed */ public function getModifiedTime( ResourceLoaderContext $context ) { $this->language = Language::factory( $context->getLanguage() ); $cache = wfGetCache( CACHE_ANYTHING ); $key = wfMemcKey( 'resourceloader', 'ulsmodule', 'changeinfo' ); $data = $this->getData(); $hash = md5( serialize( $data ) ); $result = $cache->get( $key ); if ( is_array( $result ) && $result['hash'] === $hash ) { return $result['timestamp']; } $timestamp = wfTimestamp(); $cache->set( $key, array( 'hash' => $hash, 'timestamp' => $timestamp, ) ); return $timestamp; } }