Skip to content
Browse files

MDL-32967 add diagnostic strings for missing Microsoft drivers for SQ…

…L Server
  • Loading branch information...
1 parent 4886142 commit 7c4f93cd5f9c76c9a7f0f8aa820bd5b3af0f689a @skodak skodak committed
Showing with 7 additions and 1 deletion.
  1. +2 −0 lang/en/install.php
  2. +5 −1 lib/dml/sqlsrv_native_moodle_database.php
2 lang/en/install.php
@@ -356,6 +356,8 @@
$string['nativesqlsrv'] = 'SQL*Server Microsoft (native/sqlsrv)';
$string['nativesqlsrvhelp'] = 'Now you need to configure the database where most Moodle data will be stored.
This database must already have been created and a username and password created to access it. Table prefix is mandatory.';
+$string['nativesqlsrvnodriver'] = 'Microsoft Drivers for SQL Server for PHP are not installed or not configured properly.';
+$string['nativesqlsrvnonwindows'] = 'Microsoft Drivers for SQL Server for PHP are available only for Windows OS.';
$string['sqliteextensionisnotpresentinphp'] = 'PHP has not been properly configured with the SQLite extension. Please check your php.ini file or recompile PHP.';
$string['upgradingqtypeplugin'] = 'Upgrading question/type plugin';
$string['welcomep10'] = '{$a->installername} ({$a->installerversion})';
6 lib/dml/sqlsrv_native_moodle_database.php
@@ -59,7 +59,11 @@ public function driver_installed() {
// the name used by 'extension_loaded()' is case specific! The extension
// therefore *could be* mixed case and hence not found.
if (!function_exists('sqlsrv_num_rows')) {
- return get_string('sqlsrvextensionisnotpresentinphp', 'install');
+ if (stripos(PHP_OS, 'win') === 0) {
+ return get_string('nativesqlsrvnodriver', 'install');
+ } else {
+ return get_string('nativesqlsrvnonwindows', 'install');
+ }
return true;

0 comments on commit 7c4f93c

Please sign in to comment.
Something went wrong with that request. Please try again.