Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

63 řádky
1.4 KiB

  1. <?php
  2. use Friendica\Core\Config;
  3. require_once("boot.php");
  4. $a = new App;
  5. @include(".htconfig.php");
  6. $lang = get_browser_language();
  7. load_translation_table($lang);
  8. require_once("include/dba.php");
  9. $db = new dba($db_host, $db_user, $db_pass, $db_data, false);
  10. unset($db_host, $db_user, $db_pass, $db_data);
  11. Config::load();
  12. $maint_mode = 1;
  13. if ($argc > 1) {
  14. $maint_mode = intval($argv[1]);
  15. }
  16. Config::set('system', 'maintenance', $maint_mode);
  17. if ($maint_mode AND ($argc > 2)) {
  18. $reason_arr = $argv;
  19. array_shift($reason_arr);
  20. array_shift($reason_arr);
  21. $reason = implode(' ', $reason_arr);
  22. Config::set('system', 'maintenance_reason', $reason);
  23. } else {
  24. Config::set('system', 'maintenance_reason', '');
  25. }
  26. if ($maint_mode) {
  27. $mode_str = "maintenance mode";
  28. } else {
  29. $mode_str = "normal mode";
  30. }
  31. echo "\n\tSystem set in $mode_str\n";
  32. if ($reason != '') {
  33. echo "\tMaintenance reason: $reason\n\n";
  34. } else {
  35. echo "\n";
  36. }
  37. echo "Usage:\n\n";
  38. echo "\tphp {$argv[0]} [1] [Maintenance reason|redirection url]\n";
  39. echo "\t\tSet the system in maintenance mode\n\n";
  40. echo "\t\tIf the optionally entered maintenance reason is an url\n";
  41. echo "\t\tthe visitor is redirected to that page.\n";
  42. echo "\n";
  43. echo "\t\tExamples:\n";
  44. echo "\t\t\tphp {$argv[0]} 1 System upgrade\n";
  45. echo "\t\t\tphp {$argv[0]} 1 http://domain.tld/downtime\n";
  46. echo "\n";
  47. echo "\tphp {$argv[0]} 0\n";
  48. echo "\t\tSet the system in normal mode\n\n";