public static function register($base = false) { /* deprecated since 2.19.0 if (defined('COMPILER_INCLUDE_PATH')) { $paths = array(); $paths[] = BP . DS . 'app' . DS . 'code' . DS . 'local'; $paths[] = BP . DS . 'app' . DS . 'code' . DS . 'community'; #$paths[] = BP . DS . 'app' . DS . 'code' . DS . 'core'; #$paths[] = BP . DS . 'lib'; $appPath = implode(PS, $paths); set_include_path($appPath . PS . get_include_path()); } */ $rewriter = new Aitoc_Aitsys_Model_Rewriter(); $rewriter->preRegisterAutoloader($base); // unregistering all, and varien autoloaders to make our performing first $autoloaders = spl_autoload_functions(); if ($autoloaders and is_array($autoloaders) && !empty($autoloaders)) { foreach ($autoloaders as $autoloader) { spl_autoload_unregister($autoloader); } } if (version_compare(Mage::getVersion(), '1.3.1', '>')) { spl_autoload_unregister(array(Varien_Autoload::instance(), 'autoload')); } spl_autoload_register(array(self::instance(), 'autoload'), false); if (version_compare(Mage::getVersion(), '1.3.1', '>')) { Varien_Autoload::register(); } else { spl_autoload_register(array(self::instance(), 'performStandardAutoload')); #self::_loadOverwrittenClasses(); } }
public static function register2($stopProcessing = false) { if (!$stopProcessing && !self::$_registered) { $rewriter = new Aitoc_Aitsys_Model_Rewriter(); $rewriter->preRegisterAutoloader(); // unregistering all autoloaders to make our performing first $autoloaders = spl_autoload_functions(); $firstAutoloader = $autoloaders[0]; // EXTENDWARE CHANGE if ($autoloaders && is_array($autoloaders) && !empty($autoloaders)) { foreach ($autoloaders as $autoloader) { spl_autoload_unregister($autoloader); } } // EXTENDWARE CHANGE if (is_callable($firstAutoloader)) { spl_autoload_register($firstAutoloader, false); } // register our autoloader spl_autoload_register(array(self::instance(), 'autoload'), false); // register 1.3.1 and older autoloader if (version_compare(Mage::getVersion(), '1.3.1', 'le')) { spl_autoload_register(array(self::instance(), 'performStandardAutoload'), true); } // register back all unregistered autoloaders if ($autoloaders && is_array($autoloaders) && !empty($autoloaders)) { foreach ($autoloaders as $autoloader) { spl_autoload_register($autoloader, is_array($autoloader) && $autoloader[0] instanceof Varien_Autoload); } } self::$_registered = true; } }
public static function register($stopProcessing = false) { if (Mage::getConfig()->getNode('default/aitsys/rewriter_status') != 1) { self::$_registered = true; return; } if (!$stopProcessing && !self::$_registered) { $rewriter = new Aitoc_Aitsys_Model_Rewriter(); $rewriter->preRegisterAutoloader(); // unregistering all autoloaders to make our performing first $autoloaders = spl_autoload_functions(); if ($autoloaders && is_array($autoloaders) && !empty($autoloaders)) { foreach ($autoloaders as $autoloader) { spl_autoload_unregister($autoloader); } } // register our autoloader spl_autoload_register(array(self::instance(), 'autoload'), false); // register 1.3.1 and older autoloader if (version_compare(Mage::getVersion(), '1.3.1', 'le')) { spl_autoload_register(array(self::instance(), 'performStandardAutoload'), true); } // register back all unregistered autoloaders if ($autoloaders && is_array($autoloaders) && !empty($autoloaders)) { foreach ($autoloaders as $autoloader) { spl_autoload_register($autoloader, is_array($autoloader) && $autoloader[0] instanceof Varien_Autoload); } } self::$_registered = true; } }
public function init($observer) { if (!Mage::registry('aitsys_autoload_initialized')) { Aitoc_Aitsys_Model_Rewriter_Autoload::register(); } elseif (Mage::registry('aitsys_autoload_initialized_base')) { $rewriter = new Aitoc_Aitsys_Model_Rewriter(); $rewriter->preRegisterAutoloader(); Mage::unregister('aitsys_autoload_initialized_base'); } }
public static function register($base = false) { Mage::register('aitsys_autoload_initialized', true); $rewriter = new Aitoc_Aitsys_Model_Rewriter(); $rewriter->preRegisterAutoloader($base); // unregistering all, and varien autoloaders to make our performing first $autoloaders = spl_autoload_functions(); if ($autoloaders and is_array($autoloaders) && !empty($autoloaders)) { foreach ($autoloaders as $autoloader) { spl_autoload_unregister($autoloader); } } if (version_compare(Mage::getVersion(), '1.3.1', '>')) { spl_autoload_unregister(array(Varien_Autoload::instance(), 'autoload')); } spl_autoload_register(array(self::instance(), 'autoload'), false); if (version_compare(Mage::getVersion(), '1.3.1', '>')) { Varien_Autoload::register(); } else { spl_autoload_register(array(self::instance(), 'performStandardAutoload')); } }