+<?php
+$CMD_ROOT_FS = realpath(dirname(__FILE__));
+
+global $CMD_ROOT_FS;
+
+// add libglcas as if it were a path in ../libglcas
+if(file_exists("../libcbfwr")) {
+ $path = realpath($CMD_ROOT_FS."/../");
+ error_log("added cbfwr path as $path");
+ set_include_path(get_include_path().PATH_SEPARATOR.$path);
+}
+
+// include the based library
+require_once("libcbfwr/lib.php");
+
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-?>
\ No newline at end of file
--- /dev/null
+<?php
+/*
+ *
+ * The Main lib.php file.
+ *
+ */
+
+//require_once();
+
+// get the lib root, and set include path from it
+$LIB_ROOT_FS = realpath(dirname(__FILE__));
+global $LIB_ROOT_FS;
+
+/*
+ * I shouldnt ever need to do this bit, but its here, just in case
+$adpath = realpath($LIB_ROOT_FS."/../");
+error_log("added libglcas path as $adpath");
+set_include_path(get_include_path().PATH_SEPARATOR.$adpath);
+
+*/
+require_once("libcbfwr/config.php");
+
+function glcas_pluginLoader($path="")
+{
+ global $LIB_ROOT_FS;
+ if($path == "") {
+ // try and find it
+ $plpath = realpath($LIB_ROOT_FS."/../plugins/");
+ if(file_exists($plpath."/plugin.php")) {
+ // here it is, load away
+ error_log("attempting to load plugins from $plpath");
+ $dh = opendir("$plpath");
+ if($dh) {
+ while(($file = readdir($dh))!==false) {
+ $mt = preg_match("/.*.php$/", $file);
+ if($mt > 0) {
+ error_log("loading plugin $file");
+ require_once("$plpath/$file");
+ //echo "required $basedir/$file\n";
+ }
+ }
+ }
+ }
+ }
+}
+
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+// im just something to make sure the directory gets created
+error_log("base plugin loaded");
+?>
\ No newline at end of file
<?php
+$WEB_ROOT_FS = realpath(dirname(__FILE__));
+$BASE_URL = dirname($_SERVER["PHP_SELF"]);
+
+global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
+
+// add libglcas as if it were a path in ../libglcas
+if(file_exists("../libcbfwr")) {
+ $path = realpath($WEB_ROOT_FS."/../");
+ error_log("added cbfwr path as $path");
+ set_include_path(get_include_path().PATH_SEPARATOR.$path);
+}
+
+// include the based library
+require_once("libcbfwr/lib.php");
?>
\ No newline at end of file