Exemplo n.º 1
0
 public function init()
 {
     if (!$this->apiKey) {
         throw new CException('Api key cannot be empty');
     }
     $this->initAutoloader();
     parent::init();
 }
Exemplo n.º 2
0
 public function init()
 {
     if (!in_array($this->environment, array(self::ENVIRONMENT_SANDBOX, self::ENVIRONMENT_PRODUCTION))) {
         throw new CException('Environment is invalid.');
     }
     if (!$this->pemFile || !file_exists($this->pemFile)) {
         throw new CException('Push SSL certificate is required.');
     }
     $this->initAutoloader();
     require_once dirname(__FILE__) . '/YiiApnsLog.php';
     Yii::app()->attachEventHandler('onEndRequest', array($this, 'onApplicationEndRequest'));
     parent::init();
 }