function __construct() { try { // register autoloader Jirafe_Autoloader::register(); $this->_jirafeApi = new Jirafe_Client(Mage::helper('foomanjirafe')->getStoreConfig('app_token'), new Fooman_Jirafe_Model_HttpConnection_Zend(self::JIRAFE_API_SERVER . '/v1')); } catch (Exception $e) { Mage::logException($e); Mage::helper('foomanjirafe')->setStoreConfig('last_status_message', $e->getMessage()); Mage::helper('foomanjirafe')->setStoreConfig('last_status', Fooman_Jirafe_Helper_Data::JIRAFE_STATUS_ERROR); } }
public function __construct() { // Require/Autoload the other files require_once _PS_MODULE_DIR_ . 'jirafe/vendor/jirafe-php-client/src/Jirafe/Autoloader.php'; Jirafe_Autoloader::register(); // for prestashop 1.4 if (function_exists('__autoload')) { spl_autoload_register('__autoload'); } $this->name = 'jirafe'; $this->tab = 'analytics_stats'; $this->version = '1.2.7'; //The constructor must be called after the name has been set, but before you try to use any functions like $this->l() parent::__construct(); $this->page = basename(__FILE__, '.php'); $this->author = 'PrestaShop'; $this->displayName = $this->l('Analytics for ecommerce'); $this->description = $this->l('The best analytics for ecommerce merchants. Deeply integrated into the Prestashop platform.'); // Confirmation of uninstall $this->confirmUninstall = $this->l('Are you sure you want to remove Jirafe analytics integration for your site?'); }
<?php require_once dirname(__FILE__) . '/src/Jirafe/Autoloader.php'; // register autoloader Jirafe_Autoloader::register();