use the more portable encoded_item format for exported items - but with added attributes so we can use it as a reasonably complete item backup. The encoded_item format gives us extended author and owner information in case we need to probe them to bring the entry back. It also contains taxonomy entries. Importing and/or recovering will best be accomplished in chunks. It could take some time and some memory to chew through this.

This commit is contained in:
friendica
2014-09-16 03:33:48 -07:00
parent b2f2424b52
commit a1b66f56f0
3 changed files with 32 additions and 16 deletions

View File

@@ -489,18 +489,12 @@ function identity_basic_export($channel_id, $items = false) {
intval($channel_id)
);
if($r) {
for($x = 0; $x < count($r); $x ++) {
if($r[$x]['diaspora_meta'])
$r[$x]['diaspora_meta'] = crypto_unencapsulate(json_decode($r[$x]['diaspora_meta'],true),$key);
if($r[$x]['item_flags'] & ITEM_OBSCURED) {
$r[$x]['item_flags'] = $r[$x]['item_flags'] ^ ITEM_OBSCURED;
if($r[$x]['title'])
$r[$x]['title'] = crypto_unencapsulate(json_decode($r[$x]['title'],true),$key);
if($r[$x]['body'])
$r[$x]['body'] = crypto_unencapsulate(json_decode($r[$x]['body'],true),$key);
}
}
$ret['item'] = $r;
$ret['item'] = array();
xchan_query($r);
$r = fetch_post_tags($r,true);
foreach($r as $rr)
$ret['item'][] = encode_item($rr,true);
}
return $ret;