diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php
new file mode 100644
index 00000000000..154605afe0a
--- /dev/null
+++ b/htdocs/admin/tools/eaccelerator.php
@@ -0,0 +1,312 @@
+
+ *
+ * $Id$
+ * $Source$
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/**
+ \file htdocs/admin/tools/eaccelerator.php
+ \brief Page administration de eaccelerator
+ \version $Revision$
+*/
+
+require("./pre.inc.php");
+
+$langs->load("admin");
+
+if (!$user->admin)
+ accessforbidden();
+
+
+llxHeader();
+
+
+if (!function_exists('eaccelerator_info'))
+{
+ print 'eAccelerator is not installed.';
+ llxfooter('$Date$ - $Revision$');
+ exit;
+}
+
+
+/* {{{ process any commands */
+$info = eaccelerator_info();
+if (isset($_POST['caching'])) {
+ if ($info['cache']) {
+ eaccelerator_caching(false);
+ } else {
+ eaccelerator_caching(true);
+ }
+} else if (isset($_POST['optimizer']) && function_exists('eaccelerator_optimizer')) {
+ if ($info['optimizer']) {
+ eaccelerator_optimizer(false);
+ } else {
+ eaccelerator_optimizer(true);
+ }
+} else if (isset($_POST['clear'])) {
+ eaccelerator_clear();
+} else if (isset($_POST['clean'])) {
+ eaccelerator_clean();
+} else if (isset($_POST['purge'])) {
+ eaccelerator_purge();
+}
+$info = eaccelerator_info();
+if (!is_array($info)) {
+ dolibarr_print_error('','An error occured getting eAccelerator information, this is caused if eAccelerator isn\'t initalised properly');
+ exit;
+}
+/* }}} */
+
+function compare($x, $y)
+{
+ global $sortby;
+
+ if ( $x[$sortby] == $y[$sortby] )
+ return 0;
+ else if ( $x[$sortby] < $y[$sortby] )
+ return -1;
+ else
+ return 1;
+}
+
+function revcompare($x, $y)
+{
+ global $sortby;
+
+ if ( $x[$sortby] == $y[$sortby] )
+ return 0;
+ else if ( $x[$sortby] < $y[$sortby] )
+ return 1;
+ else
+ return -1;
+}
+
+/* {{{ create_script_table */
+function create_script_table($list)
+{
+ global $sortby;
+
+ if (isset($_GET['order']) && ($_GET['order'] == "asc" || $_GET['order'] =="desc")) {
+ $order = $_GET['order'];
+ } else {
+ $order = "asc";
+ }
+
+ if (isset($_GET['sort'])) {
+ switch ($_GET['sort']) {
+ case "mtime":
+ case "size":
+ case "reloads":
+ case "hits":
+ $sortby = $_GET['sort'];
+ ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
+ break;
+ default:
+ $sortby = "file";
+ ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare'));
+ }
+ }
+
+ ?>
+
+
+ | ">Filename if($sortby == "file") echo ($order == "asc" ? "↓" : "↑")?> |
+ ">MTime if($sortby == "mtime") echo ($order == "asc" ? "↓" : "↑")?> |
+ ">Size if($sortby == "size") echo ($order == "asc" ? "↓" : "↑")?> |
+ ">Reloads if($sortby == "reloads") echo ($order == "asc" ? "↓" : "↑")?> |
+ ">Hits if($sortby == "hits") echo ($order == "asc" ? "↓" : "↑")?> |
+
+
+
+
+ |
+
+ |
+
+ |
+ KB |
+ () |
+ |
+
+
+
+
+
+
+ | Name |
+ Created |
+ Size |
+ ttl |
+
+
+
+ |
+ |
+ KB |
+ |
+
+
+
+
+
+
+
+
+| Information |
+
+ | Caching enabled |
+ |
+
+
+ | Optimizer enabled |
+ |
+
+
+ | Memory usage |
+ %
+ (MB/
+ MB) |
+
+
+ | Free memory in reserved cache |
+ MB |
+
+
+ | Cached scripts |
+ |
+
+
+ | Removed scripts |
+ |
+
+
+ | Cached keys |
+ |
+
+
+
+
+
+
+
+
+
+
+
+php.ini that eaccelerator.allowed_admin_path parameter is "._FILE;
+?>
+
+
+
+php.ini that eaccelerator.allowed_admin_path parameter is "._FILE;
+
+
+if (function_exists('eaccelerator_get')) {
+?>
+
+
+
+
+
+
+
+
+
+
diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php
index 89281b53b6c..4540e030f95 100644
--- a/htdocs/includes/menus/barre_left/eldy_backoffice.php
+++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php
@@ -158,6 +158,7 @@ class MenuLeft {
if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/dolibarr_import.php", $langs->trans("Restore"),1);
if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/purge.php", $langs->trans("Purge"),1);
if ($leftmenu=="admintools") $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/update.php", $langs->trans("Upgrade"),1);
+ if ($leftmenu=="admintools" && function_exists('eaccelerator_info')) $newmenu->add_submenu(DOL_URL_ROOT."/admin/tools/eaccelerator.php", $langs->trans("EAccelerator"),1);
}
$langs->load("users");