Problem/Motivation

In #3217531: Deprecate usage of Connection::getDriverClass for some classes, and use standard autoloading instead, usage of Connection::getDriverClass() was deprecated for several classes. Connection::getDriverClass() cannot be deprecated itself since there are more cases where it's in use.

Proposed resolution

In this issue, deprecate usage of Connection::getDriverClass for 'Install\Tasks' calls.

Then, in #3217699: Convert select query extenders to backend-overrideable services it should be possible to finally deprecate the method.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3375919

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mondrake created an issue. See original summary.

mondrake’s picture

mondrake’s picture

Status: Active » Needs review

Simple change. It's not worth adding a convenience method in Connection in this case, since the Tasks class gets instantiated directly without connection by the installation routines. Could think of a static method, but that would be a bigger change.

daffie’s picture

Status: Needs review » Reviewed & tested by the community

All code changes look good.
Just one more class added to the conditional deprecation of Connection::getDriverClass
For me it is RTBC.

The following text needs to be added to the CR:

The replacement for the database class "Install\Tasks" is:

// Before
$class = Database::getConnection()->getDriverClass('Install\\Tasks');

// Replacement
$class = Database::getConnection()->getConnectionOptions()['namespace'] . '\\Install\\Tasks';

  • longwave committed e8073004 on 11.x
    Issue #3375919 by mondrake, daffie: Deprecate usage of Connection::...
longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed e807300 and pushed to 11.x. Thanks!

daffie’s picture

Updated the CR.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.