Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed makeclass stuff completely. It's now in contrib/crown_college

  • Loading branch information...
commit cf3f6bcc2c7de689ace31fed3481d6377072cfd3 1 parent eac7c90
moodler authored

Showing 2 changed files with 2 additions and 46 deletions. Show diff stats Hide diff stats

  1. +0 42 lib/makeclass.php
  2. +2 4 lib/setup.php
42 lib/makeclass.php
... ... @@ -1,42 +0,0 @@
1   -<?PHP // $Id$
2   -
3   -// This file is not used by Moodle itself.
4   -//
5   -// It exists to provide a more object-oriented interface to some of
6   -// Moodle's main library functions, for use by external programs.
7   -//
8   -// Thanks to Greg Barnett from Crown College for ideas and code
9   -
10   -// Usage example (from an external program):
11   -//
12   -// /// Set things up
13   -// $external_moodle_access = true; // Affects setup.php
14   -// require_once("moodle/lib/makeclass.php"); // This file
15   -// makeClassFromFile("moodlelib.php", "moodlelib"); // File in $CFG->libdir
16   -//
17   -// /// Call moodle functions like this
18   -// moodle::isteacher($courseID);
19   -
20   -
21   -require_once("../config.php");
22   -
23   -function makeClassFromFile($file, $classname) {
24   - global $CFG;
25   -
26   - $file = "$CFG->libdir/$file";
27   -
28   - # sanity checks
29   - assert('is_file($file)');
30   - assert('!class_exists($classname)');
31   -
32   - # Load the file into an array, strip out php tags at beginning and end,
33   - # This assumes that the php start and end tags are each on one line at the
34   - # beginning and end of the file, and the rest of the file consists only of
35   - # comments and functions.
36   - $functions = file($file);
37   - $functions = array_slice($functions, 1, -1);
38   - $functions = join('', $functions);
39   -
40   - eval ("class $classname { $functions }");
41   -}
42   -
6 lib/setup.php
@@ -26,10 +26,8 @@
26 26
27 27 /// Load up standard libraries
28 28
29   - if (!isset($external_moodle_access)) { // See lib/makeclass.php
30   - require("$CFG->libdir/weblib.php"); // Standard web page functions
31   - require("$CFG->libdir/moodlelib.php"); // Various Moodle functions
32   - }
  29 + require("$CFG->libdir/weblib.php"); // Standard web page functions
  30 + require("$CFG->libdir/moodlelib.php"); // Various Moodle functions
33 31
34 32
35 33 /// Set error reporting back to normal

0 comments on commit cf3f6bc

Please sign in to comment.
Something went wrong with that request. Please try again.