diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-07-16 20:19:20 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-07-16 20:19:20 -0700 |
commit | ec249d465b60407b2e7c64e7a99be8ccf4b95e64 (patch) | |
tree | 31e96e0a7dc6b1f95c3207638bb5f3491824a780 /mod/uexport.php | |
parent | 964e461e092b15a66da891a0a4c155323e8391e1 (diff) | |
download | volse-hubzilla-ec249d465b60407b2e7c64e7a99be8ccf4b95e64.tar.gz volse-hubzilla-ec249d465b60407b2e7c64e7a99be8ccf4b95e64.tar.bz2 volse-hubzilla-ec249d465b60407b2e7c64e7a99be8ccf4b95e64.zip |
provide a way to export a single year of items (to potentially keep from exhausting resources either on export or import)
Diffstat (limited to 'mod/uexport.php')
-rw-r--r-- | mod/uexport.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mod/uexport.php b/mod/uexport.php index edcb2fa84..b0bb11afa 100644 --- a/mod/uexport.php +++ b/mod/uexport.php @@ -9,9 +9,17 @@ function uexport_init(&$a) { require_once('include/identity.php'); + if(argc() > 1 && intval(argv(1)) > 1900) { + $year = intval(argv(1)); + } + header('content-type: application/octet_stream'); - header('content-disposition: attachment; filename="' . $channel['channel_address'] . '.json"' ); + header('content-disposition: attachment; filename="' . $channel['channel_address'] . (($year) ? '-' . $year : '') . '.json"' ); + if($year) { + echo json_encode(identity_export_year(local_channel(),$year)); + killme(); + } if(argc() > 1 && argv(1) === 'basic') { echo json_encode(identity_basic_export(local_channel())); |