mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
cronjob githash.php modified to work with ZIP-installed system too
This commit is contained in:
parent
23f390a74f
commit
c248cb16fb
@ -7,9 +7,15 @@ $path = '../.git/';
|
||||
if (!is_dir($path)) {
|
||||
return;
|
||||
}
|
||||
$head = trim(substr(file_get_contents($path . 'HEAD'), 4));
|
||||
$hash = trim(file_get_contents(sprintf($path . $head)));
|
||||
|
||||
$head = trim(file_get_contents($path . 'HEAD'));
|
||||
$refs = trim(substr($head,0,4));
|
||||
if ($refs == 'ref:') {
|
||||
$ref = substr($head,5);
|
||||
echo($path.$ref."\n");
|
||||
$hash = trim(file_get_contents($path . $ref));
|
||||
} else {
|
||||
$hash = $head;
|
||||
}
|
||||
if (!empty($hash)) {
|
||||
file_put_contents("../githash.txt", $hash);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user