mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2025-01-12 14:51:14 +01:00
upgrade added info and -o option
This commit is contained in:
parent
6a5679ba23
commit
817dd802aa
@ -91,6 +91,12 @@ if (php_sapi_name() == "cli") {
|
|||||||
$force = false;
|
$force = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (in_array('-o', $argv)) {
|
||||||
|
$origin = true;
|
||||||
|
} else {
|
||||||
|
$origin = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (in_array('-connection', $argv)) {
|
if (in_array('-connection', $argv)) {
|
||||||
$connection = true;
|
$connection = true;
|
||||||
} else {
|
} else {
|
||||||
@ -121,7 +127,7 @@ if (php_sapi_name() == "cli") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($check_git || $check_db || $do_git || $do_db) {
|
if ($check_git || $check_db || $do_git || $do_db) {
|
||||||
upgrade_main($directory,$verbose,$check_git,$do_git,$export_db,$check_db,$do_db,$force,$connection);
|
upgrade_main($directory,$verbose,$check_git,$do_git,$export_db,$check_db,$do_db,$force,$connection,$origin);
|
||||||
} else {
|
} else {
|
||||||
info();
|
info();
|
||||||
}
|
}
|
||||||
@ -133,7 +139,7 @@ if (php_sapi_name() == "cli") {
|
|||||||
}
|
}
|
||||||
// -------------------------------- END
|
// -------------------------------- END
|
||||||
|
|
||||||
function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do_git, bool $export_db, bool $check_db, bool $do_db, bool $force, bool $connection) {
|
function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do_git, bool $export_db, bool $check_db, bool $do_db, bool $force, bool $connection, bool $origin) {
|
||||||
|
|
||||||
$mainfolder = dirname($directory);
|
$mainfolder = dirname($directory);
|
||||||
$datafolder = $directory."/data";
|
$datafolder = $directory."/data";
|
||||||
@ -146,12 +152,16 @@ function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do
|
|||||||
|
|
||||||
//require_once($directory.'/../cronjobs/githash.php');
|
//require_once($directory.'/../cronjobs/githash.php');
|
||||||
|
|
||||||
$remote_info_contents = file_get_contents($remote_file_name);
|
if ($origin) {
|
||||||
if (!$remote_info_contents) {
|
$remote_info = array('host' => 'origin','branch' => 'master');
|
||||||
abort("Unable to load $remote_file_name");
|
} else {
|
||||||
return(-1);
|
$remote_info_contents = file_get_contents($remote_file_name);
|
||||||
|
if (!$remote_info_contents) {
|
||||||
|
abort("Unable to load $remote_file_name");
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
|
$remote_info = json_decode($remote_info_contents, true);
|
||||||
}
|
}
|
||||||
$remote_info = json_decode($remote_info_contents, true);
|
|
||||||
|
|
||||||
if ($check_git || $do_git) {
|
if ($check_git || $do_git) {
|
||||||
|
|
||||||
@ -463,6 +473,7 @@ function info() {
|
|||||||
echo_out("\t-do: execute all upgrades\n");
|
echo_out("\t-do: execute all upgrades\n");
|
||||||
echo_out("\t-v: verbose output\n");
|
echo_out("\t-v: verbose output\n");
|
||||||
echo_out("\t-f: force override of existing files\n");
|
echo_out("\t-f: force override of existing files\n");
|
||||||
|
echo_out("\t-o: update from origin instead of remote.json\n");
|
||||||
echo_out("\t-connection use connection.json in data folder instead of user.inc.php\n");
|
echo_out("\t-connection use connection.json in data folder instead of user.inc.php\n");
|
||||||
echo_out("\t-clean: (not yet implemented) create the needed SQL to remove items from the database not in the JSON\n");
|
echo_out("\t-clean: (not yet implemented) create the needed SQL to remove items from the database not in the JSON\n");
|
||||||
echo_out("\n");
|
echo_out("\n");
|
||||||
|
@ -10,6 +10,19 @@
|
|||||||
-->
|
-->
|
||||||
<div id="tabs-1">
|
<div id="tabs-1">
|
||||||
[MESSAGE]
|
[MESSAGE]
|
||||||
|
<div class="row">
|
||||||
|
<div class="row-height">
|
||||||
|
<div class="col-xs-14 col-md-12 col-md-height">
|
||||||
|
<div class="inside inside-full-height">
|
||||||
|
<fieldset>
|
||||||
|
<legend>{|Info|}</legend>
|
||||||
|
Das Upgrade funktioniert in 2 Schritten: Dateien aktualisieren, Datenbank auffrischen. Wenn das Upgrade lange läuft, kann der Fortschritt in einem neuen Fenster mit "Anzeige auffrischen" angezeigt werden.<br><br>
|
||||||
|
Zum Start in der Konsole, im Unterordner "upgrade" diesen Befehl starten: <pre>sudo -u www-data php upgrade.php -do</pre>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
[FORMHANDLEREVENT]
|
[FORMHANDLEREVENT]
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -54,11 +67,11 @@
|
|||||||
<tr><td colspan=2><button name="submit" value="refresh" class="ui-button-icon" style="width:100%;">Anzeige auffrischen</button></td></tr>
|
<tr><td colspan=2><button name="submit" value="refresh" class="ui-button-icon" style="width:100%;">Anzeige auffrischen</button></td></tr>
|
||||||
<tr><td colspan=2><button name="submit" value="check_upgrade" class="ui-button-icon" style="width:100%;">Upgrades prüfen</button></td></tr>
|
<tr><td colspan=2><button name="submit" value="check_upgrade" class="ui-button-icon" style="width:100%;">Upgrades prüfen</button></td></tr>
|
||||||
<tr><td style="width:100%;">{|Upgrade-Details anzeigen|}:</td><td><input type="checkbox" name="details_anzeigen" value=1 [DETAILS_ANZEIGEN] size="20"></td></tr>
|
<tr><td style="width:100%;">{|Upgrade-Details anzeigen|}:</td><td><input type="checkbox" name="details_anzeigen" value=1 [DETAILS_ANZEIGEN] size="20"></td></tr>
|
||||||
<tr [UPGRADE_VISIBLE]><td colspan=2><button name="submit" value="do_upgrade" class="ui-button-icon" style="width:100%;">UPGRADE</button></td></tr>
|
<tr [UPGRADE_VISIBLE]><td colspan=2><button name="submit" formtarget="_blank" value="do_upgrade" class="ui-button-icon" style="width:100%;">UPGRADE</button></td></tr>
|
||||||
<tr [UPGRADE_VISIBLE]><td style="width:100%;">{|Erzwingen (-f)|}:</td><td><input type="checkbox" name="erzwingen" value=1 [ERZWINGEN] size="20"></td></tr>
|
<tr [UPGRADE_VISIBLE]><td style="width:100%;">{|Erzwingen (-f)|}:</td><td><input type="checkbox" name="erzwingen" value=1 [ERZWINGEN] size="20"></td></tr>
|
||||||
<tr><td colspan=2><button name="submit" value="check_db" class="ui-button-icon" style="width:100%;">Datenbank prüfen</button></td></tr>
|
<tr><td colspan=2><button name="submit" value="check_db" class="ui-button-icon" style="width:100%;">Datenbank prüfen</button></td></tr>
|
||||||
<tr><td style="width:100%;">{|Datenbank-Details anzeigen|}:</td><td><input type="checkbox" name="db_details_anzeigen" value=1 [DB_DETAILS_ANZEIGEN] size="20"></td></tr>
|
<tr><td style="width:100%;">{|Datenbank-Details anzeigen|}:</td><td><input type="checkbox" name="db_details_anzeigen" value=1 [DB_DETAILS_ANZEIGEN] size="20"></td></tr>
|
||||||
<tr [UPGRADE_DB_VISIBLE]><td colspan=2><button name="submit" value="do_db_upgrade" class="ui-button-icon" style="width:100%;">Datenbank UPGRADE</button></td></tr>
|
<tr [UPGRADE_DB_VISIBLE]><td colspan=2><button name="submit" formtarget="_blank" value="do_db_upgrade" class="ui-button-icon" style="width:100%;">Datenbank UPGRADE</button></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
@ -41,7 +41,7 @@ class upgrade {
|
|||||||
$this->app->Tpl->Set('UPGRADE_VISIBLE', "hidden");
|
$this->app->Tpl->Set('UPGRADE_VISIBLE', "hidden");
|
||||||
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "hidden");
|
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "hidden");
|
||||||
|
|
||||||
//function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do_git, bool $export_db, bool $check_db, bool $do_db, bool $force, bool $connection)
|
//function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do_git, bool $export_db, bool $check_db, bool $do_db, bool $force, bool $connection, bool $origin) {
|
||||||
|
|
||||||
$directory = dirname(getcwd())."/upgrade";
|
$directory = dirname(getcwd())."/upgrade";
|
||||||
|
|
||||||
@ -49,21 +49,21 @@ class upgrade {
|
|||||||
case 'check_upgrade':
|
case 'check_upgrade':
|
||||||
$this->app->Tpl->Set('UPGRADE_VISIBLE', "");
|
$this->app->Tpl->Set('UPGRADE_VISIBLE', "");
|
||||||
unlink($logfile);
|
unlink($logfile);
|
||||||
upgrade_main($directory,$verbose,true,false,false,true,false,$force,false);
|
upgrade_main($directory,$verbose,true,false,false,true,false,$force,false,false);
|
||||||
break;
|
break;
|
||||||
case 'do_upgrade':
|
case 'do_upgrade':
|
||||||
unlink($logfile);
|
unlink($logfile);
|
||||||
upgrade_main($directory,$verbose,true,true,false,true,true,$force,false);
|
upgrade_main($directory,$verbose,true,true,false,true,true,$force,false,false);
|
||||||
break;
|
break;
|
||||||
case 'check_db':
|
case 'check_db':
|
||||||
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "");
|
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "");
|
||||||
unlink($logfile);
|
unlink($logfile);
|
||||||
upgrade_main($directory,$db_verbose,false,false,false,true,false,$force,false);
|
upgrade_main($directory,$db_verbose,false,false,false,true,false,$force,false,false);
|
||||||
break;
|
break;
|
||||||
case 'do_db_upgrade':
|
case 'do_db_upgrade':
|
||||||
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "");
|
$this->app->Tpl->Set('UPGRADE_DB_VISIBLE', "");
|
||||||
unlink($logfile);
|
unlink($logfile);
|
||||||
upgrade_main($directory,$db_verbose,false,false,false,true,true,$force,false);
|
upgrade_main($directory,$db_verbose,false,false,false,true,true,$force,false,false);
|
||||||
break;
|
break;
|
||||||
case 'refresh':
|
case 'refresh':
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user