drush icon indicating copy to clipboard operation
drush copied to clipboard

Fixes #4591: Drush could not locate autoload.php when symlinked into …

Open Sweetchuck opened this issue 4 years ago • 2 comments

#4591 Exception: Could not locate autoload.php

Sweetchuck avatar Nov 22 '20 12:11 Sweetchuck

Seems harmless enough. Any thoughts @greg-1-anderson?

weitzman avatar Dec 05 '20 14:12 weitzman

drush updatedb works a little bit differently, so I had to change the priority.

if (file_exists($autoloadFile = $cwd . '/vendor/autoload.php')
    || file_exists($autoloadFile = $cwd . '/../vendor/autoload.php')
    || file_exists($autoloadFile = __DIR__ . '/vendor/autoload.php')
    || file_exists($autoloadFile = __DIR__ . '/../autoload.php')
    || file_exists($autoloadFile = __DIR__ . '/../../autoload.php')
) {
    $loader = include_once($autoloadFile);
} else {
    throw new \Exception("Could not locate autoload.php. cwd is $cwd; __DIR__ is " . __DIR__);
}

Sweetchuck avatar Dec 16 '20 21:12 Sweetchuck