DataObjects/Core_notify_recur.php
[Pman.Core] / UpdateDatabase.php
index ff15db6..a35420d 100644 (file)
@@ -155,7 +155,8 @@ class Pman_Core_UpdateDatabase extends Pman
            
             DB_DataObject::factory('companies')->initCompanies($this, $opts);
         }
-        $this->fixLinks();
+        
+        $this->runExtensions();
          
          
     }
@@ -186,7 +187,7 @@ class Pman_Core_UpdateDatabase extends Pman
        
         
         $ar = $this->modulesList();
-       
+        
         
         foreach($ar as $m) {
              echo "Importing SQL from module $m\n";
@@ -737,11 +738,8 @@ class Pman_Core_UpdateDatabase extends Pman
         $db->query("show variables like 'innodb_file_per_table'");
         $db->fetch();
         if ($db->Value == 'OFF') {
-            die("Error: set innodb_file_per_table = ON in my.cnf\n\n");
+            die("Error: set innodb_file_per_table = 1 in my.cnf\n\n");
         }
-        print_r($db);
-        // Value should == ON
-        exit;
         
         $done_check = true;;
 
@@ -844,7 +842,12 @@ class Pman_Core_UpdateDatabase extends Pman
        
     }
     
-    function fixLinks()
+    var $extensions = array(
+        'EngineCharset',
+        'Links',
+    );
+    
+    function runExtensions()
     {
         
         $ff = HTML_Flexyframework::get();
@@ -853,16 +856,18 @@ class Pman_Core_UpdateDatabase extends Pman
         
         $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;
+        foreach($this->extensions as $ext) {
+       
+            $scls = ucfirst($dbtype). $ext;
+            $cls = __CLASS__ . '_'. $scls;
+            $fn = implode('/',explode('_', $cls)).'.php';
+            if (!file_exists(__DIR__.'/UpdateDatabase/'. $scls .'.php')) {
+                return;
+            }
+            require_once $fn;
+            $c = new $cls();
+            
         }
-        require_once $fn;
-        $c = new $cls();
-        
-        
         
     }
 }
\ No newline at end of file