Transferring internal functions to the internal library

This commit is contained in:
Valentin Popov 2018-02-19 13:44:11 +04:00
parent a68882140b
commit a41dbbb950
2 changed files with 22 additions and 22 deletions

22
lib.php
View File

@ -259,25 +259,3 @@ function local_webhooks_send_request($event, $callback) {
return $response; return $response;
} }
/**
* Data serialization.
*
* @param array|object $data
* @return string
*/
function local_webhooks_serialization_data($data) {
$result = serialize($data);
return $result;
}
/**
* Data deserialization.
*
* @param string $data
* @return array|object
*/
function local_webhooks_deserialization_data($data) {
$result = unserialize($data);
return $result;
}

View File

@ -68,6 +68,28 @@ function local_webhooks_cache_reset() {
return $cache->purge(); return $cache->purge();
} }
/**
* Data serialization.
*
* @param array|object $data
* @return string
*/
function local_webhooks_serialization_data($data) {
$result = serialize($data);
return $result;
}
/**
* Data deserialization.
*
* @param string $data
* @return array|object
*/
function local_webhooks_deserialization_data($data) {
$result = unserialize($data);
return $result;
}
/** /**
* Description of functions of the call of events * Description of functions of the call of events
* *