dolibarr 21.0.0-beta
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 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"));
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// Get PHP version
72$phpversion = version_php();
73print "<br><strong>PHP</strong> - ".$langs->trans("Version").": ".$phpversion."\n";
74
75// Get version web server
76print "<br><strong>Web server</strong> - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
77
78print '<hr>';
79
80print "<br>\n";
81
82// XDebug
83print '<br>';
84print '<strong>'.$langs->trans("XDebug").'</strong><br>';
85print '<div class="divsection">';
86$test = !function_exists('xdebug_is_enabled');
87if ($test) {
88 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
89} else {
90 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
91 print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';
92}
93print '<br>';
94print '</div>';
95
96// Module log
97print '<br>';
98print '<strong>'.$langs->trans("Syslog").'</strong><br>';
99print '<div class="divsection">';
100$test = !isModEnabled('syslog');
101if ($test) {
102 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
103} else {
104 if (getDolGlobalInt('SYSLOG_LEVEL') > LOG_NOTICE) {
105 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("ModuleActivatedWithTooHighLogLevel", $langs->transnoentities("Syslog"));
106 } else {
107 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("ModuleSyslogActivatedButLevelNotTooVerbose", $langs->transnoentities("Syslog"), getDolGlobalInt('SYSLOG_LEVEL'));
108 }
109 //print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
110}
111print '<br>';
112print '</div>';
113
114// Module debugbar
115print '<br>';
116print '<strong>'.$langs->trans("DebugBar").'</strong><br>';
117print '<div class="divsection">';
118$test = !isModEnabled('debugbar');
119if ($test) {
120 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
121} else {
122 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar"));
123 //print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
124}
125print '<br>';
126print '</div>';
127
128// Applicative cache
129print '<br>';
130print '<strong>'.$langs->trans("ApplicativeCache").'</strong><br>';
131print '<div class="divsection">';
132$test = isModEnabled('memcached');
133if ($test) {
134 if (getDolGlobalString('MEMCACHED_SERVER')) {
135 print $langs->trans("MemcachedAvailableAndSetup");
136 print ' '.$langs->trans("MoreInformation").' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
137 } else {
138 print $langs->trans("MemcachedModuleAvailableButNotSetup");
139 print ' <a href="'.dol_buildpath('/memcached/admin/memcached.php', 1).'">Memcached module admin page</a>';
140 }
141} else {
142 print $langs->trans("MemcachedNotAvailable");
143}
144print '</br>';
145print '</div>';
146
147// OPCode cache
148print '<br>';
149print '<strong>'.$langs->trans("OPCodeCache").'</strong><br>';
150print '<div class="divsection">';
151$foundcache = 0;
152$test = function_exists('xcache_info');
153if (!$foundcache && $test) {
154 $foundcache++;
155 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("PHPModuleLoaded", "XCache");
156 print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xcache.php">Xcache admin page</a>';
157}
158$test = function_exists('eaccelerator_info');
159if (!$foundcache && $test) {
160 $foundcache++;
161 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("PHPModuleLoaded", "Eaccelerator");
162}
163$test = function_exists('opcache_get_status');
164if (!$foundcache && $test) {
165 $foundcache++;
166 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("PHPModuleLoaded", "ZendOPCache"); // Should be by default starting with PHP 5.5
167 //$tmp=opcache_get_status();
168 //var_dump($tmp);
169}
170$test = function_exists('apc_cache_info');
171if (!$foundcache && $test) {
172 //var_dump(apc_cache_info());
173 if (ini_get('apc.enabled')) {
174 $foundcache++;
175 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("APCInstalled");
176 } else {
177 print img_picto('', 'warning', 'class="pictofixedwidth"').' '.$langs->trans("APCCacheInstalledButDisabled");
178 }
179}
180if (!$foundcache) {
181 print $langs->trans("NoOPCodeCacheFound");
182}
183print '<br>';
184print '</div>';
185
186// Use of preload bootstrap
187print '<br>';
188print '<strong>'.$langs->trans("PreloadOPCode").'</strong><br>';
189print '<div class="divsection">';
190if (ini_get('opcache.preload')) {
191 print ini_get('opcache.preload');
192} else {
193 print img_picto('', 'minus', 'class="pictofixedwidth"').' '.$langs->trans("No");
194}
195print '<br>';
196print '</div>';
197
198// HTTPCacheStaticResources
199print '<script type="text/javascript">
200jQuery(document).ready(function() {
201 var getphpurl;
202 var cachephpstring;
203 var compphpstring;
204 getphpurl = $.ajax({
205 type: "GET",
206 data: { token: \''.currentToken().'\' },
207 url: \''.DOL_URL_ROOT.'/public/notice.php\',
208 cache: false,
209 /* async: false, */
210 /* crossDomain: true,*/
211 success: function () {
212 cachephpstring=getphpurl.getResponseHeader(\'Cache-Control\');
213 /* alert(\'php:\'+getphpurl.getAllResponseHeaders()); */
214 /*alert(\'php:\'+cachephpstring);*/
215 if (cachephpstring == null || cachephpstring.indexOf("no-cache") !== -1)
216 {
217 jQuery("#httpcachephpok").hide();
218 jQuery("#httpcachephpko").show();
219 }
220 else
221 {
222 jQuery("#httpcachephpok").show();
223 jQuery("#httpcachephpko").hide();
224 }
225 compphpstring=getphpurl.getResponseHeader(\'Content-Encoding\');
226 /* alert(\'php:\'+getphpurl.getAllResponseHeaders()); */
227 /*alert(\'php:\'+compphpstring);*/
228 if (compphpstring == null || (compphpstring.indexOf("gzip") == -1 && compphpstring.indexOf("deflate") == -1 && compphpstring.indexOf("br") == -1))
229 {
230 jQuery("#httpcompphpok").hide();
231 jQuery("#httpcompphpko").show();
232 }
233 else
234 {
235 jQuery("#httpcompphpok").show();
236 jQuery("#httpcompphpko").hide();
237 }
238 }
239 })
240
241 var getcssurl;
242 var cachecssstring;
243 var compcssstring;
244 getcssurl = $.ajax({
245 type: "GET",
246 data: { token: \'notrequired\' },
247 url: \''.DOL_URL_ROOT.'/includes/jquery/css/base/jquery-ui.css\',
248 cache: false,
249 /* async: false, */
250 /* crossDomain: true, */
251 success: function () {
252 cachecssstring=getcssurl.getResponseHeader(\'Cache-Control\');
253 /* alert(\'css:\'+getcssurl.getAllResponseHeaders()); */
254 /*alert(\'css:\'+cachecssstring);*/
255 if (cachecssstring != null && cachecssstring.indexOf("no-cache") !== -1)
256 {
257 jQuery("#httpcachecssok").hide();
258 jQuery("#httpcachecssko").show();
259 }
260 else
261 {
262 jQuery("#httpcachecssok").show();
263 jQuery("#httpcachecssko").hide();
264 }
265 compcssstring=getcssurl.getResponseHeader(\'Content-Encoding\');
266 /* alert(\'php:\'+getcssurl.getAllResponseHeaders()); */
267 /*alert(\'php:\'+compcssstring);*/
268 if (compcssstring == null || (compcssstring.indexOf("gzip") == -1 && compcssstring.indexOf("deflate") == -1 && compcssstring.indexOf("br") == -1))
269 {
270 jQuery("#httpcompcssok").hide();
271 jQuery("#httpcompcssko").show();
272 }
273 else
274 {
275 jQuery("#httpcompcssok").show();
276 jQuery("#httpcompcssko").hide();
277 }
278 }
279 })
280
281 var getcssphpurl;
282 var cachecssphpstring;
283 var compcssphpstring;
284 getcssphpurl = $.ajax({
285 type: "GET",
286 data: { token: \''.currentToken().'\' },
287 url: \''.DOL_URL_ROOT.'/theme/eldy/style.css.php\',
288 cache: false,
289 /* async: false, */
290 /* crossDomain: true,*/
291 success: function () {
292 cachecssphpstring=getcssphpurl.getResponseHeader(\'Cache-Control\');
293 /* alert(\'cssphp:\'+getcssphpurl.getAllResponseHeaders()); */
294 /*alert(\'cssphp:\'+cachecssphpstring);*/
295 if (cachecssphpstring != null && cachecssphpstring.indexOf("no-cache") !== -1)
296 {
297 jQuery("#httpcachecssphpok").hide();
298 jQuery("#httpcachecssphpko").show();
299 }
300 else
301 {
302 jQuery("#httpcachecssphpok").show();
303 jQuery("#httpcachecssphpko").hide();
304 }
305 compcssphpstring=getcssphpurl.getResponseHeader(\'Content-Encoding\');
306 /* alert(\'php:\'+getcssphpurl.getAllResponseHeaders()); */
307 /*alert(\'php:\'+compcssphpstring);*/
308 if (compcssphpstring == null || (compcssphpstring.indexOf("gzip") == -1 && compcssphpstring.indexOf("deflate") == -1 && compcssphpstring.indexOf("br") == -1))
309 {
310 jQuery("#httpcompcssphpok").hide();
311 jQuery("#httpcompcssphpko").show();
312 }
313 else
314 {
315 jQuery("#httpcompcssphpok").show();
316 jQuery("#httpcompcssphpko").hide();
317 }
318 }
319 })
320
321 var getimgurl;
322 var cacheimgstring;
323 var compimgstring;
324 getimgurl = $.ajax({
325 type: "GET",
326 data: { token: \'notrequired\' },
327 url: \''.DOL_URL_ROOT.'/theme/eldy/img/help.png\',
328 cache: false,
329 /* async: false, */
330 /* crossDomain: true,*/
331 success: function () {
332 cacheimgstring=getimgurl.getResponseHeader(\'Cache-Control\');
333 /* alert(\'img:\'+getimgurl.getAllResponseHeaders()); */
334 /*alert(\'img:\'+cacheimgstring);*/
335 if (cacheimgstring != null && cacheimgstring.indexOf("no-cache") !== -1)
336 {
337 jQuery("#httpcacheimgok").hide();
338 jQuery("#httpcacheimgko").show();
339 }
340 else
341 {
342 jQuery("#httpcacheimgok").show();
343 jQuery("#httpcacheimgko").hide();
344 }
345 compimgstring=getimgurl.getResponseHeader(\'Content-Encoding\');
346 /* alert(\'php:\'+getimgurl.getAllResponseHeaders()); */
347 /*alert(\'php:\'+compimgstring);*/
348 if (compimgstring == null || (compimgstring.indexOf("gzip") == -1 && compimgstring.indexOf("deflate") == -1 && compimgstring.indexOf("br") == -1))
349 {
350 jQuery("#httpcompimgok").hide();
351 jQuery("#httpcompimgko").show();
352 }
353 else
354 {
355 jQuery("#httpcompimgok").show();
356 jQuery("#httpcompimgko").hide();
357 }
358 }
359 })
360
361 var getjsurl;
362 var cachejsstring;
363 var compjsstring;
364 getjsurl = $.ajax({
365 type: "GET",
366 data: { token: \'notrequired\' },
367 url: \''.DOL_URL_ROOT.'/core/js/lib_rare.js\',
368 cache: false,
369 /* async: false, */
370 /* crossDomain: true,*/
371 success: function () {
372 cachejsstring=getjsurl.getResponseHeader(\'Cache-Control\');
373 /*alert(\'js:\'+getjsurl.getAllResponseHeaders());*/
374 /*alert(\'js:\'+cachejsstring);*/
375 if (cachejsstring != null && cachejsstring.indexOf("no-cache") !== -1)
376 {
377 jQuery("#httpcachejsok").hide();
378 jQuery("#httpcachejsko").show();
379 }
380 else
381 {
382 jQuery("#httpcachejsok").show();
383 jQuery("#httpcachejsko").hide();
384 }
385 compjsstring=getjsurl.getResponseHeader(\'Content-Encoding\');
386 /* alert(\'js:\'+getjsurl.getAllResponseHeaders()); */
387 /*alert(\'js:\'+compjsstring);*/
388 if (compjsstring == null || (compjsstring.indexOf("gzip") == -1 && compjsstring.indexOf("deflate") == -1 && compjsstring.indexOf("br") == -1))
389 {
390 jQuery("#httpcompjsok").hide();
391 jQuery("#httpcompjsko").show();
392 }
393 else
394 {
395 jQuery("#httpcompjsok").show();
396 jQuery("#httpcompjsko").hide();
397 }
398 }
399 })
400
401 var getjsphpurl;
402 var cachejsphpstring;
403 var compjsphpstring;
404 getjsphpurl = $.ajax({
405 type: "GET",
406 data: { token: \''.currentToken().'\' },
407 url: \''.DOL_URL_ROOT.'/core/js/lib_head.js.php\',
408 cache: false,
409 /* async: false, */
410 /* crossDomain: true,*/
411 success: function () {
412 cachejsphpstring=getjsphpurl.getResponseHeader(\'Cache-Control\');
413 /* alert(\'jsphp:\'+getjsphpurl.getAllResponseHeaders()); */
414 /*alert(\'jsphp:\'+cachejsphpstring);*/
415 if (cachejsphpstring != null && cachejsphpstring.indexOf("no-cache") !== -1)
416 {
417 jQuery("#httpcachejsphpok").hide();
418 jQuery("#httpcachejsphpko").show();
419 }
420 else
421 {
422 jQuery("#httpcachejsphpok").show();
423 jQuery("#httpcachejsphpko").hide();
424 }
425 compjsphpstring=getjsphpurl.getResponseHeader(\'Content-Encoding\');
426 /* alert(\'php:\'+getjsphpurl.getAllResponseHeaders()); */
427 /*alert(\'php:\'+compjsphpstring);*/
428 if (compjsphpstring == null || (compjsphpstring.indexOf("gzip") == -1 && compjsphpstring.indexOf("deflate") == -1 && compjsphpstring.indexOf("br") == -1))
429 {
430 jQuery("#httpcompjsphpok").hide();
431 jQuery("#httpcompjsphpko").show();
432 }
433 else
434 {
435 jQuery("#httpcompjsphpok").show();
436 jQuery("#httpcompjsphpko").hide();
437 }
438 }
439 })
440
441});
442</script>';
443
444
445print '<br>';
446print '<strong>'.$langs->trans("HTTPCacheStaticResources").' - ';
447print $form->textwithpicto($langs->trans("CacheByServer"), $langs->trans("CacheByServerDesc"));
448print '</strong><br>';
449print '<div class="divsection">';
450// No cache on PHP
451//print '<div id="httpcachephpok">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'php (.php)').'</div>';
452//print '<div id="httpcachephpko">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeNotCached",'php (.php)').'</div>';
453// Cache on rest
454print '<div id="httpcachecssok">'.img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCached", 'css (.css)').'</div>';
455print '<div id="httpcachecssko">'.img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCached", 'css (.css)').'</div>';
456print '<div id="httpcachecssphpok">'.img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCached", 'css (.css.php)').'</div>';
457print '<div id="httpcachecssphpko">'.img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCached", 'css (.css.php)').'</div>';
458print '<div id="httpcacheimgok">'.img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCached", 'img (.png)').'</div>';
459print '<div id="httpcacheimgko">'.img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCached", 'img (.png)').'</div>';
460print '<div id="httpcachejsok">'.img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCached", 'javascript (.js)').'</div>';
461print '<div id="httpcachejsko">'.img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCached", 'javascript (.js)').'</div>';
462print '<div id="httpcachejsphpok">'.img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCached", 'javascript (.js.php)').'</div>';
463print '<div id="httpcachejsphpko">'.img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCached", 'javascript (.js.php)').'</div>';
464print '</div>';
465print '<br>';
466print '<strong>'.$langs->trans("HTTPCacheStaticResources").' - '.$langs->trans("CacheByClient").'</strong><br>';
467print '<div class="divsection">';
468print '<div id="httpcachebybrowser">'.img_picto('', 'question.png', 'class="pictofixedwidth"').' '.$langs->trans("TestNotPossibleWithCurrentBrowsers").'</div>';
469print '</div>';
470
471// Compressions
472print '<br>';
473print '<strong>';
474print $form->textwithpicto($langs->trans("CompressionOfResources"), $langs->trans("CompressionOfResourcesDesc"));
475print '</strong>';
476print '<br>';
477print '<div class="divsection">';
478// on PHP
479print '<div id="httpcompphpok">'.img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed", 'php (.php)').'</div>';
480print '<div id="httpcompphpko">'.img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed", 'php (.php)').'</div>';
481// on rest
482print '<div id="httpcompcssok">'.img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed", 'css (.css)').'</div>';
483print '<div id="httpcompcssko">'.img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed", 'css (.css)').'</div>';
484print '<div id="httpcompcssphpok">'.img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed", 'css (.css.php)').'</div>';
485print '<div id="httpcompcssphpko">'.img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed", 'css (.css.php)').'</div>';
486//print '<div id="httpcompimgok">'.img_picto('','tick.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed",'img (.png)').'</div>';
487//print '<div id="httpcompimgko">'.img_picto('','warning.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed",'img (.png)').'</div>';
488print '<div id="httpcompjsok">'.img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed", 'javascript (.js)').'</div>';
489print '<div id="httpcompjsko">'.img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed", 'javascript (.js)').'</div>';
490print '<div id="httpcompjsphpok">'.img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeCompressed", 'javascript (.js.php)').'</div>';
491print '<div id="httpcompjsphpko">'.img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("FilesOfTypeNotCompressed", 'javascript (.js.php)').'</div>';
492print '</div>';
493
494// Database driver
495print '<br>';
496print '<strong>'.$langs->trans("DriverType").'</strong>';
497print '<br>';
498print '<div class="divsection">';
499if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') {
500 $test = ($conf->db->type == 'mysqli');
501 if ($test) {
502 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("YouUseBestDriver", $conf->db->type);
503 } else {
504 print img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("YouDoNotUseBestDriver", $conf->db->type, 'mysqli');
505 }
506 print '<br>';
507}
508print '</div>';
509
510print '<br>';
511print '<strong>'.$langs->trans("ComboListOptim").'</strong>';
512print '<br>';
513print '<div class="divsection">';
514// Product combo list
515$sql = "SELECT COUNT(*) as nb";
516$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
517$resql = $db->query($sql);
518if ($resql) {
519 $limitforoptim = 5000;
520 $num = $db->num_rows($resql);
521 $obj = $db->fetch_object($resql);
522 $nb = $obj->nb;
523 if ($nb > $limitforoptim) {
524 if (!getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT')) {
525 print img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT');
526 } else {
527 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT', getDolGlobalString('PRODUIT_USE_SEARCH_TO_SELECT'));
528 }
529 } else {
530 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
531 }
532 print '<br>';
533 $db->free($resql);
534}
535// Thirdparty combo list
536$sql = "SELECT COUNT(*) as nb";
537$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
538$resql = $db->query($sql);
539if ($resql) {
540 $limitforoptim = 5000;
541 $num = $db->num_rows($resql);
542 $obj = $db->fetch_object($resql);
543 $nb = $obj->nb;
544 if ($nb > $limitforoptim) {
545 if (!getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT')) {
546 print img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT');
547 } else {
548 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT', getDolGlobalString('COMPANY_USE_SEARCH_TO_SELECT'));
549 }
550 } else {
551 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
552 }
553 print '<br>';
554 $db->free($resql);
555}
556// Contact combo list
557$sql = "SELECT COUNT(*) as nb";
558$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as s";
559$resql = $db->query($sql);
560if ($resql) {
561 $limitforoptim = 5000;
562 $num = $db->num_rows($resql);
563 $obj = $db->fetch_object($resql);
564 $nb = $obj->nb;
565 if ($nb > $limitforoptim) {
566 if (!getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT')) {
567 print img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT');
568 } else {
569 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT', getDolGlobalString('CONTACT_USE_SEARCH_TO_SELECT'));
570 }
571 } else {
572 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Contacts"));
573 }
574 print '<br>';
575 $db->free($resql);
576}
577// Contact combo list
578$sql = "SELECT COUNT(*) as nb";
579$sql .= " FROM ".MAIN_DB_PREFIX."projet as s";
580$resql = $db->query($sql);
581if ($resql) {
582 $limitforoptim = 5000;
583 $num = $db->num_rows($resql);
584 $obj = $db->fetch_object($resql);
585 $nb = $obj->nb;
586 if ($nb > $limitforoptim) {
587 if (!getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT')) {
588 print img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT');
589 } else {
590 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT', getDolGlobalString('PROJECT_USE_SEARCH_TO_SELECT'));
591 }
592 } else {
593 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Projects"));
594 }
595 print '<br>';
596 $db->free($resql);
597}
598print '</div>';
599
600print '<br>';
601print '<strong>'.$langs->trans("SearchOptim").'</strong>';
602print '<br>';
603print '<div class="divsection">';
604// Product search
605$sql = "SELECT COUNT(*) as nb";
606$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
607$resql = $db->query($sql);
608if ($resql) {
609 $limitforoptim = 100000;
610 $num = $db->num_rows($resql);
611 $obj = $db->fetch_object($resql);
612 $nb = $obj->nb;
613 if ($nb > $limitforoptim) {
614 if (!getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE')) {
615 print img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE');
616 print $langs->trans("YouHaveXObjectUseSearchOptimDesc");
617 } else {
618 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE', getDolGlobalString('PRODUCT_DONOTSEARCH_ANYWHERE'));
619 }
620 } else {
621 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"));
622 }
623 print '<br>';
624 $db->free($resql);
625}
626
627// Thirdparty search
628$sql = "SELECT COUNT(*) as nb";
629$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
630$resql = $db->query($sql);
631if ($resql) {
632 $limitforoptim = 100000;
633 $num = $db->num_rows($resql);
634 $obj = $db->fetch_object($resql);
635 $nb = $obj->nb;
636 if ($nb > $limitforoptim) {
637 if (!getDolGlobalString('COMPANY_DONOTSEARCH_ANYWHERE')) {
638 print img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE');
639 print $langs->trans("YouHaveXObjectUseSearchOptimDesc");
640 } else {
641 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE', getDolGlobalString('COMPANY_DONOTSEARCH_ANYWHERE'));
642 }
643 } else {
644 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties"));
645 }
646 print '<br>';
647 $db->free($resql);
648}
649
650// Perf advice on max size on list
651$MAXRECOMMENDED = 20;
652if (getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT') > $MAXRECOMMENDED) {
653 print img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("YouHaveALargeAmountOfRecordOnLists", getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT'), $MAXRECOMMENDED);
654} else {
655 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("MaxNbOfRecordOnListIsOk", getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT'), $MAXRECOMMENDED);
656}
657
658print '</div>';
659
660
661// Browser
662
663print '<br>';
664print '<strong>'.$langs->trans("Browser").'</strong><br>';
665print '<div class="divsection">';
666if (!in_array($conf->browser->name, array('chrome', 'opera', 'safari', 'firefox'))) {
667 print img_picto('', 'warning.png', 'class="pictofixedwidth"').' '.$langs->trans("BrowserIsKO", $conf->browser->name);
668} else {
669 print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("BrowserIsOK", $conf->browser->name);
670}
671print '<br>';
672print '</div>';
673
674// Options
675print '<br>';
676print '<strong>'.$langs->trans("Options").'</strong><br>';
677print '<div class="divsection">';
678if (getDolGlobalInt('MAIN_ACTIVATE_FILECACHE')) {
679 print img_picto('', 'tick.png', 'class="pictofixedwidth"');
680} else {
681 print img_picto('', 'minus', 'class="pictofixedwidth"');
682}
683print $form->textwithpicto($langs->trans("EnableFileCache").' ('.$langs->trans("Widgets").')', $langs->trans("Option").' MAIN_ACTIVATE_FILECACHE');
684print ': '.yn(getDolGlobalInt('MAIN_ACTIVATE_FILECACHE'));
685print '<br>';
686
687if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
688 print img_picto('', 'tick.png', 'class="pictofixedwidth"');
689} else {
690 print img_picto('', 'minus', 'class="pictofixedwidth"');
691}
692print 'MAIN_ENABLE_AJAX_TOOLTIP : ';
693print yn(getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP'));
694print '<br>';
695
696
697if (getDolGlobalInt('MAIN_CACHE_COUNT')) {
698 print img_picto('', 'tick.png', 'class="pictofixedwidth"');
699} else {
700 print img_picto('', 'minus', 'class="pictofixedwidth"');
701}
702print 'MAIN_CACHE_COUNT : ';
703print yn(getDolGlobalInt('MAIN_CACHE_COUNT'));
704//.' '.img_picto('', 'warning.png');
705print '<br>';
706
707
708print '</div>';
709
710// End of page
711llxFooter();
712$db->close();
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:71
Class to manage generation of HTML components Only common components must be here.
llxFooter()
Footer empty.
Definition document.php:107
version_php()
Return PHP version.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
currentToken()
Return the value of token currently saved into session with name 'token'.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.