]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12886 moved WS related stuff to webservice lib instead of external lib
authorskodak <skodak>
Wed, 16 Sep 2009 19:03:21 +0000 (19:03 +0000)
committerskodak <skodak>
Wed, 16 Sep 2009 19:03:21 +0000 (19:03 +0000)
lib/externallib.php
webservice/lib.php

index 2d3da559cdcf96ca7f6d10398fd585e2cf45c517..6b64209c6b410a9f866ad81a180e292629bc3358 100644 (file)
@@ -105,39 +105,5 @@ class external_api {
             require_capability('moodle/course:view', $context);
         }
     }
-
-    /**
-     * Returns detailed information about external function
-     * @param string $functionname name of external function
-     * @return aray
-     */
-    public static function get_function_info($functionname) {
-        global $CFG, $DB;
-
-        $function = $DB->get_record('external_functions', array('name'=>$functionname), '*', MUST_EXIST);
-
-        $defpath = get_component_directory($function->component);
-        if (!file_exists("$defpath/db/services.php")) {
-            //TODO: maybe better throw invalid parameter exception
-            return null;
-        }
-
-        $functions = array();
-        include("$defpath/db/services.php");
-
-        if (empty($functions[$functionname])) {
-            return null;
-        }
-
-        $desc = $functions[$functionname];
-        if (empty($desc['classpath'])) {
-            $desc['classpath'] = "$defpath/externallib.php";
-        } else {
-            $desc['classpath'] = "$CFG->dirroot/".$desc['classpath'];
-        }
-        $desc['component'] = $function->component;
-
-        return $desc;
-    }
 }
 
index bf4d52eb7b08e69a165e991801753bd7e01caead..b5ed7301277cd2fbfc0273d9d0b03222c6ade81d 100644 (file)
 
 require_once(dirname(dirname(__FILE__)) . '/lib/formslib.php');
 
+/**
+ * Returns detailed information about external function
+ * @param string $functionname name of external function
+ * @return aray
+ */
+function ws_get_function_info($functionname) {
+    global $CFG, $DB;
+
+    $function = $DB->get_record('external_functions', array('name'=>$functionname), '*', MUST_EXIST);
+
+    $defpath = get_component_directory($function->component);
+    if (!file_exists("$defpath/db/services.php")) {
+        //TODO: maybe better throw invalid parameter exception
+        return null;
+    }
+
+    $functions = array();
+    include("$defpath/db/services.php");
+
+    if (empty($functions[$functionname])) {
+        return null;
+    }
+
+    $desc = $functions[$functionname];
+    if (empty($desc['classpath'])) {
+        $desc['classpath'] = "$defpath/externallib.php";
+    } else {
+        $desc['classpath'] = "$CFG->dirroot/".$desc['classpath'];
+    }
+    $desc['component'] = $function->component;
+
+    return $desc;
+}
+
 /**
  * web service library
  */