diff --git a/app/Mage.php b/app/Mage.php index 8a019d43a7a..7e3e58afe5c 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -43,9 +43,14 @@ Varien_Autoload::register(); /** AUTOLOADER PATCH **/ -if (file_exists($autoloaderPath = (getenv('COMPOSER_VENDOR_PATH') ?: BP . DS . 'vendor') . DS . 'autoload.php')) { - require $autoloaderPath; +$autoloaderPath = getenv('COMPOSER_VENDOR_PATH'); +if (!$autoloaderPath) { + $autoloaderPath = dirname(BP) . DS . 'vendor'; + if (!is_dir($autoloaderPath)) { + $autoloaderPath = BP . DS . 'vendor'; + } } +require $autoloaderPath . DS . 'autoload.php'; /** AUTOLOADER PATCH **/ /* Support additional includes, such as composer's vendor/autoload.php files */