DataObjects/Core_event_audit.php
[Pman.Core] / UpdateDatabase.php
index 1038904..edb09c9 100644 (file)
@@ -32,7 +32,10 @@ class Pman_Core_UpdateDatabase extends Pman
     function get()
     {
         $this->importSQL();
-        die("done");
+         
+    }
+    function output() {
+        return '';
     }
      /**
      * imports SQL files from all DataObjects directories....
@@ -68,17 +71,16 @@ class Pman_Core_UpdateDatabase extends Pman
             
             $fd = $this->rootDir. "/Pman/$m/DataObjects";
             
-            foreach(glob($fd.'/*.sql') as $f) {
-                
-                $fn = "$fd/$f";
+            foreach(glob($fd.'/*.sql') as $fn) {
                 
-                if (preg_match('/migrate/i', $f)) { // skip migration scripts at present..
+                 
+                if (preg_match('/migrate/i', basename($fn))) { // skip migration scripts at present..
                     continue;
                 }
                 
-                $cmd = $cat . ' ' . escapeshellarg($fn) . " | $mysql_cmd -f ";
+                $cmd = "$mysql_cmd -f < " . escapeshellarg($fn) ;
                 
-                echo $cmd. ($cli ? "\n" : "<BR>\n");
+                echo $cmd. ($this->cli ? "\n" : "<BR>\n");
                 
                 passthru($cmd);