projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b3a048a
)
UpdateDatabase.php
author
Alan Knowles
<alan@roojs.com>
Fri, 15 Nov 2013 06:18:08 +0000
(14:18 +0800)
committer
Alan Knowles
<alan@roojs.com>
Fri, 15 Nov 2013 06:18:08 +0000
(14:18 +0800)
UpdateDatabase.php
patch
|
blob
|
history
diff --git
a/UpdateDatabase.php
b/UpdateDatabase.php
index
ecb94d9
..
e66d33c
100644
(file)
--- a/
UpdateDatabase.php
+++ b/
UpdateDatabase.php
@@
-504,7
+504,21
@@
class Pman_Core_UpdateDatabase extends Pman
}
}
-
+ function jsonImportFromArray($opts)
+ {
+ foreach($this->opts as $o=>$v) {
+ if (!preg_match('/^json-/', $o) || empty($v)) {
+ continue;
+ }
+ $type = str_replace('_', '-', substr($o,6));
+ $data= json_decode(file_get_contents($file),true);
+ DB_DataObject::factory($type)->importFromArray($data);
+
+ }
+
+
+
+ }
function runUpdateModulesData()
{