aboutsummaryrefslogtreecommitdiff
path: root/lib.php
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-11-23 20:55:40 +0300
committerValentin Popov <info@valentineus.link>2017-11-23 20:55:40 +0300
commit2ae949bbc396b68beeb2ee6cfd5c7c0d0843d9cb (patch)
treefe3d40b6e0a268f8de96d50058b2a891d1e9cbc1 /lib.php
parentde3c3a655329f7c4cbd9d7612fdc66ec5266c3e7 (diff)
downloadlocal_webhooks-2ae949bbc396b68beeb2ee6cfd5c7c0d0843d9cb.tar.xz
local_webhooks-2ae949bbc396b68beeb2ee6cfd5c7c0d0843d9cb.zip
Adding a logging system
Diffstat (limited to 'lib.php')
-rw-r--r--lib.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib.php b/lib.php
index c423e9b..a63d8a4 100644
--- a/lib.php
+++ b/lib.php
@@ -24,6 +24,8 @@
defined("MOODLE_INTERNAL") || die();
+require_once(__DIR__ . "/locallib.php");
+
/**
* Getting a list of all services.
*
@@ -81,6 +83,7 @@ function local_webhooks_remove_record($serviceid = 0) {
global $DB;
$DB->delete_records("local_webhooks_service", array("id" => $serviceid));
+ local_webhooks_events::service_deleted($serviceid);
}
/**
@@ -101,8 +104,10 @@ function local_webhooks_update_record($data, $insert = true) {
if (boolval($insert)) {
$result = $DB->insert_record("local_webhooks_service", $data, true, false);
+ local_webhooks_events::service_added($result);
} else {
$result = $DB->update_record("local_webhooks_service", $data, false);
+ local_webhooks_events::service_updated($data->id);
}
return boolval($result);
@@ -116,6 +121,7 @@ function local_webhooks_update_record($data, $insert = true) {
function local_webhooks_create_backup() {
$listservices = local_webhooks_get_list_records();
$listservices = local_webhooks_archiving_data($listservices);
+ local_webhooks_events::backup_performed();
return $listservices;
}
@@ -132,6 +138,8 @@ function local_webhooks_restore_backup($listservices = "") {
foreach ($listservices as $servicerecord) {
local_webhooks_update_record($servicerecord, true);
}
+
+ local_webhooks_events::backup_restored();
}
/**