/** * init Interface * * @param array emConf */ public function init($config) { // init Config Array $this->config = $config; // include Mage if (!class_exists('Mage', false)) { require_once $this->config['path'] . 'app/Mage.php'; } // disable Notices error_reporting(E_ALL & ~E_NOTICE); // overwrite Magento Autoload Funktion if (class_exists('Varien_Autoload', false)) { spl_autoload_unregister(array(Varien_Autoload::instance(), 'autoload')); } spl_autoload_register(array(&$this, 'autoload')); // Init Mage $store = tx_fbmagento_tools::getFELangStoreCode(); Mage::app()->setCurrentStore(Mage::app()->getStore($store)); restore_error_handler(); if ($GLOBALS['TSFE']->cObj instanceof tslib_cObj) { $cObj = $GLOBALS['TSFE']->cObj; $baseUrl = $cObj->getTypoLink_URL($GLOBALS['TSFE']->id); // get rid of trailing .html because of Real URL $pos = strrpos($baseUrl, '.'); $extension = substr($baseUrl, $pos); if (strpos($extension, '/') === false) { $baseUrl = substr($baseUrl, 0, $pos); } } // Init Typo3connect $params = array('enabled' => true); if ('' != $baseUrl) { $params['_typo3BaseUrl'] = t3lib_div::locationHeaderUrl($baseUrl); } $this->connector = Mage::getSingleton('Flagbit_Typo3connect/Core', $params); if (null !== $cObj) { $this->connector->setcObj($cObj); } }