}
foreach($opts as $o=>$v) {
- if (!empty(preg_match('/^json-/', $o)) {
+ if (preg_match('/^json-/', $o) && !empty($v)) {
continue;
}
if (!file_exists($v)) {
}
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);