Merge "Enable $wgVectorUseIconWatch by default."
[lhc/web/wiklou.git] / includes / Skin.php
index a34afb6..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' );
                }
@@ -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 );