function drush_drupal_load_autoloader

8.0.x drupal.inc drush_drupal_load_autoloader($drupal_root)
7.x drupal.inc drush_drupal_load_autoloader($drupal_root)
master drupal.inc drush_drupal_load_autoloader($drupal_root)

Loads the Drupal autoloader and returns the instance.

4 calls to drush_drupal_load_autoloader()
DrupalBoot8::bootstrap_drupal_configuration in lib/Drush/Boot/DrupalBoot8.php
Initialize and load the Drupal configuration files.
DrupalBoot8::get_version in lib/Drush/Boot/DrupalBoot8.php
Given a site root directory, determine the exact version of the software.
drush_cache_rebuild in commands/core/cache.drush.inc
Rebuild a Drupal 8 site.
drush_core_site_install_version in commands/core/drupal/site_install.inc
Install Drupal 8+

File

includes/drupal.inc, line 13
Utility functions related to Drupal.

Code

function drush_drupal_load_autoloader($drupal_root) {
  static $autoloader = FALSE;

  if (!$autoloader) {
    $autoloader = require $drupal_root . '/autoload.php';
    if ($autoloader === TRUE) {
      // The autoloader was already require(). Assume that Drush and Drupal share an autoloader per
      // "Point autoload.php to the proper vendor directory" - https://www.drupal.org/node/2404989
      $autoloader = drush_get_context('DRUSH_CLASSLOADER');
    }
  }
  return $autoloader;
}