DataObjects/Core_watch.php
[Pman.Core] / UpdateDatabase.php
index 1aa9921..f40ad96 100644 (file)
@@ -155,6 +155,8 @@ class Pman_Core_UpdateDatabase extends Pman
            
             DB_DataObject::factory('companies')->initCompanies($this, $opts);
         }
+        $this->fixLinks();
+         
          
     }
     function output() {
@@ -277,6 +279,7 @@ class Pman_Core_UpdateDatabase extends Pman
         
         echo $psql_cmd . "\n" ;
         echo "scan : $dir\n";
+        
         if (is_file($dir)) {
             $files = array($dir);
 
@@ -290,7 +293,6 @@ class Pman_Core_UpdateDatabase extends Pman
         //usort($files, $lsort);
         
         
-        
         foreach($files as $bfn) {
 
 
@@ -317,7 +319,6 @@ class Pman_Core_UpdateDatabase extends Pman
 
             echo "$bfn:   $cmd ". ($ff->cli ? "\n" : "<BR>\n");
 
-
             passthru($cmd);
 
             if ($fn) {
@@ -724,8 +725,16 @@ class Pman_Core_UpdateDatabase extends Pman
         $db->query("show variables like 'innodb_file_per_table'");
         $db->fetch();
         var_dump($db);
+        // Value should == ON
+        
+        // I think it needs to look in the mysql directory.... to see if the idb exists..
+        $db = DB_DataObject::factory('core_enum');
+        $db->query("SHOW TABLE STATUS");
+        // Engine should be InnoDB - and file XXX.idb should exist...
+        
         
 
         
         
         
@@ -824,4 +833,25 @@ class Pman_Core_UpdateDatabase extends Pman
        
     }
     
+    function fixLinks()
+    {
+        
+        $ff = HTML_Flexyframework::get();
+        
+        $dburl = parse_url($ff->DB_DataObject['database']);
+        
+        $dbtype = $dburl['scheme'];
+       
+        $scls = ucfirst($dbtype). 'Links';
+        $cls = 'Pman_Core_UpdateDatabase_'. $scls;
+        $fn = implode('/',explode('_', $cls)).'.php';
+        if (!file_exists(__DIR__.'/UpdateDatabase/'. $scls .'.php')) {
+            return;
+        }
+        require_once $fn;
+        $c = new $cls();
+        
+        
+        
+    }
 }
\ No newline at end of file