phpinfo.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?php
  2. /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. /**
  20. * \file htdocs/admin/system/phpinfo.php
  21. * \brief Page des infos systeme de php
  22. */
  23. require '../../main.inc.php';
  24. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  25. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  26. $langs->load("admin");
  27. if (! $user->admin)
  28. accessforbidden();
  29. /*
  30. * View
  31. */
  32. llxHeader();
  33. $title='InfoPHP';
  34. if (isset($title))
  35. {
  36. print_fiche_titre($langs->trans($title), '', 'setup');
  37. }
  38. print '<table class="noborder" width="100%">';
  39. print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
  40. print "\n";
  41. $var=false;
  42. // Recupere la version de l'OS
  43. $phpversion=version_php();
  44. print "<tr ".$bc[$var].'><td width="220px">'.$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n";
  45. print '</table>';
  46. print '<br>';
  47. // Get php_info array
  48. $phparray=phpinfo_array();
  49. foreach($phparray as $key => $value)
  50. {
  51. //print_titre($key);
  52. print '<table class="noborder">';
  53. print '<tr class="liste_titre">';
  54. //print '<td width="220px">'.$langs->trans("Parameter").'</td>';
  55. print '<td width="220px">'.$key.'</td>';
  56. print '<td colspan="2">'.$langs->trans("Value").'</td>';
  57. print "</tr>\n";
  58. $var=true;
  59. //var_dump($value);
  60. foreach($value as $keyparam => $keyvalue)
  61. {
  62. if (! is_array($keyvalue))
  63. {
  64. $var=!$var;
  65. print '<tr '.$bc[$var].'>';
  66. print '<td>'.$keyparam.'</td>';
  67. $valtoshow=$keyvalue;
  68. if ($keyparam == 'X-ChromePhp-Data') $valtoshow=dol_trunc($keyvalue,80);
  69. print '<td colspan="2">';
  70. if ($keyparam == 'Path') $valtoshow=join('; ',explode(';',trim($valtoshow)));
  71. if ($keyparam == 'PATH') $valtoshow=join('; ',explode(';',trim($valtoshow)));
  72. if ($keyparam == '_SERVER["PATH"]') $valtoshow=join('; ',explode(';',trim($valtoshow)));
  73. print $valtoshow;
  74. print '</td>';
  75. print '</tr>';
  76. }
  77. else
  78. {
  79. $var=!$var;
  80. print '<tr '.$bc[$var].'>';
  81. print '<td>'.$keyparam.'</td>';
  82. $i=0;
  83. foreach($keyvalue as $keyparam2 => $keyvalue2)
  84. {
  85. print '<td>';
  86. $valtoshow=$keyvalue2;
  87. if ($keyparam == 'disable_functions') $valtoshow=join(', ',explode(',',trim($valtoshow)));
  88. //print $keyparam;
  89. print $valtoshow;
  90. $i++;
  91. print '</td>';
  92. }
  93. print '</tr>';
  94. }
  95. }
  96. print '</table><br>';
  97. }
  98. llxFooter();
  99. $db->close();