lots of changed, though it'll probably be all backed-out because
[configmanager.git] / lib / lib.php
1 <?php
2
3 $BASE_DIR = realpath(dirname(__FILE__)."/../");
4
5 $DB_HANDLE = false;
6 global $BASE_DIR, $HOST_TYPES, $DB_HANDLE;
7
8 // require some files
9 require_once("www.php");
10 require_once("db.php");
11 require_once("xmlrpc.php");
12
13 // get the config
14 if(file_exists("../etc/config.php")) require_once("../etc/config.php");
15
16 // first and foremost, load the plugins
17 $basedir = dirname(__FILE__);
18
19 // we load this first
20 if(is_dir("$basedir")) {
21         $dh = opendir("$basedir");
22         if($dh) {
23                 while(($file = readdir($dh))!==false) {
24                         $mt = preg_match("/.*\.plugin\.php$/", $file);
25                         if($mt > 0) {
26                                 require_once("$basedir/$file");
27                                 //echo "required $basedir/$file\n";
28                         }
29                 }
30         }
31 }
32 ?>