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 37476f0923
commit 3c82d3822b
1 changed files with 6 additions and 1 deletions

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