You are here

function _dmu_ensure_autoload in Drupal 7 to 8/9 Module Upgrader 8

Checks for autoload.php and try to include it.

1 call to _dmu_ensure_autoload()
_dmu_validate_command in ./drupalmoduleupgrader.drush.inc
Validates any of the DMU commands.

File

./drupalmoduleupgrader.drush.inc, line 131
Declarations for Drush.

Code

function _dmu_ensure_autoload() {
  $locations = [
    __DIR__ . '/vendor/autoload.php',
    './vendor/autoload.php',
  ];
  foreach ($locations as $location) {
    if (file_exists($location)) {
      require_once $location;
      return;
    }
  }
  drush_set_error('no_autoload', 'autoload.php not found! Did you remember to run composer install from the drupalmoduleupgrader directory?');
}