]> git.mjollnir.org Git - moodle.git/commitdiff
Removed makeclass stuff completely. It's now in contrib/crown_college
authormoodler <moodler>
Wed, 11 Dec 2002 06:31:59 +0000 (06:31 +0000)
committermoodler <moodler>
Wed, 11 Dec 2002 06:31:59 +0000 (06:31 +0000)
lib/makeclass.php [deleted file]
lib/setup.php

diff --git a/lib/makeclass.php b/lib/makeclass.php
deleted file mode 100644 (file)
index 29bcf4a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?PHP // $Id$
-
-// This file is not used by Moodle itself.
-//
-// It exists to provide a more object-oriented interface to some of 
-// Moodle's main library functions, for use by external programs.
-// 
-// Thanks to Greg Barnett from Crown College for ideas and code
-
-// Usage example (from an external program):
-// 
-// /// Set things up
-//     $external_moodle_access = true;                   // Affects setup.php
-//     require_once("moodle/lib/makeclass.php");         // This file
-//     makeClassFromFile("moodlelib.php", "moodlelib");  // File in $CFG->libdir
-//
-// /// Call moodle functions like this
-//     moodle::isteacher($courseID); 
-
-
-require_once("../config.php");
-
-function makeClassFromFile($file, $classname) {
-    global $CFG;
-
-    $file = "$CFG->libdir/$file";
-
-    # sanity checks
-    assert('is_file($file)');
-    assert('!class_exists($classname)');
-
-    # Load the file into an array, strip out php tags at beginning and end,
-    # This assumes that the php start and end tags are each on one line at the
-    # beginning and end of the file, and the rest of the file consists only of
-    # comments and functions.
-    $functions = file($file);
-    $functions = array_slice($functions, 1, -1);
-    $functions = join('', $functions);
-
-    eval ("class $classname { $functions }");
-}
-
index cee833b4ddc9b96825d0e952cd7be641f29fadb3..97a155de3b41ede7ad86eef4dd8e17704a3c3e6c 100644 (file)
 
 /// Load up standard libraries 
 
-    if (!isset($external_moodle_access)) {           // See lib/makeclass.php
-        require("$CFG->libdir/weblib.php");          // Standard web page functions
-        require("$CFG->libdir/moodlelib.php");       // Various Moodle functions
-    }
+    require("$CFG->libdir/weblib.php");          // Standard web page functions
+    require("$CFG->libdir/moodlelib.php");       // Various Moodle functions
 
 
 /// Set error reporting back to normal