From ec249d465b60407b2e7c64e7a99be8ccf4b95e64 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 16 Jul 2015 20:19:20 -0700 Subject: provide a way to export a single year of items (to potentially keep from exhausting resources either on export or import) --- mod/uexport.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mod') 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())); -- cgit v1.2.3