30require
'../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
34$langs->loadLangs(array(
"admin",
"install",
"errors"));
45llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-system_phpinfo');
55$maxphp = @ini_get(
'upload_max_filesize');
56if (preg_match(
'/k$/i', $maxphp)) {
57 $maxphp = preg_replace(
'/k$/i',
'', $maxphp);
60if (preg_match(
'/m$/i', $maxphp)) {
61 $maxphp = preg_replace(
'/m$/i',
'', $maxphp);
64if (preg_match(
'/g$/i', $maxphp)) {
65 $maxphp = preg_replace(
'/g$/i',
'', $maxphp);
66 $maxphp *= 1024 * 1024;
68if (preg_match(
'/t$/i', $maxphp)) {
69 $maxphp = preg_replace(
'/t$/i',
'', $maxphp);
70 $maxphp *= 1024 * 1024 * 1024;
72$maxphp2 = @ini_get(
'post_max_size');
73if (preg_match(
'/k$/i', $maxphp2)) {
74 $maxphp2 = preg_replace(
'/k$/i',
'', $maxphp2);
77if (preg_match(
'/m$/i', $maxphp2)) {
78 $maxphp2 = preg_replace(
'/m$/i',
'', $maxphp2);
81if (preg_match(
'/g$/i', $maxphp2)) {
82 $maxphp2 = preg_replace(
'/g$/i',
'', $maxphp2);
83 $maxphp2 *= 1024 * 1024;
85if (preg_match(
'/t$/i', $maxphp2)) {
86 $maxphp2 = preg_replace(
'/t$/i',
'', $maxphp2);
87 $maxphp2 *= 1024 * 1024 * 1024;
89if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2) {
90 $langs->load(
"errors");
91 print
info_admin($langs->trans(
"WarningParamUploadMaxFileSizeHigherThanPostMaxSize", @ini_get(
'upload_max_filesize'), @ini_get(
'post_max_size')), 0, 0,
'0',
'warning');
96print
'<table class="noborder centpercent">';
97print
'<tr class="liste_titre"><td class="titlefield">'.$langs->trans(
"Parameter").
'</td><td></td></tr>';
99$ErrorPicturePath =
"../../theme/eldy/img/error.png";
100$WarningPicturePath =
"../../theme/eldy/img/warning.png";
101$OkayPicturePath =
"../../theme/eldy/img/tick.png";
103print
'<tr><td>'.$langs->trans(
"Version").
'</td><td>';
105$arrayphpminversionerror = array(5, 5, 0);
106$arrayphpminversionwarning = array(5, 6, 0);
109 print
img_picto(
'Error',
'error').
' '.$langs->trans(
"ErrorPHPVersionTooLow",
versiontostring($arrayphpminversionerror));
111 print
img_picto(
'Warning',
'warning').
' '.$langs->trans(
"ErrorPHPVersionTooLow",
versiontostring($arrayphpminversionwarning));
117print
'<tr><td>GET and POST support</td><td>';
119if (!isset($_GET[
"testget"]) && !isset($_POST[
"testpost"]) && !isset($_GET[
"mainmenu"])) {
120 print
img_picto(
'Warning',
'warning').
' '.$langs->trans(
"PHPSupportPOSTGETKo");
121 print
' (<a href="'.$_SERVER[
"PHP_SELF"].
'?testget=ok">'.$langs->trans(
"Recheck").
'</a>)';
123 print
img_picto(
'Ok',
'tick').
' '.$langs->trans(
"PHPSupportPOSTGETOk");
127print
'<tr><td>Sessions support</td><td>';
128if (!function_exists(
"session_id")) {
129 print
img_picto(
'Error',
'error').
' '.$langs->trans(
"ErrorPHPDoesNotSupportSessions");
131 print
img_picto(
'Ok',
'tick').
' '.$langs->trans(
"PHPSupportSessions");
135print
'<tr><td>UTF-8 support</td><td>';
136if (!function_exists(
"utf8_encode")) {
137 print
img_picto(
'Warning',
'warning').
' '.$langs->trans(
"ErrorPHPDoesNotSupport",
"UTF8");
139 print
img_picto(
'Ok',
'tick').
' '.$langs->trans(
"PHPSupport",
"UTF8");
147$activatedExtensions = array();
148$loadedExtensions = array_map(
'strtolower', get_loaded_extensions(
false));
150print
'<table class="noborder centpercent">';
151print
'<tr class="liste_titre">';
152print
'<td class="titlefield">'.$langs->trans(
"Extension").
'</td>';
153print
'<td>'.$langs->trans(
"Test").
'</td>';
156$functions = [
"mb_check_encoding"];
160print
"<td>".$name.
"</td>";
161print
getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
164$functions = [
"json_decode"];
168print
"<td>".$name.
"</td>";
169print
getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
172$functions = [
"imagecreate"];
176print
"<td>".$name.
"</td>";
177print
getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
180$functions = [
"curl_init"];
184print
"<td>".$name.
"</td>";
185print
getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
188$functions = [
"easter_date"];
192print
"<td>".$name.
"</td>";
193print
getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
196$functions = [
"simplexml_load_string"];
200print
"<td>".$name.
"</td>";
201print
getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
204if (empty($_SERVER[
"SERVER_ADMIN"]) || $_SERVER[
"SERVER_ADMIN"] !=
'doliwamp@localhost') {
205 $functions = [
"locale_get_primary_language",
"locale_get_region"];
209 print
"<td>".$name.
"</td>";
210 print
getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
214$functions = [
"imap_open"];
218print
"<td>".$name.
"</td>";
219print
getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
226print
"<td>".$name.
"</td>";
227print
getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
234print
"<td>".$name.
"</td>";
235print
getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
244foreach ($phparray as $key => $value) {
245 print
'<div class="div-table-responsive-no-min">';
246 print
'<table class="noborder">';
247 print
'<tr class="liste_titre">';
248 print
'<td class="titlefield">'.$key.
'</td>';
249 print
'<td colspan="2"></td>';
253 foreach ($value as $keyparam => $keyvalue) {
254 if (!is_array($keyvalue)) {
255 $keytoshow = $keyparam;
256 $valtoshow = $keyvalue;
259 if (in_array($keyparam, array(
'HTTP_COOKIE',
'Cookie',
"\$_SERVER['HTTP_COOKIE']",
'Authorization'))) {
260 $valtoshow =
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
262 if (preg_match(
'/'.preg_quote(
'$_COOKIE[\'DOLSESSID_',
'/').
'/i', $keyparam)) {
263 $keytoshow = $keyparam;
264 $valtoshow =
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
266 if (preg_match(
'/'.preg_quote(
'$_SERVER[\'PHP_AUTH_PW',
'/').
'/i', $keyparam)) {
267 $keytoshow = $keyparam;
268 $valtoshow =
'<span class="opacitymedium">'.$langs->trans(
"Hidden").
'</span>';
271 print
'<tr class="oddeven">';
272 print
'<td>'.$keytoshow.
'</td>';
273 if ($keyparam ==
'X-ChromePhp-Data') {
276 print
'<td colspan="2" class="wordbreak">';
277 if ($keyparam ==
'Path') {
278 $valtoshow = implode(
'; ', explode(
';', trim($valtoshow)));
280 if ($keyparam ==
'PATH') {
281 $valtoshow = implode(
'; ', explode(
';', trim($valtoshow)));
283 if ($keyparam ==
'_SERVER["PATH"]') {
284 $valtoshow = implode(
'; ', explode(
';', trim($valtoshow)));
290 print
'<tr class="oddeven">';
291 print
'<td class="wordbreak">'.$keyparam.
'</td>';
293 foreach ($keyvalue as $keyparam2 => $keyvalue2) {
295 $valtoshow = $keyvalue2;
296 if ($keyparam ==
'disable_functions') {
297 $valtoshow = implode(
', ', explode(
',', trim($valtoshow)));
333 $result = $result && in_array(strtolower($name), $loaded);
335 foreach ($functions as $function) {
336 $result = $result && function_exists($function);
341 if (strtolower($name) ==
'xdebug') {
342 $html .=
img_warning($langs->trans(
"ModuleActivated",
"xdebug"));
344 $html .=
img_picto($langs->trans(
"Ok"),
'tick');
346 if (in_array(strtolower($name), $loaded)) {
347 $html .=
' '.$langs->trans(
"Loaded").
' - ';
351 if (strtolower($name) ==
'xdebug') {
352 $html .=
' '.$langs->trans(
"ModuleActivated",
"xdebug");
353 $html .=
' - '.$langs->trans(
"ModuleActivatedMayExposeInformation");
355 $html .=
' <span class="opacitymedium">'.$langs->trans(
"PHPSupport", $name).
'</span>';
358 if (strtolower($name) ==
'xdebug') {
359 $html .=
yn(0).
' - ';
361 $html .=
img_warning($langs->trans(
"ModuleActivated",
"xdebug"));
363 if (in_array(strtolower($name), $loaded)) {
364 $html .=
' '.$langs->trans(
"Loaded").
' - ';
368 $html .=
' '.$langs->trans(
"ErrorPHPDoesNotSupport", $name);
getResultColumn($name, array $activated, array $loaded, array $functions)
Return a result column with a translated result text.
versiontostring($versionarray)
Renvoi une version en chaine depuis une version en tableau.
versionphparray()
Return version PHP.
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays).
phpinfo_array()
Return the php_info into an array.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.