From d95707695531884ce32aef157c5b1e7f5a4106a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Apr 2012 15:16:34 +0200 Subject: [PATCH] Update xcache and xtrigger info pages --- htdocs/admin/system/xcache.php | 18 ++++-- htdocs/admin/system/xdebug.php | 109 ++++++++++++++++++--------------- 2 files changed, 72 insertions(+), 55 deletions(-) diff --git a/htdocs/admin/system/xcache.php b/htdocs/admin/system/xcache.php index ca4aed2d98c..8fd23b96af0 100755 --- a/htdocs/admin/system/xcache.php +++ b/htdocs/admin/system/xcache.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2009-2012 Laurent Destailleur * * 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 @@ -24,8 +24,7 @@ require("../../main.inc.php"); $langs->load("admin"); -if (!$user->admin) - accessforbidden(); +if (!$user->admin) accessforbidden(); $action=GETPOST('action'); @@ -49,8 +48,17 @@ if (!function_exists('xcache_info')) } -print 'Opcode cache XCache is on
'."\n"; +print 'Opcode cache XCache is on

'."\n\n"; +print $langs->trans("Split").': '.ini_get('xcache.count').'       '.$langs->trans("Recommanded").': (cat /proc/cpuinfo | grep -c processor) + 1
'."\n"; +print $langs->trans("Size").': '.ini_get('xcache.size').'       '.$langs->trans("Recommanded").': 16*Split
'."\n"; + +print $langs->trans("xcache.cacher").': '.yn(ini_get('xcache.cacher')).'
'."\n"; +print $langs->trans("xcache.optimizer").': '.yn(ini_get('xcache.optimizer')).' (will be usefull only with xcache v2)
'."\n"; +print $langs->trans("xcache.stat").': '.yn(ini_get('xcache.stat')).'
'."\n"; +print $langs->trans("xcache.coverager").': '.yn(ini_get('xcache.coverager')).'
'."\n"; + +//print xcache_get(); /* $cacheinfos = array(); for ($i = 0; $i < 10; $i ++) @@ -69,4 +77,6 @@ if ($action == 'clear') */ llxFooter(); + +$db->close(); ?> diff --git a/htdocs/admin/system/xdebug.php b/htdocs/admin/system/xdebug.php index 977df17e831..3b829d33ec8 100644 --- a/htdocs/admin/system/xdebug.php +++ b/htdocs/admin/system/xdebug.php @@ -1,19 +1,19 @@ +/* Copyright (C) 2009-2012 Laurent Destailleur * - * 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 2 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +* 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 2 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ /** * \file htdocs/admin/system/xdebug.php @@ -25,11 +25,11 @@ require("../../main.inc.php"); $langs->load("admin"); if (!$user->admin) - accessforbidden(); +accessforbidden(); /* -* View + * View */ llxHeader(); @@ -42,8 +42,8 @@ print "
\n"; if (!function_exists('xdebug_is_enabled')) { print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.'; - llxFooter(); - exit; + llxFooter(); + exit; } @@ -56,48 +56,55 @@ if (function_exists('socket_create')) print 'XDEBUG_PORT: '.$port."
\n"; print "
\n"; $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); - if (empty($socket)) die('Unable to preapre a socket'); - //socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port); - //socket_listen($sock); - //$client = socket_accept($sock); - $client=socket_connect($socket, $address, $port); - if ($client) - { - echo "Connection established: ".$client." - address=".$address." port=".$port."
\n"; - echo "There is a Remote debug server at this address.
\n"; - echo "
\n"; - echo "To be sure this debugger accepts input from your PHP server, be sure to have\n"; - echo "your php.ini file with this :
\n"; - echo 'xdebug.remote_enable=on
- xdebug.remote_handle=dbgp
- xdebug.remote_host=localhost
- xdebug.remote_port=9000
- xdebug.profiler_enable=1
- xdebug.show_local_vars=off
- xdebug.profiler_output_dir=/tmp/xdebug
- xdebug.profiler_append=0
- '."\n"; - print "
\n"; - echo 'Then check in your debug server (Eclipse), you have setup:
+ if (empty($socket)) die('Unable to preapre a socket'); + //socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port); + //socket_listen($sock); + //$client = socket_accept($sock); + $client=socket_connect($socket, $address, $port); + if ($client) + { + echo "Connection established: ".$client." - address=".$address." port=".$port."
\n"; + echo "There is a Remote debug server at this address.
\n"; + echo "
\n"; + echo "To be sure this debugger accepts input from your PHP server, be sure to have\n"; + echo "your php.ini file with this :
\n"; + echo 'xdebug.remote_enable=on
+ xdebug.remote_handle=dbgp
+ xdebug.remote_host=localhost
+ xdebug.remote_port=9000
+ xdebug.profiler_enable=0
+ xdebug.profiler_enable_trigger=1
+ xdebug.show_local_vars=off
+ xdebug.profiler_output_dir=/tmp/xdebug
+ xdebug.profiler_append=0
+
+ xdebug.trace_enable_trigger=1
+ xdebug.show_mem_delta=1
+ xdebug.trace_output_dir=/tmp/trace
+ xdebug.auto_trace=0
+ '."\n"; + print "
\n"; + echo 'Then check in your debug server (Eclipse), you have setup:
XDebug with same port than in php.ini
Allow Remote debug=yes or prompt
'."\n"; - print "
\n"; - echo "Then, to run a debug session, add parameter XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.\n"; - } - else - { - print socket_strerror(socket_last_error()); + print "
\n"; + echo "Then, to run a debug session, add parameter XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.\n"; + } + else + { + print socket_strerror(socket_last_error()); echo "Failed to connect to address=".$address." port=".$port."
\n"; echo "There is no Remote debug server at this address.\n"; - } - socket_close($client); - socket_close($socket); + } + socket_close($socket); } else { - print "Can't test if PHPDebug is OK as PHP socket functions are not enabled."; + print "Can't test if PHPDebug is OK as PHP socket functions are not enabled."; } llxFooter(); + +$db->close(); ?>