]> git.mxchange.org Git - friendica.git/blob - mod/maintenance.php
Remove unused global cache constants
[friendica.git] / mod / maintenance.php
1 <?php
2 /**
3  * @file mod/maintenance.php
4  */
5 use Friendica\App;
6 use Friendica\Core\Config;
7 use Friendica\Core\L10n;
8
9 function maintenance_content(App $a)
10 {
11         $reason = Config::get('system', 'maintenance_reason');
12
13         if (substr(normalise_link($reason), 0, 7) == 'http://') {
14                 header("HTTP/1.1 307 Temporary Redirect");
15                 header("Location:".$reason);
16                 return;
17         }
18
19         header('HTTP/1.1 503 Service Temporarily Unavailable');
20         header('Status: 503 Service Temporarily Unavailable');
21         header('Retry-After: 600');
22
23         return replace_macros(get_markup_template('maintenance.tpl'), [
24                 '$sysdown' => L10n::t('System down for maintenance'),
25                 '$reason' => $reason
26         ]);
27 }