1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 13:51:54 +01:00

Merge pull request #9044 from kkmuffme/absolute-autoloader-path-not-working

fix autoloader not working with absolute path
This commit is contained in:
orklah 2023-01-04 22:11:38 +01:00 committed by GitHub
commit 7d6a48ab14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1065,7 +1065,14 @@ class Config
$autoloader_path = $config->base_dir . DIRECTORY_SEPARATOR . $config_xml['autoloader'];
if (!file_exists($autoloader_path)) {
throw new ConfigException('Cannot locate autoloader');
// in here for legacy reasons where people put absolute paths but psalm resolved it relative
if ($config_xml['autoloader']->__toString()[0] === '/') {
$autoloader_path = $config_xml['autoloader']->__toString();
}
if (!file_exists($autoloader_path)) {
throw new ConfigException('Cannot locate autoloader');
}
}
$config->autoloader = realpath($autoloader_path);