friendica/util/db_update.php

38 lines
656 B
PHP
Raw Normal View History

2012-01-15 18:02:48 -05:00
<?php
2017-05-02 22:42:29 -04:00
/**
2017-05-02 22:42:29 -04:00
* @package util
*/
2012-01-15 18:02:48 -05:00
use Friendica\App;
use Friendica\Core\Config;
2017-04-30 00:01:26 -04:00
/*
2017-05-02 22:42:29 -04:00
* require boot.php
*/
2012-01-15 18:02:48 -05:00
require_once("boot.php");
2017-10-11 10:52:08 -04:00
if (empty($a)) {
$a = new App(dirname(__DIR__));
}
2012-01-15 18:02:48 -05:00
@include(".htconfig.php");
$lang = get_browser_language();
2012-01-15 18:02:48 -05:00
load_translation_table($lang);
2012-12-28 16:51:50 -05:00
require_once("include/dba.php");
2017-10-11 08:56:36 -04:00
dba::connect($db_host, $db_user, $db_pass, $db_data, false);
2017-05-02 22:42:29 -04:00
unset($db_host, $db_user, $db_pass, $db_data);
2012-01-15 18:02:48 -05:00
$build = Config::get('system', 'build');
2012-01-15 18:02:48 -05:00
echo "Old DB VERSION: " . $build . "\n";
echo "New DB VERSION: " . DB_UPDATE_VERSION . "\n";
2017-05-02 22:42:29 -04:00
if ($build != DB_UPDATE_VERSION) {
2012-01-15 18:02:48 -05:00
echo "Updating database...";
update_db($a);
2012-01-15 18:02:48 -05:00
echo "Done\n";
}