dolibarr 23.0.3
perf.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2013-2019 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
24// Load Dolibarr environment
25require '../../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
27require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
28require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
30
39// Load translation files required by the page
40$langs->loadLangs(array("install", "other", "admin", "products", "mrp"));
41
42if (!$user->admin) {
44}
45
46if (GETPOST('action', 'aZ09') == 'donothing') {
47 exit;
48}
49
50
51/*
52 * View
53 */
54
55$form = new Form($db);
56$nowstring = dol_print_date(dol_now(), 'dayhourlog');
57
58llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-system_perf');
59
60print load_fiche_titre($langs->trans("PerfDolibarr"), '', 'title_setup');
61
62print '<span class="opacitymedium">'.$langs->trans("YouMayFindPerfAdviceHere", 'https://wiki.dolibarr.org/index.php/FAQ_Increase_Performance').'</span>';
63print ' &nbsp; &nbsp; ';
64print '<a href="'.$_SERVER["PHP_SELF"].'">';
65print img_picto($langs->trans("Reload"), 'refresh').' ';
66print $langs->trans("Reload");
67print '</a>';
68print '<br>';
69print '<br>';
70
71
72print '<br>';
73print img_picto('', 'folder', 'class="pictofixedwidth"');
74print '<strong>'.$langs->trans("Version").'</strong><br>';
75print '<div class="divsection">';
76
77// Get PHP version
78$phpversion = version_php();
79print "<strong>PHP</strong> - ".$langs->trans("Version").": ".$phpversion."\n";
80
81// Get version web server
82print "<br><strong>Web server</strong> - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
83
84print '</div>';
85
86
87// XDebug
88print '<br>';
89print img_picto('', 'folder', 'class="pictofixedwidth"');
90print '<strong>'.$langs->trans("XDebug").'</strong><br>';
91print '<div class="divsection">';
92$test = !function_exists('xdebug_is_debugger_active');
93if ($test) {
94 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
95} else {
96 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
97 print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';
98}
99print '<br>';
100print '</div>';
101
102// Module log
103print '<br>';
104print img_picto('', 'folder', 'class="pictofixedwidth"');
105print '<strong>'.$langs->trans("Syslog").'</strong><br>';
106print '<div class="divsection">';
107$test = !isModEnabled('syslog');
108if ($test) {
109 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
110} else {
111 if (getDolGlobalInt('SYSLOG_LEVEL') > LOG_NOTICE) {
112 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("ModuleActivatedWithTooHighLogLevel", $langs->transnoentities("Syslog"));
113 } else {
114 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("ModuleSyslogActivatedButLevelNotTooVerbose", $langs->transnoentities("Syslog"), getDolGlobalInt('SYSLOG_LEVEL'));
115 }
116 //print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
117}
118print '<br>';
119print '</div>';
120
121// Module debugbar
122print '<br>';
123print img_picto('', 'folder', 'class="pictofixedwidth"');
124print '<strong>'.$langs->trans("DebugBar").'</strong><br>';
125print '<div class="divsection">';
126$test = !isModEnabled('debugbar');
127if ($test) {
128 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
129} else {
130 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar"));
131 //print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
132}
133print '<br>';
134print '</div>';
135
136// Applicative cache
137print '<br>';
138print img_picto('', 'folder', 'class="pictofixedwidth"');
139print '<strong>'.$langs->trans("ApplicativeCache").'</strong><br>';
140print '<div class="divsection">';
141$test = isModEnabled('memcached');
142if ($test) {
143 if (getDolGlobalString('MEMCACHED_SERVER')) {
144 print $langs->trans("MemcachedAvailableAndSetup");
145 print ' '.$langs->trans("MoreInformation").' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
146 } else {
147 print $langs->trans("MemcachedModuleAvailableButNotSetup");
148 print ' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
149 }
150} else {
151 print $langs->trans("MemcachedNotAvailable");
152}
153print '</br>';
154print '</div>';
155
156// OPCode cache
157print '<br>';
158print img_picto('', 'folder', 'class="pictofixedwidth"');
159print '<strong>'.$langs->trans("OPCodeCache").'</strong><br>';
160print '<div class="divsection">';
161$foundcache = 0;
162$test = function_exists('xcache_info');
163if (!$foundcache && $test) {
164 $foundcache++;
165 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("PHPModuleLoaded", "XCache");
166 print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xcache.php">Xcache admin page</a>';
167}
168$test = function_exists('eaccelerator_info');
169if (!$foundcache && $test) {
170 $foundcache++;
171 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("PHPModuleLoaded", "Eaccelerator");
172}
173$test = function_exists('opcache_get_status');
174if (!$foundcache && $test) {
175 $foundcache++;
176 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("PHPModuleLoaded", "ZendOPCache"); // Should be by default starting with PHP 5.5
177 //$tmp=opcache_get_status();
178 //var_dump($tmp);
179}
180$test = function_exists('apc_cache_info');
181if (!$foundcache && $test) {
182 //var_dump(apc_cache_info());
183 if (ini_get('apc.enabled')) {
184 $foundcache++;
185 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("PHPModuleLoaded", "APCCache");
186 } else {
187 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("APCCacheInstalledButDisabled");
188 }
189}
190if (!$foundcache) {
191 print $langs->trans("NoOPCodeCacheFound");
192}
193print '<br>';
194print '</div>';
195
196// Use of preload bootstrap
197print '<br>';
198print img_picto('', 'folder', 'class="pictofixedwidth"');
199print '<strong>'.$langs->trans("PreloadOPCode").'</strong><br>';
200print '<div class="divsection">';
201if (ini_get('opcache.preload')) {
202 print ini_get('opcache.preload');
203} else {
204 print img_picto('', 'minus', 'class="pictofixedwidth"').' '.$langs->trans("No");
205}
206print '<br>';
207print '</div>';
208
209// HTTPCacheStaticResources
210print '<script type="text/javascript">
211jQuery(document).ready(function() {
212 var getphpurl;
213 var cachephpstring;
214 var compphpstring;
215 getphpurl = $.ajax({
216 type: "GET",
217 data: { token: \''.currentToken().'\' },
218 url: \''.DOL_URL_ROOT.'/public/notice.php\',
219 cache: false,
220 /* async: false, */
221 /* crossDomain: true,*/
222 success: function () {
223 cachephpstring=getphpurl.getResponseHeader(\'Cache-Control\');
224 /* alert(\'php:\'+getphpurl.getAllResponseHeaders()); */
225 /*alert(\'php:\'+cachephpstring);*/
226 if (cachephpstring == null || cachephpstring.indexOf("no-cache") !== -1)
227 {
228 jQuery("#httpcachephpok").hide();
229 jQuery("#httpcachephpko").show();
230 }
231 else
232 {
233 jQuery("#httpcachephpok").show();
234 jQuery("#httpcachephpko").hide();
235 }
236 compphpstring=getphpurl.getResponseHeader(\'Content-Encoding\');
237 /* alert(\'php:\'+getphpurl.getAllResponseHeaders()); */
238 /*alert(\'php:\'+compphpstring);*/
239 if (compphpstring == null || (compphpstring.indexOf("gzip") == -1 && compphpstring.indexOf("deflate") == -1 && compphpstring.indexOf("br") == -1))
240 {
241 jQuery("#httpcompphpok").hide();
242 jQuery("#httpcompphpko").show();
243 }
244 else
245 {
246 jQuery("#httpcompphpok").show();
247 jQuery("#httpcompphpko").hide();
248 }
249 }
250 })
251
252 var getcssurl;
253 var cachecssstring;
254 var compcssstring;
255 getcssurl = $.ajax({
256 type: "GET",
257 data: { token: \'notrequired\' },
258 url: \''.DOL_URL_ROOT.'/includes/jquery/css/base/jquery-ui.css\',
259 cache: false,
260 /* async: false, */
261 /* crossDomain: true, */
262 success: function () {
263 cachecssstring=getcssurl.getResponseHeader(\'Cache-Control\');
264 /* alert(\'css:\'+getcssurl.getAllResponseHeaders()); */
265 /*alert(\'css:\'+cachecssstring);*/
266 if (cachecssstring != null && cachecssstring.indexOf("no-cache") !== -1)
267 {
268 jQuery("#httpcachecssok").hide();
269 jQuery("#httpcachecssko").show();
270 }
271 else
272 {
273 jQuery("#httpcachecssok").show();
274 jQuery("#httpcachecssko").hide();
275 }
276 compcssstring=getcssurl.getResponseHeader(\'Content-Encoding\');
277 /* alert(\'php:\'+getcssurl.getAllResponseHeaders()); */
278 /*alert(\'php:\'+compcssstring);*/
279 if (compcssstring == null || (compcssstring.indexOf("gzip") == -1 && compcssstring.indexOf("deflate") == -1 && compcssstring.indexOf("br") == -1))
280 {
281 jQuery("#httpcompcssok").hide();
282 jQuery("#httpcompcssko").show();
283 }
284 else
285 {
286 jQuery("#httpcompcssok").show();
287 jQuery("#httpcompcssko").hide();
288 }
289 }
290 })
291
292 var getcssphpurl;
293 var cachecssphpstring;
294 var compcssphpstring;
295 getcssphpurl = $.ajax({
296 type: "GET",
297 data: { token: \''.currentToken().'\' },
298 url: \''.DOL_URL_ROOT.'/theme/eldy/style.css.php\',
299 cache: false,
300 /* async: false, */
301 /* crossDomain: true,*/
302 success: function () {
303 cachecssphpstring=getcssphpurl.getResponseHeader(\'Cache-Control\');
304 /* alert(\'cssphp:\'+getcssphpurl.getAllResponseHeaders()); */
305 /*alert(\'cssphp:\'+cachecssphpstring);*/
306 if (cachecssphpstring != null && cachecssphpstring.indexOf("no-cache") !== -1)
307 {
308 jQuery("#httpcachecssphpok").hide();
309 jQuery("#httpcachecssphpko").show();
310 }
311 else
312 {
313 jQuery("#httpcachecssphpok").show();
314 jQuery("#httpcachecssphpko").hide();
315 }
316 compcssphpstring=getcssphpurl.getResponseHeader(\'Content-Encoding\');
317 /* alert(\'php:\'+getcssphpurl.getAllResponseHeaders()); */
318 /*alert(\'php:\'+compcssphpstring);*/
319 if (compcssphpstring == null || (compcssphpstring.indexOf("gzip") == -1 && compcssphpstring.indexOf("deflate") == -1 && compcssphpstring.indexOf("br") == -1))
320 {
321 jQuery("#httpcompcssphpok").hide();
322 jQuery("#httpcompcssphpko").show();
323 }
324 else
325 {
326 jQuery("#httpcompcssphpok").show();
327 jQuery("#httpcompcssphpko").hide();
328 }
329 }
330 })
331
332 var getimgurl;
333 var cacheimgstring;
334 var compimgstring;
335 getimgurl = $.ajax({
336 type: "GET",
337 data: { token: \'notrequired\' },
338 url: \''.DOL_URL_ROOT.'/theme/eldy/img/help.png\',
339 cache: false,
340 /* async: false, */
341 /* crossDomain: true,*/
342 success: function () {
343 cacheimgstring=getimgurl.getResponseHeader(\'Cache-Control\');
344 /* alert(\'img:\'+getimgurl.getAllResponseHeaders()); */
345 /*alert(\'img:\'+cacheimgstring);*/
346 if (cacheimgstring != null && cacheimgstring.indexOf("no-cache") !== -1)
347 {
348 jQuery("#httpcacheimgok").hide();
349 jQuery("#httpcacheimgko").show();
350 }
351 else
352 {
353 jQuery("#httpcacheimgok").show();
354 jQuery("#httpcacheimgko").hide();
355 }
356 compimgstring=getimgurl.getResponseHeader(\'Content-Encoding\');
357 /* alert(\'php:\'+getimgurl.getAllResponseHeaders()); */
358 /*alert(\'php:\'+compimgstring);*/
359 if (compimgstring == null || (compimgstring.indexOf("gzip") == -1 && compimgstring.indexOf("deflate") == -1 && compimgstring.indexOf("br") == -1))
360 {
361 jQuery("#httpcompimgok").hide();
362 jQuery("#httpcompimgko").show();
363 }
364 else
365 {
366 jQuery("#httpcompimgok").show();
367 jQuery("#httpcompimgko").hide();
368 }
369 }
370 })
371
372 var getjsurl;
373 var cachejsstring;
374 var compjsstring;
375 getjsurl = $.ajax({
376 type: "GET",
377 data: { token: \'notrequired\' },
378 url: \''.DOL_URL_ROOT.'/core/js/lib_rare.js\',
379 cache: false,
380 /* async: false, */
381 /* crossDomain: true,*/
382 success: function () {
383 cachejsstring=getjsurl.getResponseHeader(\'Cache-Control\');
384 /*alert(\'js:\'+getjsurl.getAllResponseHeaders());*/
385 /*alert(\'js:\'+cachejsstring);*/
386 if (cachejsstring != null && cachejsstring.indexOf("no-cache") !== -1)
387 {
388 jQuery("#httpcachejsok").hide();
389 jQuery("#httpcachejsko").show();
390 }
391 else
392 {
393 jQuery("#httpcachejsok").show();
394 jQuery("#httpcachejsko").hide();
395 }
396 compjsstring=getjsurl.getResponseHeader(\'Content-Encoding\');
397 /* alert(\'js:\'+getjsurl.getAllResponseHeaders()); */
398 /*alert(\'js:\'+compjsstring);*/
399 if (compjsstring == null || (compjsstring.indexOf("gzip") == -1 && compjsstring.indexOf("deflate") == -1 && compjsstring.indexOf("br") == -1))
400 {
401 jQuery("#httpcompjsok").hide();
402 jQuery("#httpcompjsko").show();
403 }
404 else
405 {
406 jQuery("#httpcompjsok").show();
407 jQuery("#httpcompjsko").hide();
408 }
409 }
410 })
411
412 var getjsphpurl;
413 var cachejsphpstring;
414 var compjsphpstring;
415 getjsphpurl = $.ajax({
416 type: "GET",
417 data: { token: \''.currentToken().'\' },
418 url: \''.DOL_URL_ROOT.'/core/js/lib_head.js.php\',
419 cache: false,
420 /* async: false, */
421 /* crossDomain: true,*/
422 success: function () {
423 cachejsphpstring=getjsphpurl.getResponseHeader(\'Cache-Control\');
424 /* alert(\'jsphp:\'+getjsphpurl.getAllResponseHeaders()); */
425 /*alert(\'jsphp:\'+cachejsphpstring);*/
426 if (cachejsphpstring != null && cachejsphpstring.indexOf("no-cache") !== -1)
427 {
428 jQuery("#httpcachejsphpok").hide();
429 jQuery("#httpcachejsphpko").show();
430 }
431 else
432 {
433 jQuery("#httpcachejsphpok").show();
434 jQuery("#httpcachejsphpko").hide();
435 }
436 compjsphpstring=getjsphpurl.getResponseHeader(\'Content-Encoding\');
437 /* alert(\'php:\'+getjsphpurl.getAllResponseHeaders()); */
438 /*alert(\'php:\'+compjsphpstring);*/
439 if (compjsphpstring == null || (compjsphpstring.indexOf("gzip") == -1 && compjsphpstring.indexOf("deflate") == -1 && compjsphpstring.indexOf("br") == -1))
440 {
441 jQuery("#httpcompjsphpok").hide();
442 jQuery("#httpcompjsphpko").show();
443 }
444 else
445 {
446 jQuery("#httpcompjsphpok").show();
447 jQuery("#httpcompjsphpko").hide();
448 }
449 }
450 })
451
452});
453</script>';
454
455
456print '<br>';
457print img_picto('', 'folder', 'class="pictofixedwidth"');
458print '<strong>'.$langs->trans("HTTPCacheStaticResources").' - ';
459print $form->textwithpicto($langs->trans("CacheByServer"), $langs->trans("CacheByServerDesc"));
460print '</strong><br>';
461print '<div class="divsection">';
462// No cache on PHP
463//print '<div id="httpcachephpok">'.img_picto('','warning').' '.$langs->trans("FilesOfTypeNotCompressed",'php (.php)').'</div>';
464//print '<div id="httpcachephpko">'.img_picto('','tick').' '.$langs->trans("FilesOfTypeNotCached",'php (.php)').'</div>';
465// Cache on rest
466print '<div id="httpcachecssok">'.img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCached", 'css (.css)').'</div>';
467print '<div id="httpcachecssko">'.img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCached", 'css (.css)').'</div>';
468print '<div id="httpcachecssphpok">'.img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCached", 'css (.css.php)').'</div>';
469print '<div id="httpcachecssphpko">'.img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCached", 'css (.css.php)').'</div>';
470print '<div id="httpcacheimgok">'.img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCached", 'img (.png)').'</div>';
471print '<div id="httpcacheimgko">'.img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCached", 'img (.png)').'</div>';
472print '<div id="httpcachejsok">'.img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCached", 'javascript (.js)').'</div>';
473print '<div id="httpcachejsko">'.img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCached", 'javascript (.js)').'</div>';
474print '<div id="httpcachejsphpok">'.img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCached", 'javascript (.js.php)').'</div>';
475print '<div id="httpcachejsphpko">'.img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCached", 'javascript (.js.php)').'</div>';
476print '</div>';
477
478
479print '<br>';
480print img_picto('', 'folder', 'class="pictofixedwidth"');
481print '<strong>'.$langs->trans("HTTPCacheStaticResources").' - '.$langs->trans("CacheByClient").'</strong><br>';
482print '<div class="divsection">';
483print '<div id="httpcachebybrowser"><span class="opacitymedium">'.img_picto('', 'question.png', 'class="pictofixedwidth"').' '.$langs->trans("TestNotPossibleWithCurrentBrowsers").'</span></div>';
484print '</div>';
485
486
487// Compressions
488print '<br>';
489print img_picto('', 'folder', 'class="pictofixedwidth"');
490print '<strong>';
491print $form->textwithpicto($langs->trans("CompressionOfResources"), $langs->trans("CompressionOfResourcesDesc"));
492print '</strong>';
493print '<br>';
494print '<div class="divsection">';
495// on PHP
496print '<div id="httpcompphpok">'.img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed", 'php (.php)').'</div>';
497print '<div id="httpcompphpko">'.img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed", 'php (.php)').'</div>';
498// on rest
499print '<div id="httpcompcssok">'.img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed", 'css (.css)').'</div>';
500print '<div id="httpcompcssko">'.img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed", 'css (.css)').'</div>';
501print '<div id="httpcompcssphpok">'.img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed", 'css (.css.php)').'</div>';
502print '<div id="httpcompcssphpko">'.img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed", 'css (.css.php)').'</div>';
503//print '<div id="httpcompimgok">'.img_picto('','tick', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed",'img (.png)').'</div>';
504//print '<div id="httpcompimgko">'.img_picto('','warning', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed",'img (.png)').'</div>';
505print '<div id="httpcompjsok">'.img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed", 'javascript (.js)').'</div>';
506print '<div id="httpcompjsko">'.img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed", 'javascript (.js)').'</div>';
507print '<div id="httpcompjsphpok">'.img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed", 'javascript (.js.php)').'</div>';
508print '<div id="httpcompjsphpko">'.img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed", 'javascript (.js.php)').'</div>';
509print '</div>';
510
511// Database driver
512print '<br>';
513print img_picto('', 'folder', 'class="pictofixedwidth"');
514print '<strong>'.$langs->trans("DriverType").'</strong>';
515print '<br>';
516print '<div class="divsection">';
517if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') {
518 $test = ($conf->db->type == 'mysqli');
519 if ($test) {
520 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("YouUseBestDriver", $conf->db->type);
521 } else {
522 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("YouDoNotUseBestDriver", $conf->db->type, 'mysqli');
523 }
524 print '<br>';
525}
526print '</div>';
527
528print '<br>';
529print img_picto('', 'folder', 'class="pictofixedwidth"');
530print '<strong>'.$langs->trans("ComboListOptim").'</strong>';
531print '<br>';
532print '<div class="divsection">';
533// Product combo list
534$sql = "SELECT COUNT(*) as nb";
535$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
536$resql = $db->query($sql);
537if ($resql) {
538 $limitforoptim = 5000;
539 $num = $db->num_rows($resql);
540 $obj = $db->fetch_object($resql);
541 $nb = (int) $obj->nb;
542 if ($nb > $limitforoptim) {
543 if (!getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
544 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT');
545 } else {
546 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT', getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT'));
547 }
548 } else {
549 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
550 }
551 print '<br>';
552 $db->free($resql);
553}
554// Thirdparty combo list
555$sql = "SELECT COUNT(*) as nb";
556$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
557$resql = $db->query($sql);
558if ($resql) {
559 $limitforoptim = 5000;
560 $num = $db->num_rows($resql);
561 $obj = $db->fetch_object($resql);
562 $nb = (int) $obj->nb;
563 if ($nb > $limitforoptim) {
564 if (!getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
565 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT');
566 } else {
567 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT', getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT'));
568 }
569 } else {
570 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
571 }
572 print '<br>';
573 $db->free($resql);
574}
575// Contact combo list
576$sql = "SELECT COUNT(*) as nb";
577$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as s";
578$resql = $db->query($sql);
579if ($resql) {
580 $limitforoptim = 5000;
581 $num = $db->num_rows($resql);
582 $obj = $db->fetch_object($resql);
583 $nb = (int) $obj->nb;
584 if ($nb > $limitforoptim) {
585 if (!getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT')) {
586 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT');
587 } else {
588 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT', getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT'));
589 }
590 } else {
591 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Contacts"));
592 }
593 print '<br>';
594 $db->free($resql);
595}
596// Contact combo list
597$sql = "SELECT COUNT(*) as nb";
598$sql .= " FROM ".MAIN_DB_PREFIX."projet as s";
599$resql = $db->query($sql);
600if ($resql) {
601 $limitforoptim = 5000;
602 $num = $db->num_rows($resql);
603 $obj = $db->fetch_object($resql);
604 $nb = (int) $obj->nb;
605 if ($nb > $limitforoptim) {
606 if (!getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT')) {
607 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT');
608 } else {
609 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT', getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT'));
610 }
611 } else {
612 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Projects"));
613 }
614 print '<br>';
615 $db->free($resql);
616}
617// Bom combo list
618$sql = "SELECT COUNT(*) as nb";
619$sql .= " FROM ".$db->prefix()."bom_bom as s";
620$resql = $db->query($sql);
621if ($resql) {
622 $limitforoptim = 5000;
623 $num = $db->num_rows($resql);
624 $obj = $db->fetch_object($resql);
625 $nb = $obj->nb;
626 if ($nb > $limitforoptim) {
627 if (!getDolGlobalString('BOM_USE_SEARCH_TO_SELECT')) {
628 print img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Bom"), 'BOM_USE_SEARCH_TO_SELECT');
629 } else {
630 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Bom"), 'BOM_USE_SEARCH_TO_SELECT', getDolGlobalString('BOM_USE_SEARCH_TO_SELECT'));
631 }
632 } else {
633 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Bom"));
634 }
635 print '<br>';
636 $db->free($resql);
637}
638print '</div>';
639
640
641print '<br>';
642print img_picto('', 'folder', 'class="pictofixedwidth"');
643print '<strong>'.$langs->trans("SearchOptim").'</strong>';
644print '<br>';
645print '<div class="divsection">';
646// Product search
647$sql = "SELECT COUNT(*) as nb";
648$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
649$resql = $db->query($sql);
650if ($resql) {
651 $limitforoptim = 100000;
652 $num = $db->num_rows($resql);
653 $obj = $db->fetch_object($resql);
654 $nb = (int) $obj->nb;
655 if ($nb > $limitforoptim) {
656 if (!getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE')) {
657 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE');
658 print $langs->trans("YouHaveXObjectUseSearchOptimDesc");
659 } else {
660 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE', getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE'));
661 }
662 } else {
663 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
664 }
665 print '<br>';
666 $db->free($resql);
667}
668
669// Thirdparty search
670$sql = "SELECT COUNT(*) as nb";
671$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
672$resql = $db->query($sql);
673if ($resql) {
674 $limitforoptim = 100000;
675 $num = $db->num_rows($resql);
676 $obj = $db->fetch_object($resql);
677 $nb = (int) $obj->nb;
678 if ($nb > $limitforoptim) {
679 if (!getDolGlobalString('COMPANY_DONOTSEARCH_ANYWHERE')) {
680 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE');
681 print $langs->trans("YouHaveXObjectUseSearchOptimDesc");
682 } else {
683 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE', getDolGlobalString('COMPANY_DONOTSEARCH_ANYWHERE'));
684 }
685 } else {
686 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
687 }
688 print '<br>';
689 $db->free($resql);
690}
691
692// Perf advice on max size on list
693$MAXRECOMMENDED = 20;
694if (getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT') > $MAXRECOMMENDED) {
695 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveALargeAmountOfRecordOnLists", getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT'), $MAXRECOMMENDED);
696} else {
697 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("MaxNbOfRecordOnListIsOk", getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT'), $MAXRECOMMENDED);
698}
699
700print '</div>';
701
702
703// Browser
704
705print '<br>';
706print img_picto('', 'folder', 'class="pictofixedwidth"');
707print '<strong>'.$langs->trans("Browser").'</strong><br>';
708print '<div class="divsection">';
709if (!in_array($conf->browser->name, array('chrome', 'opera', 'safari', 'firefox'))) {
710 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("BrowserIsKO", $conf->browser->name);
711} else {
712 print img_picto('', 'tick', 'class="pictofixedwidth"').' '.$langs->trans("BrowserIsOK", $conf->browser->name);
713}
714print '<br>';
715print '</div>';
716
717// Options
718print '<br>';
719print img_picto('', 'folder', 'class="pictofixedwidth"');
720print '<strong>'.$langs->trans("Options").'</strong><br>';
721print '<div class="divsection">';
722if (getDolGlobalInt('MAIN_ACTIVATE_FILECACHE')) {
723 print img_picto('', 'tick', 'class="pictofixedwidth"');
724} else {
725 print img_picto('', 'minus', 'class="pictofixedwidth"');
726}
727print $form->textwithpicto($langs->trans("EnableFileCache").' ('.$langs->trans("Widgets").')', $langs->trans("Option").' MAIN_ACTIVATE_FILECACHE');
728print ': ';
729print yn(getDolGlobalInt('MAIN_ACTIVATE_FILECACHE'));
730print '<br>';
731
732if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
733 print img_picto('', 'tick', 'class="pictofixedwidth"');
734} else {
735 print img_picto('', 'minus', 'class="pictofixedwidth"');
736}
737print $form->textwithpicto($langs->trans('MAIN_ENABLE_AJAX_TOOLTIP'), $langs->trans("Option").' MAIN_ENABLE_AJAX_TOOLTIP');
738print ': ';
739print yn(getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP'));
740print '<br>';
741
742
743if (getDolGlobalInt('MAIN_CACHE_COUNT')) {
744 print img_picto('', 'tick', 'class="pictofixedwidth"');
745} else {
746 print img_picto('', 'minus', 'class="pictofixedwidth"');
747}
748print $form->textwithpicto($langs->trans('MAIN_CACHE_COUNT'), $langs->trans("Option").' MAIN_CACHE_COUNT');
749print ': ';
750print yn(getDolGlobalInt('MAIN_CACHE_COUNT'));
751//.' '.img_picto('', 'warning');
752print '<br>';
753
754print '</div>';
755
756
757
758// Experimental
759print '<br>';
760print img_picto('', 'folder', 'class="pictofixedwidth"');
761print '<strong>'.$langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')</strong><br>';
762print '<div class="divsection">';
763if (getDolGlobalInt('MAIN_DO_FETCH_IN_ONE_SQL_REQUEST')) {
764 print img_picto('', 'tick', 'class="pictofixedwidth"');
765} else {
766 print img_picto('', 'minus', 'class="pictofixedwidth"');
767}
768print $form->textwithpicto($langs->trans('MAIN_DO_FETCH_IN_ONE_SQL_REQUEST'), $langs->trans("Option").' MAIN_DO_FETCH_IN_ONE_SQL_REQUEST');
769print ' = '.getDolGlobalString('MAIN_DO_FETCH_IN_ONE_SQL_REQUEST', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>');
770//print ' &nbsp; ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>')."<br>";
771print '<br>';
772print '</div>';
773
774
775// End of page
776llxFooter();
777$db->close();
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to manage generation of HTML components Only common components must be here.
version_php()
Return PHP version.
dol_now($mode='gmt')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
currentToken()
Return the value of token currently saved into session with name 'token'.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.