Added new success message when CLI Installer completes its work succesfuly.
[lhc/web/wiklou.git] / includes / OutputPage.php
index 7c463b6..a5f9c18 100644 (file)
@@ -314,15 +314,10 @@ class OutputPage extends ContextSource {
         * Constructor for OutputPage. This should not be called directly.
         * Instead a new RequestContext should be created and it will implicitly create
         * a OutputPage tied to that context.
-        * @param IContextSource|null $context
+        * @param IContextSource $context
         */
-       function __construct( IContextSource $context = null ) {
-               if ( $context === null ) {
-                       # Extensions should use `new RequestContext` instead of `new OutputPage` now.
-                       wfDeprecated( __METHOD__, '1.18' );
-               } else {
-                       $this->setContext( $context );
-               }
+       function __construct( IContextSource $context ) {
+               $this->setContext( $context );
        }
 
        /**
@@ -1578,10 +1573,14 @@ class OutputPage extends ContextSource {
         * Get/set the ParserOptions object to use for wikitext parsing
         *
         * @param ParserOptions|null $options Either the ParserOption to use or null to only get the
-        *   current ParserOption object
+        *   current ParserOption object. This parameter is deprecated since 1.31.
         * @return ParserOptions
         */
        public function parserOptions( $options = null ) {
+               if ( $options !== null ) {
+                       wfDeprecated( __METHOD__ . ' with non-null $options', '1.31' );
+               }
+
                if ( $options !== null && !empty( $options->isBogus ) ) {
                        // Someone is trying to set a bogus pre-$wgUser PO. Check if it has
                        // been changed somehow, and keep it if so.
@@ -1981,6 +1980,7 @@ class OutputPage extends ContextSource {
         * @deprecated since 1.27 Use setCdnMaxage() instead
         */
        public function setSquidMaxage( $maxage ) {
+               wfDeprecated( __METHOD__, '1.27' );
                $this->setCdnMaxage( $maxage );
        }
 
@@ -2200,7 +2200,7 @@ class OutputPage extends ContextSource {
                                        // IE and some other browsers use BCP 47 standards in
                                        // their Accept-Language header, like "zh-CN" or "zh-Hant".
                                        // We should handle these too.
-                                       $variantBCP47 = wfBCP47( $variant );
+                                       $variantBCP47 = LanguageCode::bcp47( $variant );
                                        if ( $variantBCP47 !== $variant ) {
                                                $aloption[] = 'substr=' . $variantBCP47;
                                        }
@@ -2923,15 +2923,14 @@ class OutputPage extends ContextSource {
                $pieces = array_merge( $pieces, array_values( $this->getHeadLinksArray() ) );
                $pieces = array_merge( $pieces, array_values( $this->mHeadItems ) );
 
-               $min = ResourceLoader::inDebugMode() ? '' : '.min';
                // Use an IE conditional comment to serve the script only to old IE
                $pieces[] = '<!--[if lt IE 9]>' .
-                       Html::element( 'script', [
-                               'src' => self::transformResourcePath(
-                                       $this->getConfig(),
-                                       "/resources/lib/html5shiv/html5shiv{$min}.js"
-                               ),
-                       ) .
+                       ResourceLoaderClientHtml::makeLoad(
+                               ResourceLoaderContext::newDummyContext(),
+                               [ 'html5shiv' ],
+                               ResourceLoaderModule::TYPE_SCRIPTS,
+                               [ 'sync' => true ]
+                       ) .
                        '<![endif]-->';
 
                $pieces[] = Html::closeElement( 'head' );
@@ -3438,7 +3437,7 @@ class OutputPage extends ContextSource {
                                foreach ( $variants as $variant ) {
                                        $tags["variant-$variant"] = Html::element( 'link', [
                                                'rel' => 'alternate',
-                                               'hreflang' => wfBCP47( $variant ),
+                                               'hreflang' => LanguageCode::bcp47( $variant ),
                                                'href' => $this->getTitle()->getLocalURL(
                                                        [ 'variant' => $variant ] )
                                                ]
@@ -4027,6 +4026,13 @@ class OutputPage extends ContextSource {
                        return;
                }
 
+               if ( isset( $logo['svg'] ) ) {
+                       // No media queries required if we only have a 1x and svg variant
+                       // because all preload-capable browsers support SVGs
+                       $this->addLinkHeader( '<' . $logo['svg'] . '>;rel=preload;as=image' );
+                       return;
+               }
+
                foreach ( $logo as $dppx => $src ) {
                        // Keys are in this format: "1.5x"
                        $dppx = substr( $dppx, 0, -1 );