some initial stuff
[pengine.git] / lib / lib.php
index e89f248..9df80fb 100644 (file)
@@ -1,3 +1,19 @@
 <?php 
 
+// first and foremost, load the plugins
+$basedir = dirname(__FILE__);
+if(is_dir("$basedir/plugins")) {
+       $dh = opendir("$basedir/plugins");
+       if($dh) {
+               while(($file = readdir($dh))!==false) {
+                       $mt = preg_match("/.*\.php$/", $file);
+                       if($mt > 0) {
+                               require_once("$basedir/plugins/$file");
+                               //echo "required $basedir/plugins/$file\n";
+                       }
+               }
+       }
+} else {
+       echo "No plugins dir ($basedir/plugins), continuing without\n";
+}
 ?>
\ No newline at end of file