Newer
Older
switch ($dirFile['srcType']) {
case 'url':
$curl = curl_init($dirFile['src']);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$content = curl_exec($curl);
curl_close($curl);
break;
case 'path':
if (!file_exists($dirFile['src'])) {
return false;
}
$content = file_get_contents($dirFile['src']);
break;
default:
return false;
break;
function getHostInformation($librehostJsonUrl) {
$hostInformaton = getHostJson($librehostJsonUrl);
return $hostInformaton;
}
function getHostJson($librehostJsonUrl) {
$curl = curl_init($librehostJsonUrl);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
$response = json_decode($response, true);
return $response;
}