Added docs for MySQL strict mode + update validate to warn about it

This commit is contained in:
laf
2015-08-06 19:02:05 +00:00
parent 2537767f2d
commit b1c7b1ee67
4 changed files with 27 additions and 11 deletions
+11 -11
View File
@@ -13,13 +13,10 @@
* the source code distribution for details.
*/
require 'includes/console_colour.php';
$console_color = new Console_Color2();
$options = getopt('m:h::');
if (isset($options['h'])) {
print $console_color->convert(
echo
"\n Validate setup tool
Usage: ./validate.php [-m <module>] [-h]
@@ -31,7 +28,7 @@ if (isset($options['h'])) {
Example: ./validate.php -m mail.
"
);
;
exit;
}
@@ -71,6 +68,12 @@ else {
print_ok('Database connection successful');
}
// Test for MySQL Strict mode
$strict_mode = dbFetchCell("SELECT @@global.sql_mode");
if(strstr($strict_mode, 'STRICT_TRANS_TABLES')) {
print_warn('You have MySQL STRICT_TRANS_TABLES enabled, it is advisable to disable this until full support has been added: https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html');
}
// Test transports
if ($config['alerts']['email']['enable'] === true) {
print_warn('You have the old alerting system enabled - this is to be deprecated on the 1st of June 2015: https://groups.google.com/forum/#!topic/librenms-project/1llxos4m0p4');
@@ -203,21 +206,18 @@ foreach ($modules as $module) {
function print_ok($msg) {
global $console_color;
print $console_color->convert("%g[OK]%n %W$msg\n");
echo "[OK] $msg\n";
}//end print_ok()
function print_fail($msg) {
global $console_color;
print $console_color->convert("%r[FAIL]%n %W$msg\n");
echo "[FAIL] $msg\n";
}//end print_fail()
function print_warn($msg) {
global $console_color;
print $console_color->convert("%y[WARN]%n %W$msg\n");
echo "[WARN] $msg\n";
}//end print_warn()