Merge "Fix ParserOutput::getText 'unwrap' flag for end-of-doc comment"
[lhc/web/wiklou.git] / includes / OutputPage.php
index a2d445f..e6345ba 100644 (file)
@@ -23,8 +23,9 @@
 use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
 use MediaWiki\Session\SessionManager;
-use WrappedString\WrappedString;
-use WrappedString\WrappedStringList;
+use Wikimedia\RelPath;
+use Wikimedia\WrappedString;
+use Wikimedia\WrappedStringList;
 
 /**
  * This class should be covered by a general architecture document which does
@@ -51,12 +52,6 @@ class OutputPage extends ContextSource {
        /** @var bool */
        protected $mCanonicalUrl = false;
 
-       /**
-        * @var array Additional stylesheets. Looks like this is for extensions.
-        *   Might be replaced by ResourceLoader.
-        */
-       protected $mExtStyles = [];
-
        /**
         * @var string Should be private - has getter and setter. Contains
         *   the HTML title */
@@ -323,7 +318,7 @@ class OutputPage extends ContextSource {
        /**
         * Redirect to $url rather than displaying the normal page
         *
-        * @param string $url URL
+        * @param string $url
         * @param string $responsecode HTTP status code
         */
        public function redirect( $url, $responsecode = '302' ) {
@@ -463,31 +458,6 @@ class OutputPage extends ContextSource {
                $this->mScripts .= $script;
        }
 
-       /**
-        * Register and add a stylesheet from an extension directory.
-        *
-        * @deprecated since 1.27 use addModuleStyles() or addStyle() instead
-        * @param string $url Path to sheet.  Provide either a full url (beginning
-        *             with 'http', etc) or a relative path from the document root
-        *             (beginning with '/').  Otherwise it behaves identically to
-        *             addStyle() and draws from the /skins folder.
-        */
-       public function addExtensionStyle( $url ) {
-               wfDeprecated( __METHOD__, '1.27' );
-               array_push( $this->mExtStyles, $url );
-       }
-
-       /**
-        * Get all styles added by extensions
-        *
-        * @deprecated since 1.27
-        * @return array
-        */
-       function getExtStyle() {
-               wfDeprecated( __METHOD__, '1.27' );
-               return $this->mExtStyles;
-       }
-
        /**
         * Add a JavaScript file out of skins/common, or a given relative path.
         * Internal use only. Use OutputPage::addModules() if possible.
@@ -713,13 +683,6 @@ class OutputPage extends ContextSource {
                $this->mAdditionalBodyClasses = array_merge( $this->mAdditionalBodyClasses, (array)$classes );
        }
 
-       /**
-        * @deprecated since 1.28 Obsolete - wgUseETag experiment was removed.
-        * @param string $tag
-        */
-       public function setETag( $tag ) {
-       }
-
        /**
         * Set whether the output should only contain the body of the article,
         * without any skin, sidebar, etc.
@@ -1987,15 +1950,6 @@ class OutputPage extends ContextSource {
                return Parser::stripOuterParagraph( $parsed );
        }
 
-       /**
-        * @param int $maxage
-        * @deprecated since 1.27 Use setCdnMaxage() instead
-        */
-       public function setSquidMaxage( $maxage ) {
-               wfDeprecated( __METHOD__, '1.27' );
-               $this->setCdnMaxage( $maxage );
-       }
-
        /**
         * Set the value of the "s-maxage" part of the "Cache-control" HTTP header
         *
@@ -2659,36 +2613,6 @@ class OutputPage extends ContextSource {
                return $text;
        }
 
-       /**
-        * Display a page stating that the Wiki is in read-only mode.
-        * Should only be called after wfReadOnly() has returned true.
-        *
-        * Historically, this function was used to show the source of the page that the user
-        * was trying to edit and _also_ permissions error messages. The relevant code was
-        * moved into EditPage in 1.19 (r102024 / d83c2a431c2a) and removed here in 1.25.
-        *
-        * @deprecated since 1.25; throw the exception directly
-        * @throws ReadOnlyError
-        */
-       public function readOnlyPage() {
-               if ( func_num_args() > 0 ) {
-                       throw new MWException( __METHOD__ . ' no longer accepts arguments since 1.25.' );
-               }
-
-               throw new ReadOnlyError;
-       }
-
-       /**
-        * Turn off regular page output and return an error response
-        * for when rate limiting has triggered.
-        *
-        * @deprecated since 1.25; throw the exception directly
-        */
-       public function rateLimited() {
-               wfDeprecated( __METHOD__, '1.25' );
-               throw new ThrottledError;
-       }
-
        /**
         * Show a warning about replica DB lag
         *
@@ -3713,12 +3637,6 @@ class OutputPage extends ContextSource {
        public function buildCssLinksArray() {
                $links = [];
 
-               // Add any extension CSS
-               foreach ( $this->mExtStyles as $url ) {
-                       $this->addStyle( $url );
-               }
-               $this->mExtStyles = [];
-
                foreach ( $this->styles as $file => $options ) {
                        $link = $this->styleLink( $file, $options );
                        if ( $link ) {
@@ -3818,7 +3736,7 @@ class OutputPage extends ContextSource {
                        $remotePathPrefix = $remotePath = $uploadPath;
                }
 
-               $path = RelPath\getRelativePath( $path, $remotePath );
+               $path = RelPath::getRelativePath( $path, $remotePath );
                return self::transformFilePath( $remotePathPrefix, $localDir, $path );
        }