From bc428f466acbc0829bcc21d6ba2c55a4544ff2d9 Mon Sep 17 00:00:00 2001 From: Jakub Turek Date: Sat, 13 Sep 2014 21:29:40 +0200 Subject: [PATCH] Use default autoloader when composer autoloader has been not initialized --- bin/mage | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/mage b/bin/mage index ea8f612..fcad36f 100755 --- a/bin/mage +++ b/bin/mage @@ -16,7 +16,14 @@ $baseDir = dirname(dirname(__FILE__)); define('MAGALLANES_VERSION', '1.0.1'); define('MAGALLANES_DIRECTORY', $baseDir); -require_once __DIR__ . '/../vendor/autoload.php'; +if (file_exists(__DIR__ . '/../vendor/autoload.php')) { + require_once __DIR__ . '/../vendor/autoload.php'; +} else { + require_once $baseDir . '/Mage/Autoload.php'; + $loader = new \Mage\Autoload(); + spl_autoload_register(array($loader, 'autoLoad')); +} + // Clean arguments array_shift($argv);