Skip to content

Commit d3dcc76

Browse files
Fix autoloader patch to work with composer-installed setup. (#3226)
1 parent cefa503 commit d3dcc76

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/Mage.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@
4343
Varien_Autoload::register();
4444

4545
/** AUTOLOADER PATCH **/
46-
if (file_exists($autoloaderPath = (getenv('COMPOSER_VENDOR_PATH') ?: BP . DS . 'vendor') . DS . 'autoload.php')) {
47-
require $autoloaderPath;
46+
$autoloaderPath = getenv('COMPOSER_VENDOR_PATH');
47+
if (!$autoloaderPath) {
48+
$autoloaderPath = dirname(BP) . DS . 'vendor';
49+
if (!is_dir($autoloaderPath)) {
50+
$autoloaderPath = BP . DS . 'vendor';
51+
}
4852
}
53+
require $autoloaderPath . DS . 'autoload.php';
4954
/** AUTOLOADER PATCH **/
5055

5156
/* Support additional includes, such as composer's vendor/autoload.php files */

0 commit comments

Comments
 (0)