MDL-44610 enrol Enable autoloading of enrolment plugins
authorMichael Aherne <michael.aherne@strath.ac.uk>
Thu, 13 Mar 2014 09:16:01 +0000 (09:16 +0000)
committerMichael Aherne <michael.aherne@strath.ac.uk>
Thu, 13 Mar 2014 09:16:01 +0000 (09:16 +0000)
lib/enrollib.php

index 30b930a..12d222b 100644 (file)
@@ -91,13 +91,15 @@ function enrol_get_plugins($enabled) {
     }
 
     foreach ($plugins as $plugin=>$location) {
-        if (!file_exists("$location/lib.php")) {
-            continue;
-        }
-        include_once("$location/lib.php");
         $class = "enrol_{$plugin}_plugin";
         if (!class_exists($class)) {
-            continue;
+            if (!file_exists("$location/lib.php")) {
+                continue;
+            }
+            include_once("$location/lib.php");
+            if (!class_exists($class)) {
+                continue;
+            }
         }
 
         $result[$plugin] = new $class();