* (bug 31435) Fix raw watchlist edit regression from r84718.
[lhc/web/wiklou.git] / includes / Init.php
index 660bb29..c4bdc5f 100644 (file)
@@ -23,7 +23,7 @@ class MWInit {
        }
 
        /**
-        * Returns true if we are running under HipHop, whether in compiled or 
+        * Returns true if we are running under HipHop, whether in compiled or
         * interpreted mode.
         *
         * @return bool
@@ -47,10 +47,10 @@ class MWInit {
        }
 
        /**
-        * If we are running code compiled by HipHop, this will pass through the 
-        * input path, assumed to be relative to $IP. If the code is interpreted, 
-        * it will converted to a fully qualified path. It is necessary to use a 
-        * path which is relative to $IP in order to make HipHop use its compiled 
+        * If we are running code compiled by HipHop, this will pass through the
+        * input path, assumed to be relative to $IP. If the code is interpreted,
+        * it will converted to a fully qualified path. It is necessary to use a
+        * path which is relative to $IP in order to make HipHop use its compiled
         * code.
         *
         * @param $file string
@@ -70,33 +70,40 @@ class MWInit {
        /**
         * The equivalent of MWInit::interpretedPath() but for files relative to the
         * extensions directory.
+        *
+        * @param $file string
+        * @return string
         */
        static function extInterpretedPath( $file ) {
-               return getExtensionsDirectory() . '/' . $file;
+               return self::getExtensionsDirectory() . '/' . $file;
        }
 
        /**
-        * The equivalent of MWInit::compiledPath() but for files relative to the 
+        * The equivalent of MWInit::compiledPath() but for files relative to the
         * extensions directory. Any files referenced in this way must be registered
         * for compilation by including them in $wgCompiledFiles.
+        * @param $file string
+        * @return string
         */
        static function extCompiledPath( $file ) {
                if ( defined( 'MW_COMPILED' ) ) {
                        return "extensions/$file";
                } else {
-                       return getExtensionsDirectory() . '/' . $file;
+                       return self::getExtensionsDirectory() . '/' . $file;
                }
        }
 
        /**
-        * Register an extension setup file and return its path for compiled 
+        * Register an extension setup file and return its path for compiled
         * inclusion. Use this function in LocalSettings.php to add extensions
         * to the build. For example:
         *
         *    require( MWInit::extSetupPath( 'ParserFunctions/ParserFunctions.php' ) );
         *
-        * @param $path The path relative to the extensions directory, as defined by 
+        * @param $extRel string The path relative to the extensions directory, as defined by
         *   $wgExtensionsDirectory.
+        *
+        * @return string
         */
        static function extSetupPath( $extRel ) {
                $baseRel = "extensions/$extRel";
@@ -109,6 +116,9 @@ class MWInit {
                }
        }
 
+       /**
+        * @return bool|string
+        */
        static function getExtensionsDirectory() {
                global $wgExtensionsDirectory, $IP;
                if ( $wgExtensionsDirectory === false ) {
@@ -120,13 +130,13 @@ class MWInit {
        /**
         * Determine whether a class exists, using a method which works under HipHop.
         *
-        * Note that it's not possible to implement this with any variant of 
-        * class_exists(), because class_exists() returns false for classes which 
-        * are compiled in. 
+        * Note that it's not possible to implement this with any variant of
+        * class_exists(), because class_exists() returns false for classes which
+        * are compiled in.
         *
-        * Calling class_exists() on a literal string causes the class to be made 
-        * "volatile", which means (as of March 2011) that the class is broken and 
-        * can't be used at all. So don't do that. See 
+        * Calling class_exists() on a literal string causes the class to be made
+        * "volatile", which means (as of March 2011) that the class is broken and
+        * can't be used at all. So don't do that. See
         * https://github.com/facebook/hiphop-php/issues/314
         *
         * @param $class string
@@ -143,11 +153,11 @@ class MWInit {
        }
 
        /**
-        * Determine whether a function exists, using a method which works under 
+        * Determine whether a function exists, using a method which works under
         * HipHop.
         *
         * @param $function string
-        * 
+        *
         * @return bool
         */
        static function functionExists( $function ) {
@@ -160,8 +170,12 @@ class MWInit {
        }
 
        /**
-        * Call a static method of a class with variable arguments without causing 
+        * Call a static method of a class with variable arguments without causing
         * it to become volatile.
+        * @param $className string
+        * @param $methodName string
+        * @param $args array
+        *
         */
        static function callStaticMethod( $className, $methodName, $args ) {
                $r = new ReflectionMethod( $className, $methodName );