UpdateDatabase.php
[Pman.Core] / UpdateDatabase.php
index 0d65780..952d31a 100644 (file)
@@ -113,7 +113,6 @@ class Pman_Core_UpdateDatabase extends Pman
                   
                 $ret = array_merge($ret, $cls->getStaticPropertyValue('cli_opts'));
             }
-            
         }
         
         return $ret;
@@ -158,7 +157,6 @@ class Pman_Core_UpdateDatabase extends Pman
     
     function get($args, $opts=array())
     {
-         
         PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
    
         $this->checkSystem();
@@ -195,10 +193,28 @@ class Pman_Core_UpdateDatabase extends Pman
         }
         
         // ask all the modules to verify the opts
-        echo "Checi options\n";
+        echo "Checking options\n";
         $this->checkOpts($opts);
         
-          
+        $response = $this->curl("http://localhost{$this->local_base_url}/Core/UpdateDatabase/VerifyExtensions");
+        $json = json_decode($response, true);
+        
+        if(empty($json['data']) || $json['data'] != 'DONE'){
+            echo "\nError: Missing php extensions:\n";
+            print_r($response);
+            echo "Please install the above extensions and restart the apache.\n";
+            exit;
+        }
+        
+        echo "Checking Setup Requirements\n";
+        require_once 'Pman/Core/UpdateDatabase/VerifyConfig.php';
+        $sq = new Pman_Core_UpdateDatabase_VerifyConfig();
+        $ret = $sq->get($args, $opts);
+        
+        if(!empty($ret)){
+            echo implode("\n", $ret) . "\n";
+            sleep(30);
+        }
         
         // do this first, so the innodb change + utf8 fixes column max sizes
         
@@ -891,7 +907,7 @@ class Pman_Core_UpdateDatabase extends Pman
                     $this->jerr("bcc_group {$data['bcc_group']} does not exist when importing template $name");
                 }
                 
-                if (!$g->members('email')) {
+                if (!$g->members('email') && $g->name != 'Empty Group') {
                     $this->jerr("bcc_group {$data['bcc_group']} does not have any members");
                 }
                 
@@ -987,7 +1003,6 @@ class Pman_Core_UpdateDatabase extends Pman
         }
         HTML_FlexyFramework::get()->generateDataobjectsCache(true);
         
-         
         $this->updateDataEnums();
         $this->updateDataGroups();
         $this->updateDataCompanies();
@@ -996,10 +1011,6 @@ class Pman_Core_UpdateDatabase extends Pman
         
         $c = DB_DataObject::Factory('I18n');
         $c->buildDB();
-         
-       
-        
-        
     }
     
     function fixMysqlInnodb()
@@ -1312,7 +1323,7 @@ class Pman_Core_UpdateDatabase extends Pman
         
         foreach ($extensions as $e){
             
-            if(extension_loaded($e)) {
+            if(empty($e) || extension_loaded($e)) {
                 continue;
             }