aboutsummaryrefslogtreecommitdiff
path: root/lib.php
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2018-03-13 00:34:19 +0300
committerValentin Popov <info@valentineus.link>2018-03-13 00:34:19 +0300
commit95c54f82627424667af7a4a8af014baeffafa073 (patch)
treea136c29b11c7b6bac0c74de4b49a304de176c97d /lib.php
parent6a83be960ec751eb42628e92e90b237efcb62a36 (diff)
downloadlocal_webhooks-95c54f82627424667af7a4a8af014baeffafa073.tar.xz
local_webhooks-95c54f82627424667af7a4a8af014baeffafa073.zip
Update function 'local_webhooks_create_backup'
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'lib.php')
-rw-r--r--lib.php10
1 files 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);
}
/**