UpdateDatabase.php
authorEdward <edward@roojs.com>
Wed, 22 May 2013 10:38:45 +0000 (18:38 +0800)
committerEdward <edward@roojs.com>
Wed, 22 May 2013 10:38:45 +0000 (18:38 +0800)
UpdateDatabase.php

index 5b0b7b0..b9c5bae 100644 (file)
@@ -75,6 +75,12 @@ class Pman_Core_UpdateDatabase extends Pman
                 die("Missing Source directory for account json files! Try -f [JSON file path] \n");
             }
             
+            if (!file_exists($opt['source'])) {
+                die("can not found account json file : {$opt['source']} \n");
+            }
+
+            $accounts = json_decode(file_get_contents($source),true);
+            
             DB_DataObject::factory('accnt')->importFromJson($opt['source']);
             die("DONE! \n");
         }