Removed deprecated file
This commit is contained in:
parent
bad5daee13
commit
204475efb9
@ -39,7 +39,6 @@ print load_fiche_titre("XCache", '', 'title_setup');
|
||||
|
||||
print "<br>\n";
|
||||
|
||||
//function_exists('apc_cache_info') || function_exists('eaccelerator_info') || function_exists('xcache_info'))
|
||||
if (!function_exists('xcache_info'))
|
||||
{
|
||||
print 'XCache seems to be not installed. Function xcache_info not found.';
|
||||
|
||||
@ -1,338 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
* (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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/tools/eaccelerator.php
|
||||
* \brief Page administration de eaccelerator
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
if (!function_exists('eaccelerator_info')) {
|
||||
print 'eAccelerator is not installed.';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$info = eaccelerator_info();
|
||||
if (isset($_POST['caching'])) {
|
||||
if ($info['cache']) {
|
||||
eaccelerator_caching(false);
|
||||
} else {
|
||||
eaccelerator_caching(true);
|
||||
}
|
||||
} elseif (isset($_POST['optimizer']) && function_exists('eaccelerator_optimizer')) {
|
||||
if ($info['optimizer']) {
|
||||
eaccelerator_optimizer(false);
|
||||
} else {
|
||||
eaccelerator_optimizer(true);
|
||||
}
|
||||
} elseif (isset($_POST['clear'])) {
|
||||
eaccelerator_clear();
|
||||
} elseif (isset($_POST['clean'])) {
|
||||
eaccelerator_clean();
|
||||
} elseif (isset($_POST['purge'])) {
|
||||
eaccelerator_purge();
|
||||
}
|
||||
$info = eaccelerator_info();
|
||||
if (!is_array($info)) {
|
||||
dol_print_error('', 'An error occured getting eAccelerator information, this is caused if eAccelerator isn\'t initalised properly');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compare revisions
|
||||
*
|
||||
* @param array $x Parts of version 1
|
||||
* @param array $y Parts of version 2
|
||||
* @return int -1 if 1<2, 0 if 1=2, 1 if 1>2
|
||||
*/
|
||||
function compare($x, $y)
|
||||
{
|
||||
global $sortby;
|
||||
|
||||
if ( $x[$sortby] == $y[$sortby] ) {
|
||||
return 0;
|
||||
} elseif ($x[$sortby] < $y[$sortby]) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare revisions
|
||||
*
|
||||
* @param array $x Parts of version 1
|
||||
* @param array $y Parts of version 2
|
||||
* @return int 1 if 1<2, 0 if 1=2, -1 if 1>2
|
||||
*/
|
||||
function revcompare($x, $y)
|
||||
{
|
||||
global $sortby;
|
||||
|
||||
if ($x[$sortby] == $y[$sortby]) {
|
||||
return 0;
|
||||
} elseif ($x[$sortby] < $y[$sortby]) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output table
|
||||
*
|
||||
* @param array $list Array of records
|
||||
* @return void
|
||||
*/
|
||||
function create_script_table($list)
|
||||
{
|
||||
global $sortby,$langs;
|
||||
|
||||
if (GETPOT('order', 'alpha') == "asc" || GETPOST('order', 'alpha') == "desc") {
|
||||
$order = GETPOST('order', 'alpha');
|
||||
} else {
|
||||
$order = "asc";
|
||||
}
|
||||
|
||||
if (GETPOST('order', 'alpha')) {
|
||||
switch (GETPOST('order', 'alpha')) {
|
||||
case "mtime":
|
||||
case "size":
|
||||
case "reloads":
|
||||
case "hits":
|
||||
$sortby = GETPOST('sort');
|
||||
($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
|
||||
break;
|
||||
default:
|
||||
$sortby = "file";
|
||||
($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
|
||||
}
|
||||
}
|
||||
|
||||
print '<table class="noborder">';
|
||||
print '<tr>';
|
||||
print '<th><a href="'.$_SERVER['PHP_SELF'].'?sort=file&order='.($order == "asc" ? "desc" : "asc").'">'.$langs->trans("Filename").'</a> ';
|
||||
if($sortby == "file")
|
||||
print ($order == "asc" ? "↓" : "↑").'</th>';
|
||||
print '<th><a href="'.$_SERVER['PHP_SELF'].'?sort=mtime&order='.($order == "asc" ? "desc" : "asc").'">'.$langs->trans("Date").'</a> ';
|
||||
if($sortby == "mtime")
|
||||
print ($order == "asc" ? "↓" : "↑").'</th>';
|
||||
print '<th><a href="'.$_SERVER['PHP_SELF'].'?sort=size&order='.($order == "asc" ? "desc" : "asc").'">'.$langs->trans("Size").'</a> ';
|
||||
if($sortby == "size")
|
||||
print ($order == "asc" ? "↓" : "↑").'</th>';
|
||||
print '<th><a href="'.$_SERVER['PHP_SELF'].'?sort=reloads&order='.($order == "asc" ? "desc" : "asc").'">'.$langs->trans("Reloads").'</a> ';
|
||||
if($sortby == "reloads")
|
||||
print ($order == "asc" ? "↓" : "↑").'</th>';
|
||||
print '<th><a href="'.$_SERVER['PHP_SELF'].'?sort=hits&order='.($order == "asc" ? "desc" : "asc").'">'.$langs->trans("Hits").'</a> ';
|
||||
if($sortby == "hits")
|
||||
print ($order == "asc" ? "↓" : "↑").'</th>';
|
||||
print '</tr>';
|
||||
switch ($sortby) {
|
||||
case "mtime":
|
||||
case "size":
|
||||
case "reloads":
|
||||
case "hits":
|
||||
($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
|
||||
break;
|
||||
case "file":
|
||||
default:
|
||||
$sortby = "file";
|
||||
($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
|
||||
}
|
||||
|
||||
foreach($list as $script) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.dol_trunc($script['file'], 80, 'left').'</td>';
|
||||
print '<td class="nowrap center">'.dol_print_date($script['mtime'], 'dayhour').'</td>';
|
||||
print '<td class="nowrap right">'.number_format($script['size'] / 1024, 2).'KB</td>';
|
||||
print '<td class="nowrap right">'.$script['reloads'].' ('.$script['usecount'].')</td>';
|
||||
print '<td class="nowrap right">'.$script['hits'].'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Output table
|
||||
*
|
||||
* @param array $list Array of records
|
||||
* @return void
|
||||
*/
|
||||
function create_key_table($list)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>Name</th>';
|
||||
print '<th>Created</th>';
|
||||
print '<th>'.$langs->trans("Size").'</th>';
|
||||
print '<th>ttl</th>';
|
||||
print '</tr>';
|
||||
|
||||
foreach($list as $key) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.dol_trunc($key['name'], 80, 'left').'</td>';
|
||||
print '<td class="nowrap center">'.dol_print_date($key['created'], 'dayhour').'</td>';
|
||||
print '<td class="nowrap right">'.number_format($key['size']/1024, 3).'KB</td>';
|
||||
print '<td class="nowrap right">';
|
||||
if ($key['ttl'] == -1) {
|
||||
print 'expired';
|
||||
} elseif ($key['ttl'] == 0) {
|
||||
print 'none';
|
||||
} else {
|
||||
print dol_print_date($key['ttl'], 'dayhour');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
$form=new Form($db);
|
||||
print load_fiche_titre('Dolibarr eAccelerator '.$info['version'].' control panel', '', 'title_setup');
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">Information</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>Caching enabled</td>';
|
||||
print '<td class="right">'.($info['cache']?'yes':'no').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>Optimizer enabled</td>';
|
||||
print '<td class="right">'.$info['optimizer']?'yes':'no'.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>Memory usage</td>';
|
||||
print '<td class="right">'.number_format(100 * $info['memoryAllocated']/$info['memorySize'], 2).'%('.number_format($info['memoryAllocated'] / (1024*1024), 2).'MB / '.number_format($info['memorySize']/(1024*1024), 2).'MB)</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>Free memory in reserved cache</td>';
|
||||
print '<td class="right">'.number_format($info['memoryAvailable']/(1024*1024), 2).'MB</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>Cached scripts</td>';
|
||||
print '<td class="right">'.$info['cachedScripts'].'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>Removed scripts</td>';
|
||||
print '<td class="right">'.$info['removedScripts'].'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>Cached keys</td>';
|
||||
print '<td class="right">'.(isset($info['cachedKeys'])?$info['cachedKeys']:'').'</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
$resCached = @eaccelerator_cached_scripts(); // If success return an array
|
||||
$resRemoved = @eaccelerator_removed_scripts();
|
||||
|
||||
if (is_array($resCached) || is_array($resRemoved)) {
|
||||
print "<br>";
|
||||
print '<form name="ea_control" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre"><td colspan="2">Actions</td></tr>';
|
||||
|
||||
if (is_array($resCached)) {
|
||||
print '<tr class="oddeven">';
|
||||
print "<td>Caching</td>";
|
||||
print '<td class="right"><input type="submit" class="butAction" name="caching" value="'. ($info['cache']?'disable':'enable') .'" /></td>';
|
||||
print "</tr>";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td>Optimizer</td>";
|
||||
print '<td class="right"><input type="submit" class="butAction" name="optimizer" value="'. ($info['optimizer']?'disable':'enable') .'" /></td>';
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
if (is_array($resRemoved)) {
|
||||
print '<tr class="oddeven">';
|
||||
print "<td>Clear cache</td>";
|
||||
print '<td class="right"><input type="submit" class="butAction" name="clear" value="clear" title="remove all unused scripts and data from shared memory and disk cache" /></td>';
|
||||
print "</tr>";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td>Clean cache</td>";
|
||||
print '<td class="right"><input type="submit" class="butAction" name="clean" value="clean" title=" remove all expired scripts and data from shared memory and disk cache" /></td>';
|
||||
print "</tr>";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print "<td>Purge cache</td>";
|
||||
print '<td class="right"><input type="submit" class="butAction" name="purge" value="purge" title="remove all \'removed\' scripts from shared memory" /></td>';
|
||||
print "</tr></table></form>";
|
||||
}
|
||||
|
||||
if (is_array($resCached)) {
|
||||
print "<br><br>";
|
||||
print "<b>Cached scripts</b><br>";
|
||||
create_script_table($resCached);
|
||||
}
|
||||
|
||||
if (is_array($resRemoved)) {
|
||||
print "<br><br>";
|
||||
print "<b>Removed scripts</b><br>";
|
||||
create_script_table($resRemoved);
|
||||
}
|
||||
} else {
|
||||
print "<br><br>";
|
||||
print "Check in your <b>php.ini</b> that <b>eaccelerator.allowed_admin_path</b> parameter is : ";
|
||||
print "<br><br>";
|
||||
print "<b>".$_SERVER["SCRIPT_FILENAME"]."</b>";
|
||||
print "<br><br>";
|
||||
}
|
||||
|
||||
if (function_exists('eaccelerator_get')) {
|
||||
print '<br><br>';
|
||||
print '<b>Cached keys</b><br>';
|
||||
$res=eaccelerator_list_keys();
|
||||
create_key_table($res);
|
||||
}
|
||||
|
||||
print "<br><br>";
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -54,7 +54,6 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 301__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/dolibarr_export.php?mainmenu=home&leftmenu=admintools', 'Backup', 1, 'admin', '', '', 2, 6, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 302__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/dolibarr_import.php?mainmenu=home&leftmenu=admintools', 'Restore', 1, 'admin', '', '', 2, 7, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 305__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/update.php?mainmenu=home&leftmenu=admintools', 'MenuUpgrade', 1, 'admin', '', '', 2, 8, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools" && function_exists("eaccelerator_info")', __HANDLER__, 'left', 306__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/eaccelerator.php?mainmenu=home&leftmenu=admintools', 'EAccelerator', 1, 'admin', '', '', 2, 9, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 307__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/listevents.php?mainmenu=home&leftmenu=admintools', 'Audit', 1, 'admin', '', '', 2, 10, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 308__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/listsessions.php?mainmenu=home&leftmenu=admintools', 'Sessions', 1, 'admin', '', '', 2, 11, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 309__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/tools/purge.php?mainmenu=home&leftmenu=admintools', 'Purge', 1, 'admin', '', '', 2, 12, __ENTITY__);
|
||||
|
||||
@ -745,7 +745,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
$newmenu->add('/admin/system/phpinfo.php?mainmenu=home&leftmenu=admintools', $langs->trans('InfoPHP'), 1);
|
||||
//if (function_exists('xdebug_is_enabled')) $newmenu->add('/admin/system/xdebug.php', $langs->trans('XDebug'),1);
|
||||
$newmenu->add('/admin/system/database.php?mainmenu=home&leftmenu=admintools', $langs->trans('InfoDatabase'), 1);
|
||||
if (function_exists('eaccelerator_info')) $newmenu->add("/admin/tools/eaccelerator.php?mainmenu=home&leftmenu=admintools", $langs->trans("EAccelerator"), 1);
|
||||
//$newmenu->add("/admin/system/perf.php?mainmenu=home&leftmenu=admintools", $langs->trans("InfoPerf"),1);
|
||||
$newmenu->add("/admin/tools/dolibarr_export.php?mainmenu=home&leftmenu=admintools", $langs->trans("Backup"), 1);
|
||||
$newmenu->add("/admin/tools/dolibarr_import.php?mainmenu=home&leftmenu=admintools", $langs->trans("Restore"), 1);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user