blob: a515402f5d42e32cb17f9cfc739622f2cf6274aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<?php
/**
* Helper Functions
*/
function featherIcon(string $name)
{
echo file_get_contents(
$_SERVER['DOCUMENT_ROOT']
. '/..' . '/public/css/fonts/feather-icons/' . $name . '.svg'
);
}
function base64(string $path)
{
echo base64_encode(
file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/..' . $path)
);
}
function fetch(string $path, string $field)
{
$config = include $_SERVER['DOCUMENT_ROOT'] . '/..' . '/AppConfig.php';;
$json = file_get_contents(
'http://' . $_SERVER['SERVER_NAME']
. $path . '?token=' . $config['cms']['token']
);
$data = json_decode($json, true);
echo $data[$field];
}
|