3 use \Friendica\Core\Config;
5 require_once("boot.php");
8 @include(".htconfig.php");
10 $lang = get_browser_language();
11 load_translation_table($lang);
13 require_once("include/dba.php");
14 $db = new dba($db_host, $db_user, $db_pass, $db_data, false);
15 unset($db_host, $db_user, $db_pass, $db_data);
21 $maint_mode = intval($argv[1]);
24 Config::set('system', 'maintenance', $maint_mode);
26 if ($maint_mode AND ($argc > 2)) {
28 array_shift($reason_arr);
29 array_shift($reason_arr);
31 $reason = implode(' ', $reason_arr);
32 Config::set('system', 'maintenance_reason', $reason);
34 Config::set('system', 'maintenance_reason', '');
38 $mode_str = "maintenance mode";
40 $mode_str = "normal mode";
43 echo "\n\tSystem set in $mode_str\n";
46 echo "\tMaintenance reason: $reason\n\n";
52 echo "\tphp {$argv[0]} [1] [Maintenance reason|redirection url]\n";
53 echo "\t\tSet the system in maintenance mode\n\n";
54 echo "\t\tIf the optionally entered maintenance reason is an url\n";
55 echo "\t\tthe visitor is redirected to that page.\n";
57 echo "\t\tExamples:\n";
58 echo "\t\t\tphp {$argv[0]} 1 System upgrade\n";
59 echo "\t\t\tphp {$argv[0]} 1 http://domain.tld/downtime\n";
61 echo "\tphp {$argv[0]} 0\n";
62 echo "\t\tSet the system in normal mode\n\n";