From 9ace83cad14cdeb6ecec7021066ffce10b04eac4 Mon Sep 17 00:00:00 2001 From: Antonio Fernandez Date: Fri, 26 Jul 2024 15:49:06 -0400 Subject: [PATCH] adding function to be used in app/messages (#7073) --- resources/functions.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/resources/functions.php b/resources/functions.php index 73d341c7e7..68e70a68c7 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -2455,4 +2455,17 @@ if (!function_exists('git_find_repos')) { } } +//get contents of the supplied url +if (!function_exists('url_get_contents')) { + function url_get_contents($URL){ + $ch = curl_init(); + curl_setopt($ch, CURLOPT_VERBOSE, 1); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_URL, $URL); + $data = curl_exec($ch); + curl_close($ch); + return $data; + } +} + ?>