Elgg  Version master
upgrade.php
Go to the documentation of this file.
1 <?php
2 
4 $site_host = parse_url($site_url, PHP_URL_HOST) . '/';
5 
6 // turn any full in-site URLs into absolute paths
7 $forward_url = get_input('forward', '/admin', false);
9 
10 if (elgg_strpos($forward_url, '/') !== 0) {
11  $forward_url = '/' . $forward_url;
12 }
13 
14 $refresh_url = elgg_generate_url('upgrade:run', [
15  'upgrade' => 'upgrade',
16  'forward' => $forward_url,
17 ]);
18 
19 // sign the url in order to get past the protection
21 
22 // render content before head so that JavaScript and CSS can be loaded. See #4032
23 $body = elgg_format_element('div', ['style' => 'margin-top: 200px;'], elgg_view('graphics/ajax_loader', ['hidden' => false]));
24 
25 $head = elgg_view('page/elements/head', ['title' => elgg_echo('upgrading')]);
26 
27 $head .= elgg_format_element('meta', [
28  'http-equiv' => 'refresh',
29  'content' => '1;url=' . $refresh_url,
30 ], '', ['is_xml' => true]);
31 
32 echo elgg_view('page/elements/html', [
33  'head' => $head,
34  'body' => $body,
35 ]);
$head
Definition: upgrade.php:25
$body
Definition: upgrade.php:23
$site_host
Definition: upgrade.php:4
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
elgg_strpos()
Wrapper function for mb_strpos().
Definition: mb_wrapper.php:71
$forward_url
Definition: upgrade.php:7
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
if(elgg_strpos($forward_url, '/')!==0) $refresh_url
Definition: upgrade.php:14
$site_url
Definition: upgrade.php:3
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145
elgg_http_get_signed_url(string $url, string $expires=null)
Signs provided URL with a SHA256 HMAC key.
Definition: elgglib.php:214