Check Windows ODBC DSN during install (#2798)

* ODBC DSN detection

* Merge remote-tracking branch 'upstream/master'

* Merge remote-tracking branch 'upstream/master'
This commit is contained in:
sergey-mz
2017-11-19 00:53:08 -05:00
committed by FusionPBX
parent 983c2fc594
commit 4454067b2d

View File

@@ -170,7 +170,12 @@
}
//test for windows and non sqlite
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' and strlen($db_type) > 0 and $db_type !='sqlite') {
$messages[] = "<b>Windows requires a system DSN ODBC connection</b> this must be configured.";
//Test for ODBC DSN in ODBC.INI. It should have section:
//[fusionpbx]
//Driver32=C:\Program Files\psqlODBC\0906\bin\psqlodbc35w.dll
if ( preg_match('/\[fusionpbx\]/mi', file_get_contents('c:/Windows/ODBC.INI')) == 0 ) {
$messages[] = "<b>Windows requires a system DSN ODBC connection with name 'fusionpbx'.</b>";
}
}
//action code