diff --git a/settings-update.php b/settings-update.php index f6a8b8f2..12306434 100644 --- a/settings-update.php +++ b/settings-update.php @@ -8,9 +8,9 @@ $latest_version = exec("gitrev-parse origin/master"); $current_version = exec("git rev-parse HEAD"); if($current_version == $latest_version){ - $update_message = "No Updates available"; + $update_message = "No Updates available"; }else{ - $update_message = "New Updates are Available [$latest_version]"; + $update_message = "New Updates are Available [$latest_version]"; } $git_log = shell_exec("git log master..origin/master --pretty=format:'%h%ar%s'"); @@ -18,45 +18,70 @@ $git_log = shell_exec("git log master..origin/master --pretty=format:'%h ?>
-
-

Update

-
-
-
- -
Update App
- -
Update Database
-

Latest version

- - -
+
+

Update

+
+
+
+ +
Update App
+ +
Update Database
+

Latest version

+ + +
+ + + + + + + + + + + + + +
CommitWhenDescription
+ /tmp/current-structure.sql"); + + // Get the new structure from db.sql + exec("egrep -v 'MariaDB dump|Host:|Server version|Dump completed' db.sql > /tmp/new-structure.sql"); + + // Compare + exec("diff /tmp/current-structure.sql /tmp/new-structure.sql > /tmp/diff.txt"); + $diff = file_get_contents("/tmp/diff.txt"); + + // Display, if there is a difference + if(!empty($diff)){ + echo "

Diff between your database structure and db.sql

"; + echo "
$diff
"; + } + + } - - - - - - - - - - - - -
CommitWhenDescription
- -
+ +
-