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