コード例 #1
0
 /**
  * Constructor
  * @param null
  */
 function __construct()
 {
     //set exception handler
     if (set_exception_handler(array(&$this, 'UncaughtExceptionHandler')) !== null) {
         restore_exception_handler();
     }
     //if there already was an exception handler, revert back to it
     parent::__construct();
     //now, add the api version to the button_js, in order to force users to download the latest
     //JS file
     if (!$this->isDebugMode()) {
         $this->SHAREYOURCART_BUTTON_JS .= '?v=' . $this->getConfigValue('api_version');
     } else {
         //for debug mode, use a different JS ( one that is not minified, and can be cached thus debugged
         $this->SHAREYOURCART_BUTTON_JS = $this->SHAREYOURCART_API . '/js/button.dev.js';
     }
     $this->SHAREYOURCART_BUTTON_URL .= '?client_id=' . $this->getClientId();
     //set the language & it's loader
     SyC::setLanguageLoader(array(&$this, 'loadLanguage'));
     SyC::setLanguage($this->getConfigValue('lang'));
 }