dolibarr/htdocs/admin/system/phpinfo.php

123 lines
3.1 KiB
PHP
Raw Normal View History

<?php
2012-08-02 10:07:55 +02:00
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
2012-09-21 00:13:20 +02:00
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
2012-12-30 15:13:49 +01:00
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
2002-04-30 12:51:35 +02:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
2002-04-30 12:51:35 +02:00
* (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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2011-08-01 00:21:57 +02:00
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2002-04-30 12:51:35 +02:00
*/
/**
2009-01-18 18:35:29 +01:00
* \file htdocs/admin/system/phpinfo.php
* \brief Page des infos systeme de php
2009-01-18 18:35:29 +01:00
*/
require '../../main.inc.php';
2013-06-05 16:24:32 +02:00
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$langs->load("admin");
2012-08-02 10:07:55 +02:00
if (! $user->admin)
accessforbidden();
2009-01-18 18:35:29 +01:00
/*
* View
*/
llxHeader();
2012-09-21 00:13:20 +02:00
$title='InfoPHP';
2009-01-18 18:35:29 +01:00
2012-09-30 21:26:58 +02:00
if (isset($title))
{
print_fiche_titre($langs->trans($title), '', 'setup');
}
2009-01-18 18:35:29 +01:00
2013-06-05 16:24:32 +02:00
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print "\n";
$var=false;
2013-06-05 16:24:32 +02:00
// Recupere la version de l'OS
$phpversion=version_php();
print "<tr ".$bc[$var].'><td width="220px">'.$langs->trans("Version")."</td><td>".$phpversion."</td></tr>\n";
print '</table>';
2013-06-05 16:24:32 +02:00
print '<br>';
2012-09-30 21:26:58 +02:00
// Get php_info array
2012-09-21 00:13:20 +02:00
$phparray=phpinfo_array();
foreach($phparray as $key => $value)
{
2012-09-21 00:13:20 +02:00
//print_titre($key);
2012-09-30 21:26:58 +02:00
print '<table class="noborder">';
print '<tr class="liste_titre">';
2012-09-21 00:13:20 +02:00
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
2012-09-30 21:26:58 +02:00
print '<td width="220px">'.$key.'</td>';
print '<td colspan="2">'.$langs->trans("Value").'</td>';
print "</tr>\n";
2012-09-21 00:13:20 +02:00
$var=true;
//var_dump($value);
foreach($value as $keyparam => $keyvalue)
{
if (! is_array($keyvalue))
{
$var=!$var;
print '<tr '.$bc[$var].'>';
2012-09-30 21:26:58 +02:00
print '<td>'.$keyparam.'</td>';
2012-09-21 00:13:20 +02:00
$valtoshow=$keyvalue;
if ($keyparam == 'X-ChromePhp-Data') $valtoshow=dol_trunc($keyvalue,80);
print '<td colspan="2">';
if ($keyparam == 'Path') $valtoshow=join('; ',explode(';',trim($valtoshow)));
if ($keyparam == 'PATH') $valtoshow=join('; ',explode(';',trim($valtoshow)));
if ($keyparam == '_SERVER["PATH"]') $valtoshow=join('; ',explode(';',trim($valtoshow)));
print $valtoshow;
print '</td>';
2012-09-21 00:13:20 +02:00
print '</tr>';
}
else
{
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$keyparam.'</td>';
$i=0;
2012-09-30 21:26:58 +02:00
foreach($keyvalue as $keyparam2 => $keyvalue2)
2012-09-21 00:13:20 +02:00
{
print '<td>';
$valtoshow=$keyvalue2;
if ($keyparam == 'disable_functions') $valtoshow=join(', ',explode(',',trim($valtoshow)));
//print $keyparam;
2012-09-30 21:26:58 +02:00
print $valtoshow;
2012-09-21 00:13:20 +02:00
$i++;
print '</td>';
}
print '</tr>';
}
}
print '</table><br>';
}
2012-09-30 21:26:58 +02:00
2011-08-27 21:15:14 +02:00
llxFooter();
2012-09-21 00:13:20 +02:00
2012-08-02 10:07:55 +02:00
$db->close();