add db_update cmdline script
This commit is contained in:
parent
e1e6d2fa3e
commit
e9fb809a2d
26
util/db_update.php
Normal file
26
util/db_update.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
require_once("boot.php");
|
||||
|
||||
$a = new App;
|
||||
@include(".htconfig.php");
|
||||
|
||||
$lang = get_language();
|
||||
load_translation_table($lang);
|
||||
|
||||
require_once("dba.php");
|
||||
$db = new dba($db_host, $db_user, $db_pass, $db_data, false);
|
||||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
$build = get_config('system','build');
|
||||
|
||||
echo "Old DB VERSION: " . $build . "\n";
|
||||
echo "New DB VERSION: " . DB_UPDATE_VERSION . "\n";
|
||||
|
||||
|
||||
if($build != DB_UPDATE_VERSION) {
|
||||
echo "Updating database...";
|
||||
check_config();
|
||||
echo "Done\n";
|
||||
}
|
||||
|
Loading…
Reference in a new issue