/
show_debug.inc.php
185 lines (177 loc) · 7.77 KB
/
show_debug.inc.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU Affero General Public License, version 3 (AGPL-3.0-or-later)
* Copyright 2001 - 2020 Ampache.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
use Ampache\Config\AmpConfig;
use Ampache\Repository\Model\Preference;
use Ampache\Module\System\AutoUpdate;
use Ampache\Module\Util\Cron;
use Ampache\Module\Util\EnvironmentInterface;
use Ampache\Module\Util\Ui;
global $dic;
$environment = $dic->get(EnvironmentInterface::class);
$web_path = AmpConfig::get('web_path'); ?>
<?php Ui::show_box_top(T_('Ampache Debug'), 'box box_debug_tools'); ?>
<div id="information_actions">
<ul>
<li>
<a class="nohtml" href="<?php echo $web_path; ?>/admin/system.php?action=generate_config"><?php echo Ui::get_icon('cog', T_('Generate Configuration File')) . ' ' . T_('Generate Configuration File'); ?></a>
</li>
<li>
<a href="<?php echo $web_path; ?>/admin/system.php?action=write_config"><?php echo Ui::get_icon('cog', T_('Write New Config')) . ' ' . T_('Write New Config'); ?></a>
</li>
<li>
<a href="<?php echo $web_path; ?>/admin/system.php?action=reset_db_charset"><?php echo Ui::get_icon('server_lightning', T_('Set Database Charset')) . ' ' . T_('Set Database Charset'); ?></a>
</li>
<li>
<a href="<?php echo $web_path; ?>/admin/system.php?action=clear_cache&type=song"><?php echo Ui::get_icon('cog', T_('Clear Songs Cache')) . ' ' . T_('Clear Songs Cache'); ?></a>
</li>
<li>
<a href="<?php echo $web_path; ?>/admin/system.php?action=clear_cache&type=artist"><?php echo Ui::get_icon('cog', T_('Clear Artists Cache')) . ' ' . T_('Clear Artists Cache'); ?></a>
</li>
<li>
<a href="<?php echo $web_path; ?>/admin/system.php?action=clear_cache&type=album"><?php echo Ui::get_icon('cog', T_('Clear Albums Cache')) . ' ' . T_('Clear Albums Cache'); ?></a>
</li>
<li>
<a href="<?php echo $web_path; ?>/admin/system.php?action=clear_cache&type=asset"><?php echo Ui::get_icon('cog', T_('Clear Assets Cache')) . ' ' . T_('Clear Assets Cache'); ?></a>
</li>
</ul>
</div>
<?php Ui::show_box_top(T_('Ampache Update'), 'box'); ?>
<div><?php echo T_('Installed Ampache version'); ?>: <?php echo AutoUpdate::get_current_version(); ?>.</div>
<div><?php echo T_('Latest Ampache version'); ?>: <?php echo AutoUpdate::get_latest_version(); ?>.</div>
<?php if ((string) AmpConfig::get('github_force_branch') !== '') {
?><?php echo "<div>" . T_('GitHub Branch') . ': "' . (string) AmpConfig::get('github_force_branch') . '"</div>';
} ?>
<div><a class="nohtml" href="<?php echo $web_path; ?>/admin/system.php?action=show_debug&autoupdate=force"><?php echo T_('Force check'); ?>...</a></div>
<?php
if (AutoUpdate::is_update_available()) {
AutoUpdate::show_new_version();
} ?>
<br />
<?php Ui::show_box_bottom(); ?>
<?php if ((string) AmpConfig::get('cron_cache') !== '') { ?>
<?php Ui::show_box_top(T_('Ampache Cron'), 'box'); ?>
<div><?php echo T_('The last cron was completed'); ?>: <?php echo get_datetime(Cron::get_cron_date()); ?></div>
<br />
<?php Ui::show_box_bottom();
} ?>
<?php Ui::show_box_top(T_('PHP Settings'), 'box box_php_settings'); ?>
<table class="tabledata striped-rows">
<colgroup>
<col id="col_php_setting">
<col id="col_php_value">
</colgroup>
<thead>
<tr class="th-top">
<th class="cel_php_setting"><?php echo T_('Setting'); ?></th>
<th class="cel_php_value"><?php echo T_('Value'); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo T_('Version'); ?></td>
<td><?php echo (string)phpversion(); ?></td>
</tr>
<tr>
<td><?php echo T_('Memory Limit'); ?></td>
<td><?php echo ini_get('memory_limit'); ?></td>
</tr>
<tr>
<td><?php echo T_('Maximum Execution Time'); ?></td>
<td><?php echo ini_get('max_execution_time'); ?></td>
</tr>
<tr>
<td><?php echo T_('Override Execution Time'); ?></td>
<td><?php set_time_limit(0); echo ini_get('max_execution_time') ? T_('Failed') : T_('Succeeded'); ?></td>
</tr>
<tr>
<td><?php echo T_('Open Basedir'); ?></td>
<td><?php echo ini_get('open_basedir'); ?></td>
</tr>
<tr>
<td><?php echo T_('Zlib Support'); ?></td>
<td><?php echo print_bool(function_exists('gzcompress')); ?></td>
</tr>
<tr>
<td><?php echo T_('GD Support'); ?></td>
<td><?php echo print_bool(function_exists('ImageCreateFromString')); ?></td>
</tr>
<tr>
<td><?php echo T_('Iconv Support'); ?></td>
<td><?php echo print_bool(function_exists('iconv')); ?></td>
</tr>
<tr>
<td><?php echo T_('Gettext Support'); ?></td>
<td><?php echo print_bool(function_exists('bindtextdomain')); ?></td>
</tr>
<tr>
<td><?php echo T_('PHP intl extension'); ?></td>
<td><?php echo print_bool($environment->check_php_intl()); ?></td>
</tr>
</tbody>
</table>
<?php Ui::show_box_bottom(); ?>
<?php Ui::show_box_top(T_('Current Configuration'), 'box box_current_configuration'); ?>
<table class="tabledata">
<colgroup>
<col id="col_configuration">
<col id="col_value">
</colgroup>
<thead>
<tr class="th-top">
<th class="cel_configuration"><?php echo T_('Preference'); ?></th>
<th class="cel_value"><?php echo T_('Value'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($configuration as $key => $value) {
if ($key == 'database_password' || $key == 'mysql_password') {
$value = '*********';
}
if (is_array($value)) {
$string = '';
foreach ($value as $setting) {
if (is_array($setting)) {
foreach ($setting as $array_value) {
$string .= $array_value . '<br />';
}
} else {
$string .= $setting . '<br />';
}
}
$value = $string;
}
if (Preference::is_boolean($key)) {
$value = print_bool($value);
}
// Be sure to print only scalar values
if ($value === null || is_scalar($value)) { ?>
<tr>
<td><strong><?php echo $key; ?></strong></td>
<td><?php echo $value; ?></td>
</tr>
<?php
}
} ?>
</tbody>
</table>
<?php Ui::show_box_bottom(); ?>
<?php Ui::show_box_bottom(); ?>