4 use Friendica\Core\Config;
6 require_once("boot.php");
9 $a = new App(dirname(__DIR__));
12 @include(".htconfig.php");
14 $lang = get_browser_language();
15 load_translation_table($lang);
17 require_once("include/dba.php");
18 dba::connect($db_host, $db_user, $db_pass, $db_data, false);
19 unset($db_host, $db_user, $db_pass, $db_data);
25 $maint_mode = intval($argv[1]);
28 Config::set('system', 'maintenance', $maint_mode);
30 if ($maint_mode && ($argc > 2)) {
32 array_shift($reason_arr);
33 array_shift($reason_arr);
35 $reason = implode(' ', $reason_arr);
36 Config::set('system', 'maintenance_reason', $reason);
38 Config::set('system', 'maintenance_reason', '');
42 $mode_str = "maintenance mode";
44 $mode_str = "normal mode";
47 echo "\n\tSystem set in $mode_str\n";
50 echo "\tMaintenance reason: $reason\n\n";
56 echo "\tphp {$argv[0]} [1] [Maintenance reason|redirection url]\n";
57 echo "\t\tSet the system in maintenance mode\n\n";
58 echo "\t\tIf the optionally entered maintenance reason is an url\n";
59 echo "\t\tthe visitor is redirected to that page.\n";
61 echo "\t\tExamples:\n";
62 echo "\t\t\tphp {$argv[0]} 1 System upgrade\n";
63 echo "\t\t\tphp {$argv[0]} 1 http://domain.tld/downtime\n";
65 echo "\tphp {$argv[0]} 0\n";
66 echo "\t\tSet the system in normal mode\n\n";