Merge "Move EXIF metadata CSS from mediawiki.legacy.shared"
[lhc/web/wiklou.git] / includes / OutputPage.php
index d8600c1..15b70c8 100644 (file)
@@ -104,22 +104,11 @@ class OutputPage extends ContextSource {
        protected $mStatusCode;
 
        /**
-        * @var string Variable mLastModified and mEtag are used for sending cache control.
+        * @var string Used for sending cache control.
         *   The whole caching system should probably be moved into its own class.
         */
        protected $mLastModified = '';
 
-       /**
-        * Contains an HTTP Entity Tags (see RFC 2616 section 3.13) which is used
-        * as a unique identifier for the content. It is later used by the client
-        * to compare its cached version with the server version. Client sends
-        * headers If-Match and If-None-Match containing its locally cached ETAG value.
-        *
-        * To get more information, you will have to look at HTTP/1.1 protocol which
-        * is properly described in RFC 2616 : http://tools.ietf.org/html/rfc2616
-        */
-       private $mETag = false;
-
        /** @var array */
        protected $mCategoryLinks = [];
 
@@ -694,12 +683,10 @@ class OutputPage extends ContextSource {
        }
 
        /**
-        * Set the value of the ETag HTTP header, only used if $wgUseETag is true
-        *
-        * @param string $tag Value of "ETag" header
+        * @deprecated since 1.28 Obsolete - wgUseETag experiment was removed.
+        * @param string $tag
         */
-       function setETag( $tag ) {
-               $this->mETag = $tag;
+       public function setETag( $tag ) {
        }
 
        /**
@@ -1277,15 +1264,10 @@ class OutputPage extends ContextSource {
 
                # Fetch existence plus the hiddencat property
                $dbr = wfGetDB( DB_SLAVE );
-               $fields = [ 'page_id', 'page_namespace', 'page_title', 'page_len',
-                       'page_is_redirect', 'page_latest', 'pp_value' ];
-
-               if ( $this->getConfig()->get( 'ContentHandlerUseDB' ) ) {
-                       $fields[] = 'page_content_model';
-               }
-               if ( $this->getConfig()->get( 'PageLanguageUseDB' ) ) {
-                       $fields[] = 'page_lang';
-               }
+               $fields = array_merge(
+                       LinkCache::getSelectFields(),
+                       [ 'page_namespace', 'page_title', 'pp_value' ]
+               );
 
                $res = $dbr->select( [ 'page', 'page_props' ],
                        $fields,
@@ -2161,9 +2143,6 @@ class OutputPage extends ContextSource {
        public function sendCacheControl() {
                $response = $this->getRequest()->response();
                $config = $this->getConfig();
-               if ( $config->get( 'UseETag' ) && $this->mETag ) {
-                       $response->header( "ETag: $this->mETag" );
-               }
 
                $this->addVaryHeader( 'Cookie' );
                $this->addAcceptLanguage();
@@ -3101,12 +3080,6 @@ class OutputPage extends ContextSource {
                        $links[] = $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_COMBINED );
                }
 
-               // Group JS is only enabled if site JS is enabled.
-               $links[] = $this->makeResourceLoaderLink(
-                       'user.groups',
-                       ResourceLoaderModule::TYPE_COMBINED
-               );
-
                return self::getHtmlFromLoaderLinks( $links );
        }
 
@@ -3670,9 +3643,8 @@ class OutputPage extends ContextSource {
                $moduleStyles = $this->getModuleStyles();
 
                // Per-site custom styles
-               $moduleStyles[] = 'site';
+               $moduleStyles[] = 'site.styles';
                $moduleStyles[] = 'noscript';
-               $moduleStyles[] = 'user.groups';
 
                // Per-user custom styles
                if ( $this->getConfig()->get( 'AllowUserCss' ) && $this->getTitle()->isCssSubpage()
@@ -3706,7 +3678,7 @@ class OutputPage extends ContextSource {
                        if ( !$module ) {
                                continue;
                        }
-                       if ( $name === 'site' ) {
+                       if ( $name === 'site.styles' ) {
                                // HACK: The site module shouldn't be fragmented with a cache group and
                                // http request. But in order to ensure its styles are separated and after the
                                // ResourceLoaderDynamicStyles marker, pretend it is in a group called 'site'.