updates and such
[glcas.git] / lib / lib.php
index 5e7cf40..6c48c4c 100644 (file)
@@ -1,7 +1,26 @@
 <?php
 
+require_once("config.php");
+require_once("wsdl.php");
+require_once("www.php");
+require_once("db.php");
+require_once("messages.php");
+require_once("datastore.php");
+require_once("updates.php");
+
+global $VERSION;
+
+$VERSION["main"]["major"] = "0";
+$VERSION["main"]["minor"] = "0";
+$VERSION["main"]["release"] = "0";
+$VERSION["updateurl"]["main"] = "http://localhost/src/eclipse-workspace/glcas/release.txt";
+
 // first and foremost, load the plugins
 $basedir = dirname(__FILE__);
+
+// we load this first
+if(file_exists("$basedir/plugins/www.php")) require_once("$basedir/plugins/www.php");
+
 if(is_dir("$basedir/plugins")) {
        $dh = opendir("$basedir/plugins");
        if($dh) {
@@ -17,5 +36,27 @@ if(is_dir("$basedir/plugins")) {
        echo "No plugins dir ($basedir/plugins), continuing without\n";
 }
 
+function urlInterpretter()
+{
+       global $BASE_URLS;
+       global $URL_COMPONENTS;
+       
+       if(isset($_REQUEST["q"])) $qry = $_REQUEST["q"];
+       else $qry = "";
+       
+       $urlcomps = preg_split("/[,\/]/", $qry);
+       $URL_COMPONENTS = $urlcomps;
+       
+       foreach($BASE_URLS as $bases_cd => $bases) {
+               //echo "<br>checking $bases_cd for ".$bases["base"]." against \"".$urlcomps[0]."\"<br>";
+               if(strtolower($urlcomps[0]) == strtolower($bases["base"])) {
+                       //echo "match<br>";
+                       $func = $bases["function"];
+                       return $func();
+               }
+       }
+}
 
+$db = db_getDB();
+db_createTable("options", "option_name", "option_value");
 ?>
\ No newline at end of file