public static function register($prepend = true) { spl_autoload_register(array(__CLASS__, 'autoload'), true, (bool) $prepend); }
/** * Registers the BitPay autoloader to run before Magento's. This MUST be * called before using any bitpay classes. */ public function registerAutoloader() { if ($this->useAutoloader() && true === empty($this->_autoloaderRegistered)) { $autoloader_filename = \Mage::getBaseDir('lib') . '/Bitpay/Autoloader.php'; if (true === is_file($autoloader_filename) && true === is_readable($autoloader_filename)) { require_once $autoloader_filename; \Bitpay\Autoloader::register(); $this->_autoloaderRegistered = true; $this->debugData('[INFO] In Bitpay_Core_Helper_Data::registerAutoloader(): autoloader file was found and has been registered.'); } else { $this->_autoloaderRegistered = false; $this->debugData('[ERROR] In Bitpay_Core_Helper_Data::registerAutoloader(): autoloader file was not found or is not readable. Cannot continue!'); throw new \Exception('In Bitpay_Core_Helper_Data::registerAutoloader(): autoloader file was not found or is not readable. Cannot continue!'); } } }