From 95c4cf061ab67f28a12e34c0c7098ef5a73d353a Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 19 Feb 2018 13:15:14 +0400 Subject: Rename the function to reset the cache --- lib.php | 8 ++++---- locallib.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib.php b/lib.php index 422c108..0b35651 100644 --- a/lib.php +++ b/lib.php @@ -128,7 +128,7 @@ function local_webhooks_create_record($record) { $result = $DB->insert_record("local_webhooks_service", $record, true, false); /* Clear the plugin cache */ - local_webhooks_cache_delete_all(); + local_webhooks_cache_reset(); /* Event notification */ local_webhooks_events::service_added($result); @@ -153,7 +153,7 @@ function local_webhooks_update_record($record) { $result = $DB->update_record("local_webhooks_service", $record, false); /* Clear the plugin cache */ - local_webhooks_cache_delete_all(); + local_webhooks_cache_reset(); /* Event notification */ local_webhooks_events::service_updated($record->id); @@ -173,7 +173,7 @@ function local_webhooks_delete_record($serviceid) { $result = $DB->delete_records("local_webhooks_service", array("id" => $serviceid)); /* Clear the plugin cache */ - local_webhooks_cache_delete_all(); + local_webhooks_cache_reset(); /* Event notification */ local_webhooks_events::service_deleted($serviceid); @@ -192,7 +192,7 @@ function local_webhooks_delete_all_records() { $result = $DB->delete_records("local_webhooks_service", null); /* Clear the plugin cache */ - local_webhooks_cache_delete_all(); + local_webhooks_cache_reset(); /* Event notification */ local_webhooks_events::service_deletedall(); diff --git a/locallib.php b/locallib.php index 54d2bd4..4d941ce 100644 --- a/locallib.php +++ b/locallib.php @@ -63,7 +63,7 @@ function local_webhooks_cache_delete($eventname) { * * @return boolean */ -function local_webhooks_cache_delete_all() { +function local_webhooks_cache_reset() { $cache = cache::make("local_webhooks", "webhooks_services"); return $cache->purge(); } -- cgit v1.2.3