From 95c54f82627424667af7a4a8af014baeffafa073 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 13 Mar 2018 01:34:19 +0400 Subject: Update function 'local_webhooks_create_backup' Signed-off-by: Valentin Popov --- lib.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib.php b/lib.php index ba27486..f229612 100644 --- a/lib.php +++ b/lib.php @@ -231,13 +231,17 @@ function local_webhooks_delete_all_records() { * @return string */ function local_webhooks_create_backup() { - $listrecords = local_webhooks_get_list_records(); - $result = local_webhooks_serialization_data($listrecords); + $records = local_webhooks_get_list_records(); + $result = false; + + if ($serialize = serialize($records)) { + $result = gzcompress($serialize, 9); + } /* Event notification */ local_webhooks_events::backup_performed(); - return $result; + return base64_encode($result); } /** -- cgit v1.2.3