public function getLocalVersion()
{
if (file_exists(BASE_PATH . "/.git/HEAD")) {
$tmp = file_get_contents(BASE_PATH . "/.git/HEAD");
if (strpos($tmp, "ref:") === false) {
$data[0]['version'] = trim($tmp);
} else {
$data[0]['version'] = trim(file_get_contents(BASE_PATH . "/.git/" . trim(str_replace('ref: ', '', $tmp))));
}
$data[0]['name'] = "";
if (file_exists(DATA . "/version.php")) {
$data[0]['optout'] = "true";
}
} else {
$data = getJSON('version.php');
}
return $data;
}