浏览代码

adding function to be used in app/messages (#7073)

Antonio Fernandez 1 年之前
父节点
当前提交
2a961a82b6
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      resources/functions.php

+ 13 - 0
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;
+	}
+}
+
 ?>