2
0
stany.ferer 1 жил өмнө
parent
commit
d34f14ac18

+ 14 - 0
core/class/git.class.php

@@ -0,0 +1,14 @@
+<?php 
+
+class git
+{
+    public static function getVersion()
+    {
+        $commitHash = trim(exec('git log --pretty="%h" -n1 HEAD'));
+
+        $commitDate = new \DateTime(trim(exec('git log -n1 --pretty=%ci HEAD')));
+        $commitDate->setTimezone(new \DateTimeZone('UTC'));
+
+        return sprintf('%s (%s)', $commitHash, $commitDate->format('Y-m-d H:i:s'));
+    }
+}

+ 5 - 0
core/views/pages/cms.parametres-general.php

@@ -67,6 +67,11 @@
 
 <?php } ?>
 
+    <h4>Infos Git</h4>
+    <div class="element-parametres">
+        <?php echo git::getVersion() ?>
+    </div>
+
 <script>
     $(document).ready(function() {
         $('#checkMaintenance').on('change', function() {