X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSkin.php;h=117e6e262d35bbcb60eeae0238a3b94aacec4b41;hb=b9bd1b9346f8109e383979c1ce4264d3b7cfdd0b;hp=723ede4d048df34e1b054c9f02add4bae3463506;hpb=63d6a736ffafb7e2d405f964d562fa9e001561c0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Skin.php b/includes/Skin.php index 723ede4d04..117e6e262d 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -56,17 +56,19 @@ abstract class Skin extends ContextSource { $skinDir = dir( $wgStyleDirectory ); - # while code from www.php.net - while ( false !== ( $file = $skinDir->read() ) ) { - // Skip non-PHP files, hidden files, and '.dep' includes - $matches = array(); - - if ( preg_match( '/^([^.]*)\.php$/', $file, $matches ) ) { - $aSkin = $matches[1]; - $wgValidSkinNames[strtolower( $aSkin )] = $aSkin; + if ( $skinDir !== false && $skinDir !== null ) { + # while code from www.php.net + while ( false !== ( $file = $skinDir->read() ) ) { + // Skip non-PHP files, hidden files, and '.dep' includes + $matches = array(); + + if ( preg_match( '/^([^.]*)\.php$/', $file, $matches ) ) { + $aSkin = $matches[1]; + $wgValidSkinNames[strtolower( $aSkin )] = $aSkin; + } } + $skinDir->close(); } - $skinDir->close(); $skinsInitialised = true; wfProfileOut( __METHOD__ . '-init' ); } @@ -107,7 +109,7 @@ abstract class Skin extends ContextSource { * Normalize a skin preference value to a form that can be loaded. * If a skin can't be found, it will fall back to the configured * default (or the old 'Classic' skin if that's broken). - * @param $key String: 'monobook', 'standard', etc. + * @param string $key 'monobook', 'standard', etc. * @return string */ static function normalizeKey( $key ) { @@ -129,7 +131,6 @@ abstract class Skin extends ContextSource { // in the user preferences. $fallback = array( 0 => $wgDefaultSkin, - 1 => 'nostalgia', 2 => 'cologneblue' ); @@ -148,7 +149,7 @@ abstract class Skin extends ContextSource { /** * Factory method for loading a skin of a given type - * @param $key String: 'monobook', 'standard', etc. + * @param string $key 'monobook', 'standard', etc. * @return Skin */ static function &newFromKey( $key ) { @@ -167,7 +168,7 @@ abstract class Skin extends ContextSource { require_once( "{$wgStyleDirectory}/{$skinName}.php" ); } - # Check if we got if not failback to default skin + # Check if we got if not fallback to default skin if ( !MWInit::classExists( $className ) ) { # DO NOT die if the class isn't found. This breaks maintenance # scripts and can cause a user account to be unrecoverable @@ -481,8 +482,8 @@ abstract class Skin extends ContextSource { } /** - * Render the array as a serie of links. - * @param $tree Array: categories tree returned by Title::getParentCategoryTree + * Render the array as a series of links. + * @param array $tree categories tree returned by Title::getParentCategoryTree * @return String separated by >, terminate with "\n" */ function drawCategoryBrowser( $tree ) { @@ -613,7 +614,6 @@ abstract class Skin extends ContextSource { ( $this->getTitle()->getArticleID() == 0 || $action == 'history' ) ) { $n = $this->getTitle()->isDeleted(); - if ( $n ) { if ( $this->getUser()->isAllowed( 'undelete' ) ) { $msg = 'thisisdeleted'; @@ -851,9 +851,9 @@ abstract class Skin extends ContextSource { } /** - * Renders a $wgFooterIcons icon acording to the method's arguments - * @param $icon Array: The icon to build the html for, see $wgFooterIcons for the format of this array - * @param $withImage Bool|String: Whether to use the icon's image or output a text-only footericon + * Renders a $wgFooterIcons icon according to the method's arguments + * @param array $icon The icon to build the html for, see $wgFooterIcons for the format of this array + * @param bool|String $withImage Whether to use the icon's image or output a text-only footericon * @return String HTML */ function makeFooterIcon( $icon, $withImage = 'withImage' ) { @@ -969,7 +969,7 @@ abstract class Skin extends ContextSource { * Return a fully resolved style path url to images or styles stored in the common folder. * This method returns a url resolved using the configured skin style path * and includes the style version inside of the url. - * @param $name String: The name or path of a skin resource file + * @param string $name The name or path of a skin resource file * @return String The fully resolved style path url including styleversion */ function getCommonStylePath( $name ) { @@ -978,10 +978,10 @@ abstract class Skin extends ContextSource { } /** - * Return a fully resolved style path url to images or styles stored in the curent skins's folder. + * Return a fully resolved style path url to images or styles stored in the current skins's folder. * This method returns a url resolved using the configured skin style path * and includes the style version inside of the url. - * @param $name String: The name or path of a skin resource file + * @param string $name The name or path of a skin resource file * @return String The fully resolved style path url including styleversion */ function getSkinStylePath( $name ) { @@ -1008,8 +1008,8 @@ abstract class Skin extends ContextSource { * If $proto is set to null, make a local URL. Otherwise, make a full * URL with the protocol specified. * - * @param $name string Name of the Special page - * @param $urlaction string Query to append + * @param string $name Name of the Special page + * @param string $urlaction Query to append * @param $proto Protocol to use or null for a local URL * @return String */ @@ -1102,7 +1102,7 @@ abstract class Skin extends ContextSource { /** * Make URL details where the article exists (or at least it's convenient to think so) - * @param $name String Article name + * @param string $name Article name * @param $urlaction String * @return Array */ @@ -1253,7 +1253,7 @@ abstract class Skin extends ContextSource { } global $wgExternalLinkTarget; - if ( $wgExternalLinkTarget) { + if ( $wgExternalLinkTarget ) { $extraAttribs['target'] = $wgExternalLinkTarget; } } else { @@ -1382,7 +1382,7 @@ abstract class Skin extends ContextSource { /** * Get a cached notice * - * @param $name String: message name, or 'default' for $wgSiteNotice + * @param string $name message name, or 'default' for $wgSiteNotice * @return String: HTML fragment */ private function getCachedNotice( $name ) { @@ -1490,9 +1490,9 @@ abstract class Skin extends ContextSource { * * @param $nt Title The title being linked to (may not be the same as * $wgTitle, if the section is included from a template) - * @param $section string The designation of the section being pointed to, + * @param string $section The designation of the section being pointed to, * to be included in the link, like "§ion=$section" - * @param $tooltip string The tooltip to use for the link: will be escaped + * @param string $tooltip The tooltip to use for the link: will be escaped * and wrapped in the 'editsectionhint' message * @param $lang string Language code * @return string HTML to use for edit link @@ -1550,14 +1550,15 @@ abstract class Skin extends ContextSource { * Use PHP's magic __call handler to intercept legacy calls to the linker * for backwards compatibility. * - * @param $fname String Name of called method - * @param $args Array Arguments to the method + * @param string $fname Name of called method + * @param array $args Arguments to the method * @throws MWException * @return mixed */ function __call( $fname, $args ) { $realFunction = array( 'Linker', $fname ); if ( is_callable( $realFunction ) ) { + wfDeprecated( get_class( $this ) . '::' . $fname, '1.21' ); return call_user_func_array( $realFunction, $args ); } else { $className = get_class( $this );