Merge "Enable $wgVectorUseIconWatch by default."
[lhc/web/wiklou.git] / includes / Skin.php
index 9023492..a4cb9f4 100644 (file)
@@ -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' );
                }
@@ -167,7 +169,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,7 +483,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * Render the array as a serie of links.
+        * Render the array as a series of links.
         * @param array $tree categories tree returned by Title::getParentCategoryTree
         * @return String separated by >, terminate with "\n"
         */
@@ -850,7 +852,7 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * Renders a $wgFooterIcons icon acording to the method's arguments
+        * 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
@@ -977,7 +979,7 @@ 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 string $name The name or path of a skin resource file
@@ -1252,7 +1254,7 @@ abstract class Skin extends ContextSource {
                                                }
 
                                                global $wgExternalLinkTarget;
-                                               if ( $wgExternalLinkTarget) {
+                                               if ( $wgExternalLinkTarget ) {
                                                        $extraAttribs['target'] = $wgExternalLinkTarget;
                                                }
                                        } else {
@@ -1557,6 +1559,7 @@ abstract class Skin extends ContextSource {
        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 );