Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DatabaseDriver.php

function DatabaseDriver::getAutoloadInfo

File

core/lib/Drupal/Core/Extension/DatabaseDriver.php, line 165

Class

DatabaseDriver
Defines a database driver extension object.

Namespace

Drupal\Core\Extension

Code

public function getAutoloadInfo() : array {
    $this->getModuleInfo();
    $autoloadInfo = [
        'namespace' => $this->getNamespace(),
        'autoload' => $this->getPath() . DIRECTORY_SEPARATOR,
    ];
    foreach ($this->info['dependencies'] ?? [] as $dependency) {
        $dependencyData = Dependency::createFromString($dependency);
        $dependencyName = $dependencyData->getName();
        if (empty($this->discoveredModules[$dependencyName])) {
            throw new \RuntimeException(sprintf("Cannot find the module '%s' that is required by module '%s'", $dependencyName, $this->getModule()
                ->getName()));
        }
        $autoloadInfo['dependencies'][$dependencyName] = [
            'namespace' => "Drupal\\{$dependencyName}",
            'autoload' => $this->discoveredModules[$dependencyName]
                ->getPath() . '/src/',
        ];
    }
    return $autoloadInfo;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal