UpdateDatabase.php
authorAlan Knowles <alan@roojs.com>
Fri, 15 Nov 2013 06:00:52 +0000 (14:00 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 15 Nov 2013 06:00:52 +0000 (14:00 +0800)
UpdateDatabase.php

index 3ed1c33..0ce9144 100644 (file)
@@ -87,7 +87,7 @@ class Pman_Xtuple_UpdateDatabase extends Pman
         }
         
         foreach($opts as $o=>$v) {
-            if (!empty(preg_match('/^json-/', $o)) {
+            if (preg_match('/^json-/', $o) && !empty($v)) {
                 continue;
             }
             if (!file_exists($v)) {
@@ -99,11 +99,9 @@ class Pman_Xtuple_UpdateDatabase extends Pman
     }
     function loadFromFile($db, $file)
     {
-        if (!file_exists($file)) {
-            die("can not found account json file :$file \n");
-        }
+        
 
-        $accounts = json_decode(file_get_contents($opt['source']),true);
+        $accounts = json_decode(file_get_contents($file),true);
         
         DB_DataObject::factory('accnt')->importFromArray($this, $accounts);