Elgg
Version 6.1
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
views
default
resources
upgrade.php
Go to the documentation of this file.
1
<?php
2
3
$site_url
=
elgg_get_site_url
();
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
);
8
$forward_url
=
str_replace
([
$site_url
,
$site_host
],
'/'
,
$forward_url
);
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
20
$refresh_url
=
elgg_http_get_signed_url
(
$refresh_url
);
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
$head
Definition:
upgrade.php:25
$body
$body
Definition:
upgrade.php:23
$site_host
$site_host
Definition:
upgrade.php:4
str_replace
elgg_echo
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition:
languages.php:17
get_input
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition:
input.php:20
elgg_view
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition:
views.php:156
elgg_strpos
elgg_strpos()
Wrapper function for mb_strpos().
Definition:
mb_wrapper.php:71
$forward_url
$forward_url
Definition:
upgrade.php:7
elgg_get_site_url
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
Definition:
configuration.php:26
$refresh_url
if(elgg_strpos($forward_url, '/')!==0) $refresh_url
Definition:
upgrade.php:14
$site_url
$site_url
Definition:
upgrade.php:3
elgg_generate_url
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
Definition:
pagehandler.php:133
elgg_format_element
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
elgg_http_get_signed_url(string $url, string $expires=null)
Signs provided URL with a SHA256 HMAC key.
Definition:
elgglib.php:216
Generated on Wed Dec 4 2024 00:00:19 for Elgg by
1.8.11