UpdateDatabase.php
authorAlan Knowles <alan@roojs.com>
Fri, 6 Dec 2013 06:46:14 +0000 (14:46 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 6 Dec 2013 06:46:14 +0000 (14:46 +0800)
UpdateDatabase.php

index f17bb93..9539f59 100644 (file)
@@ -121,6 +121,10 @@ class Pman_Core_UpdateDatabase extends Pman
      
     function get($args, $opts)
     {
+        
+        PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
+   
+        
         //$this->fixSequencesPgsql();exit;
         $this->opts = $opts;
         
@@ -129,10 +133,7 @@ class Pman_Core_UpdateDatabase extends Pman
         $this->checkOpts($opts);
         
         
-        if (!empty($opts['add-company'])) {
-            DB_DataObject::factory('companies')->initCompanies($this, $opts);
-        }
-        
+     
         if (empty($opts['data-only'])) {
             $this->importSQL();
         }
@@ -141,6 +142,11 @@ class Pman_Core_UpdateDatabase extends Pman
         }
         
         $this->runUpdateModulesData();
+        
+        
+        if (!empty($opts['add-company'])) {
+            DB_DataObject::factory('companies')->initCompanies($this, $opts);
+        }
          
     }
     function output() {