]> git.mxchange.org Git - friendica.git/blob - util/maintenance.php
Continued:
[friendica.git] / util / maintenance.php
1 <?php
2
3 use \Friendica\Core\Config;
4
5 require_once("boot.php");
6
7 $a = new App;
8 @include(".htconfig.php");
9
10 $lang = get_browser_language();
11 load_translation_table($lang);
12
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);
16
17 Config::load();
18
19 $maint_mode = 1;
20 if ($argc > 1) {
21         $maint_mode = intval($argv[1]);
22 }
23 set_config('system', 'maintenance', $maint_mode);
24
25 if ($maint_mode) {
26         $mode_str = "maintenance mode";
27 } else {
28         $mode_str = "normal mode";
29 }
30
31 echo "\n\tSystem set in $mode_str\n\n";
32 echo "Usage:\n\n";
33 echo "\tphp {$argv[0]} [1]\tSet the system in maintenance mode\n";
34 echo "\tphp {$argv[0]} 0  \tSet the system in normal mode\n\n";
35