|
|
@ -27,8 +27,15 @@ class Autoload |
|
|
|
$className = ltrim($className, '/'); |
|
|
|
$className = ltrim($className, '/'); |
|
|
|
$postfix = '/' . str_replace(array('_', '\\'), '/', $className . '.php'); |
|
|
|
$postfix = '/' . str_replace(array('_', '\\'), '/', $className . '.php'); |
|
|
|
|
|
|
|
|
|
|
|
//Try to load a normal Mage class (or Task). Think that Mage component is compiled to .phar |
|
|
|
// Change BaseDir according to Namespace |
|
|
|
|
|
|
|
if (strpos($className, 'Task\\') === 0) { |
|
|
|
|
|
|
|
$baseDir = getcwd() . '/.mage/tasks'; |
|
|
|
|
|
|
|
$postfix = substr($postfix, 5); |
|
|
|
|
|
|
|
} else { |
|
|
|
$baseDir = dirname(dirname(__FILE__)); |
|
|
|
$baseDir = dirname(dirname(__FILE__)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Try to load a normal Mage class (or Task). Think that Mage component is compiled to .phar |
|
|
|
$classFileWithinPhar = $baseDir . $postfix; |
|
|
|
$classFileWithinPhar = $baseDir . $postfix; |
|
|
|
if ($this->isReadable($classFileWithinPhar)) { |
|
|
|
if ($this->isReadable($classFileWithinPhar)) { |
|
|
|
/** @noinspection PhpIncludeInspection */ |
|
|
|
/** @noinspection PhpIncludeInspection */ |
|
|
|