1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-02 17:29:20 +02:00
Oinktube/git.json.php
Daniel 2a9630258f https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556
Also check the lang in case insensitive
2022-03-14 14:28:38 -03:00

19 lines
469 B
PHP

<?php
header('Content-Type: application/json');
$cmd = "git log -1";
exec($cmd . " 2>&1", $output, $return_val);
$obj = new stdClass();
$obj->output = $output;
foreach ($output as $value) {
preg_match("/Date:(.*)/i", $value, $match);
if (!empty($match[1])) {
$obj->date = strtotime($match[1]);
$obj->dateString = trim($match[1]);
$obj->dateMySQL = date("Y-m-d H:i:s", $obj->date);
}
}
echo json_encode($obj);