Commit e611ac5c authored by catch's avatar catch
Browse files

Issue #3426789 by mondrake, smustgrave: DatabaseDriver::load should have a...

Issue #3426789 by mondrake, smustgrave: DatabaseDriver::load should have a non-service alternative for class loading

(cherry picked from commit 5c22ac47)
(cherry picked from commit 5a112ceb)
parent 36a0569d
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -90,7 +90,12 @@ public function getPath() {
   */
  public function load() {
    if (!isset($this->classLoader)) {
      if (\Drupal::hasContainer() && \Drupal::hasService('class_loader')) {
        $this->classLoader = \Drupal::service('class_loader');
      }
      else {
        $this->classLoader = require DRUPAL_ROOT . '/autoload.php';
      }
      $this->classLoader->addPsr4($this->getNamespace() . '\\', $this->getPath());
      foreach (($this->getAutoloadInfo()['dependencies'] ?? []) as $dependency) {
        $this->classLoader->addPsr4($dependency['namespace'] . '\\', $dependency['autoload']);