OpenXE/cronjobs/githash.php

17 lines
336 B
PHP
Raw Normal View History

<?php
2022-10-14 14:18:26 +02:00
/* Copyright (c) 2022 OpenXE-org */
/*
Refresh the githash number in githash.txt
*/
$path = '../.git/';
if (!is_dir($path)) {
return;
}
$head = trim(substr(file_get_contents($path . 'HEAD'), 4));
$hash = trim(file_get_contents(sprintf($path . $head)));
if (!empty($hash)) {
file_put_contents("../githash.txt", $hash);
}
?>