4 use Friendica\Core\Config;
6 require_once("boot.php");
9 @include(".htconfig.php");
11 $lang = get_browser_language();
12 load_translation_table($lang);
14 require_once("include/dba.php");
15 $db = new dba($db_host, $db_user, $db_pass, $db_data, false);
16 unset($db_host, $db_user, $db_pass, $db_data);
22 $maint_mode = intval($argv[1]);
25 Config::set('system', 'maintenance', $maint_mode);
27 if ($maint_mode AND ($argc > 2)) {
29 array_shift($reason_arr);
30 array_shift($reason_arr);
32 $reason = implode(' ', $reason_arr);
33 Config::set('system', 'maintenance_reason', $reason);
35 Config::set('system', 'maintenance_reason', '');
39 $mode_str = "maintenance mode";
41 $mode_str = "normal mode";
44 echo "\n\tSystem set in $mode_str\n";
47 echo "\tMaintenance reason: $reason\n\n";
53 echo "\tphp {$argv[0]} [1] [Maintenance reason|redirection url]\n";
54 echo "\t\tSet the system in maintenance mode\n\n";
55 echo "\t\tIf the optionally entered maintenance reason is an url\n";
56 echo "\t\tthe visitor is redirected to that page.\n";
58 echo "\t\tExamples:\n";
59 echo "\t\t\tphp {$argv[0]} 1 System upgrade\n";
60 echo "\t\t\tphp {$argv[0]} 1 http://domain.tld/downtime\n";
62 echo "\tphp {$argv[0]} 0\n";
63 echo "\t\tSet the system in normal mode\n\n";