Skip to content

Commit

Permalink
Add Current App Version by checking the current commit hash, also mov…
Browse files Browse the repository at this point in the history
…ed Database version on top with App Version in Debug
  • Loading branch information
johnnyq committed Dec 16, 2024
1 parent 803704c commit 829ee37
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions admin_debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

$checks = [];

// Execute the git command to get the latest commit hash
$commitHash = exec('git log -1 --format=%H');

// Section: System Information
$systemInfo = [];

Expand Down Expand Up @@ -316,10 +319,6 @@ function getDirStats($dir) {
}
$tablesResult->free();

$databaseStats[] = [
'name' => 'Current Database Version',
'value' => CURRENT_DATABASE_VERSION,
];
$databaseStats[] = [
'name' => 'Total number of tables',
'value' => $totalTables,
Expand Down Expand Up @@ -518,6 +517,17 @@ function getDirStats($dir) {
</ul>
<hr>

<table class="table table-bordered mb-3">
<tr>
<td>Current App Version</td>
<th><?php echo $commitHash; ?></th>
</tr>
<tr>
<td>Current DB Version</td>
<th><?php echo CURRENT_DATABASE_VERSION; ?></th>
</tr>
</table>

<!-- System Information Table -->
<h3>System Information</h3>
<table class="table table-sm table-bordered">
Expand Down

0 comments on commit 829ee37

Please sign in to comment.