Skip to content

Commit eef549b

Browse files
committed
Simplified extra functions
1 parent 4aa5a86 commit eef549b

File tree

3 files changed

+30
-32
lines changed

3 files changed

+30
-32
lines changed

app/Functions/externalfiles.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/Functions/findfile.php renamed to app/Functions/functions.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,32 @@ function infoIcon($tip) {
9595
</a>
9696
</div>
9797
';
98-
}
98+
}
99+
100+
function external_file_get_contents($url) {
101+
$ch = curl_init();
102+
curl_setopt($ch, CURLOPT_URL, $url);
103+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
104+
curl_setopt($ch, CURLOPT_HEADER, false);
105+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
106+
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0');
107+
$data = curl_exec($ch);
108+
curl_close($ch);
109+
return $data;
110+
}
111+
112+
function uri($path) {
113+
$url = str_replace(['http://', 'https://'], '', url(''));
114+
return "//" . $url . "/" . $path;
115+
}
116+
117+
function footer($key)
118+
{
119+
$upperStr = strtoupper($key);
120+
if (env('TITLE_FOOTER_'.$upperStr) == "") {
121+
$title = __('messages.footer.'.$key);
122+
} else {
123+
$title = env('TITLE_FOOTER_'.$upperStr);
124+
}
125+
return $title;
126+
}

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
},
3333
"autoload": {
3434
"files": [
35-
"app/Functions/findfile.php",
36-
"app/Functions/externalfiles.php"
35+
"app/Functions/functions.php"
3736
],
3837
"psr-4": {
3938
"App\\": "app/",

0 commit comments

Comments
 (0)