From f72a9bfe43993e09e4329a2c1b00abef6bb90fd4 Mon Sep 17 00:00:00 2001 From: Robin Pepermans Date: Mon, 12 Sep 2011 21:26:08 +0000 Subject: [PATCH] * Some documentation * Use Title->isMainPage() in Article->view() --- includes/Article.php | 2 +- includes/Title.php | 1 + languages/Language.php | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/includes/Article.php b/includes/Article.php index 24cadc03cc..120e21d038 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -561,7 +561,7 @@ class Article extends Page { # tents of 'pagetitle-view-mainpage' instead of the default (if # that's not empty). # This message always exists because it is in the i18n files - if ( $this->getTitle()->equals( Title::newMainPage() ) ) { + if ( $this->getTitle()->isMainPage() ) { $msg = wfMessage( 'pagetitle-view-mainpage' )->inContentLanguage(); if ( !$msg->isDisabled() ) { $wgOut->setHTMLTitle( $msg->title( $this->getTitle() )->text() ); diff --git a/includes/Title.php b/includes/Title.php index 557d97f43b..5ec985c8f1 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1898,6 +1898,7 @@ class Title { * acidentally creating new bugs where $title->equals( Title::newFromText() ) * ends up reporting something differently than $title->isMainPage(); * + * @since 1.18 * @return Bool */ public function isMainPage() { diff --git a/languages/Language.php b/languages/Language.php index f72801481f..15f3329d81 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -218,6 +218,10 @@ class Language { return preg_match( '/^[a-z0-9-]+$/i', $code ); } + /** + * @param $code + * @return String Name of the language class + */ public static function classFromCode( $code ) { if ( $code == 'en' ) { return 'Language'; @@ -226,6 +230,11 @@ class Language { } } + /** + * Includes language class files + * + * @param $class Name of the language class + */ public static function preloadLanguageClass( $class ) { global $IP; -- 2.20.1