Merge "Added DatabaseBase::selectRowCount() method"
[lhc/web/wiklou.git] / includes / api / ApiModuleManager.php
index fdf3f02..a0300ab 100644 (file)
@@ -195,7 +195,7 @@ class ApiModuleManager extends ContextSource {
                        // create instance from factory
                        $instance = call_user_func( $factory, $this->mParent, $name );
 
-                       if ( ! $instance instanceof $class ) {
+                       if ( !$instance instanceof $class ) {
                                throw new MWException( "The factory function for module $name did not return an instance of $class!" );
                        }
                } else {
@@ -241,6 +241,21 @@ class ApiModuleManager extends ContextSource {
                return $result;
        }
 
+       /**
+        * Returns the class name of the given module
+        *
+        * @param string $module Module name
+        * @return string|bool class name or false if the module does not exist
+        * @since 1.24
+        */
+       public function getClassName( $module ) {
+               if ( isset( $this->mModules[$module] ) ) {
+                       return $this->mModules[$module][1];
+               }
+
+               return false;
+       }
+
        /**
         * Returns true if the specific module is defined at all or in a specific group.
         * @param string $moduleName Module name