-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_complete.php
85 lines (70 loc) · 2.35 KB
/
install_complete.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
require_once "include/settings.inc.php";
Settings::setModMode(true);
require_once "include/beContent.inc.php";
require_once(realpath(dirname(__FILE__)) . '/include/view/template/InitGraphic.php');
/**
* Formats a JSON string for pretty printing
*
* @param string $json The JSON to make pretty
* @param bool $html Insert nonbreaking spaces and <br />s for tabs and linebreaks
* @return string The prettified output
* @author Jay Roberts
*/
function _format_json($json, $html = false)
{
$tabcount = 0;
$result = '';
$inquote = false;
$ignorenext = false;
if ($html) {
$tab = " ";
$newline = "<br/>";
} else {
$tab = "\t";
$newline = "\n";
}
for ($i = 0; $i < strlen($json); $i++) {
$char = $json[$i];
if ($ignorenext) {
$result .= $char;
$ignorenext = false;
} else {
switch ($char) {
case '{':
$tabcount++;
$result .= $char . $newline . str_repeat($tab, $tabcount);
break;
case '}':
$tabcount--;
$result = trim($result) . $newline . str_repeat($tab, $tabcount) . $char;
break;
case ',':
$result .= $char . $newline . str_repeat($tab, $tabcount);
break;
case '"':
$inquote = !$inquote;
$result .= $char;
break;
case '\\':
if ($inquote) $ignorenext = true;
$result .= $char;
break;
default:
$result .= $char;
}
}
}
return $result;
}
foreach (beContent::getInstance()->entities as $k => $v) {
$installation_info["installed_entities"][$v->entityName] = $v->entityName;
}
$installation_info["installation_date"] = new DateTime();
file_put_contents(realpath(dirname(__FILE__)) . '/contents/installation_info.cfg', json_encode($installation_info));
$main = new Skin("system");
InitGraphic::getInstance()->createSystemGraphic($main);
$body = new Skinlet("admin");
//$body->setContent("installation_report", _format_json(json_encode($installation_info), true));
$main->setContent("body", $body->get());
$main->close();