Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-64153

Allow administrator to override sqlsrv connection options

XMLWordPrintable

    • MOODLE_31_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • MOODLE_402_STABLE
    • MDL-64153-master
    • Hide
      1. Install Moodle with SQL server as the database, and ensure it's running well.
      2. Add the following to /config.php (or add the 'extrainfo' property if $CFG->dboptions is already defined):

        $CFG->dboptions = [
            'extrainfo' => [
                'Database' => 'SomeDbThatDoesntExist',
                'UID' => 'nouser'     
             ],
        ];
        

      3. Reload the page
      4. Verify that you cannot access Moodle, and you will get a page with a warning "Error: Database connection failed".
      Show
      Install Moodle with SQL server as the database, and ensure it's running well. Add the following to /config.php (or add the 'extrainfo' property if $CFG->dboptions is already defined): $CFG->dboptions = [ 'extrainfo' => [ 'Database' => 'SomeDbThatDoesntExist', 'UID' => 'nouser'     ], ]; Reload the page Verify that you cannot access Moodle, and you will get a page with a warning "Error: Database connection failed" .
    • 2
    • Team Hedgehog Sprint 1.3

      Summary

      The sqlsrv extension's sqlsrv_connect() function has a $connectionInfo parameter that allows the user to set a bunch of connection options.

      At present Moodle sets a limited number of these keys and doesn't allow the user to override/extend these to meet their environments. This change adds a new $CFG->dboptions['sqlsrvinfo'] option that allows the user to alter and override any connection options.

      Example use case

      If the user has multiple ODBC drivers installed and configured in /etc/odbcinst.ini it may be necessary to set the Driver key to ensure that the correct version of the driver is used.

            meirza.arson@moodle.com Meirza
            lukecarrier Luke Carrier
            Huong Nguyen Huong Nguyen
            Paul Holden Paul Holden
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Time Spent - 5 hours, 13 minutes Remaining Estimate - 1 day, 40 minutes
                1d 40m
                Logged:
                Time Spent - 5 hours, 13 minutes Remaining Estimate - 1 day, 40 minutes
                5h 13m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.