Ejemplo n.º 1
0
 public function testLoad()
 {
     $this->_loader->addMap(array('TestMap' => 'TestMap.php', 'Unknown_Class' => 'invalid_file.php'));
     $this->assertFalse(class_exists('TestMap', false));
     $this->assertFalse(class_exists('Unknown_Class', false));
     $this->_loader->load('TestMap');
     $this->_loader->load('Unknown_Class');
     $this->assertTrue(class_exists('TestMap', false));
     $this->assertFalse(class_exists('Unknown_Class', false));
 }
Ejemplo n.º 2
0
            include_once BP . '/pub/errors/503.php';
        }
        exit;
    }
    if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
        Mage::setIsDeveloperMode(true);
    }
    if (!empty($_SERVER['MAGE_PROFILER'])) {
        $profilerConfigData = $_SERVER['MAGE_PROFILER'];
        $profilerConfig = array('baseDir' => dirname(__DIR__), 'tagFilters' => array());
        if (is_scalar($profilerConfigData)) {
            $profilerConfig['driver'] = array('output' => is_numeric($profilerConfigData) ? 'html' : $profilerConfigData);
        } elseif (is_array($profilerConfigData)) {
            $profilerConfig = array_merge($profilerConfig, $profilerConfigData);
        }
        Magento_Profiler::applyConfig($profilerConfig);
    }
}
require_once __DIR__ . '/autoload.php';
Magento_Autoload_IncludePath::addIncludePath(array(BP . DS . 'app' . DS . 'code' . DS . 'local', BP . DS . 'app' . DS . 'code' . DS . 'community', BP . DS . 'app' . DS . 'code' . DS . 'core', BP . DS . 'lib', BP . DS . 'var' . DS . 'generation'));
$classMapPath = BP . DS . 'var/classmap.ser';
if (file_exists($classMapPath)) {
    require_once BP . '/lib/Magento/Autoload/ClassMap.php';
    $classMap = new Magento_Autoload_ClassMap(BP);
    $classMap->addMap(unserialize(file_get_contents($classMapPath)));
    spl_autoload_register(array($classMap, 'load'));
}
$definitionsFile = BP . DS . 'var/di/definitions.php';
if (file_exists($definitionsFile)) {
    Mage::initializeObjectManager($definitionsFile);
}