]> andersk Git - sql-web.git/blobdiff - test.php
new templates
[sql-web.git] / test.php
index bbea2a484a4a5e2b5a39555e1771228dc05c0c16..41b9f313df53f60ac64528882682ead5b1239d0f 100755 (executable)
--- a/test.php
+++ b/test.php
@@ -3,18 +3,22 @@
 require_once('mitsql.cfg.php');
 require_once('mitsql.lib.php');
 
-/*
-include 'phpinfo.php';
-exit;
-*/
-
-$thisPath=pathinfo($_SERVER['SCRIPT_NAME']);
+function getManagedDBs($owner=null) {
+       $databases = array_keys(fetchRows(DBSelect('SHOW DATABASES'),'Database'));
+       $owners = array();
+       foreach($databases as $database) {
+               if (stristr($database, DELIMETER)) {
+                       $exp = explode(DELIMETER, $database);
+                       $thisowner = array_shift($exp);
+                       if (!is_null($owner) && $thisowner!=$owner) { continue; }
+                       isset($owners[$thisowner]) || $owners[$thisowner] = array();
+                       $owners[$thisowner][] = $database;
+               }
+       }
+       return $owners;
+}
 
-session_set_cookie_params(0, $thisPath['dirname']);
-@session_start();
+$g = getManagedDBs();
+print_r($g);
 
-if (isSess('i')) {
-    sess('i', sess('i')+1);
-} else {
-    echo sess('i', 1);
-}
+?>
\ No newline at end of file
This page took 0.274019 seconds and 4 git commands to generate.