Upgrade: Divides Upgrade Schema into separate processes. Complete translation forthcoming. (Still under construction...)

This commit is contained in:
Nate Jones
2014-07-10 06:05:22 +00:00
parent cfb833aa25
commit e89d28495a
7 changed files with 377 additions and 101 deletions
+21 -25
View File
@@ -24,6 +24,10 @@
Mark J Crane <markjcrane@fusionpbx.com>
*/
// set included, if not
if (!isset($included)) { $included = false; }
//check the permission
if(defined('STDIN')) {
$document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]);
@@ -32,15 +36,9 @@
set_include_path($document_root);
require_once "resources/require.php";
$_SERVER["DOCUMENT_ROOT"] = $document_root;
$display_type = 'text'; //html, text
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$response_format = 'text'; //html, text
}
else {
else if (!$included) {
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
@@ -52,35 +50,33 @@
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
require_once "resources/header.php";
$document['title'] = $text['title-upgrade_schema'];
$display_type = 'html'; //html, text
$response_format = 'html'; //html, text
}
//set the default
if (!isset($display_results)) {
$display_results = true;
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//set the default
if (!isset($response_output)) {
$response_output = "echo";
}
//load the default database into memory and compare it with the active database
require_once "resources/schema.php";
db_upgrade_schema ($db, $db_type, $db_name, $display_results);
$response_upgrade_schema = db_upgrade_schema($db, $db_type, $db_name, $response_output);
unset($apps);
//upgrade the domains
$domain_language_code = $_SESSION['domain']['language']['code'];
require_once "core/upgrade/upgrade_domains.php";
$_SESSION['domain']['language']['code'] = $domain_language_code;
unset($domain_language_code);
if ($display_results && $display_type == "html") {
if (!$included && $response_output == 'echo' && $response_format == 'html') {
echo "<br />\n";
echo "<br />\n";
require_once "resources/footer.php";