/** * load some required files */ function init() { parent::init(); $row = $this->member_get_oauth_type($this->type); if (!$row->id) { exit('access deny'); } $this->oauth_id = $row->id; $this->app_key = $row->key1; $this->app_secret = $row->key2; $this->url = host() . url('oauth/' . $this->type . '/return'); $files = array(base_path() . 'modules/oauth/libraries/alipay/alipay_core.function.php', base_path() . 'modules/oauth/libraries/alipay/alipay_md5.function.php', base_path() . 'modules/oauth/libraries/alipay/alipay_notify.class.php', base_path() . 'modules/oauth/libraries/alipay/alipay_submit.class.php'); Load::file($files); $alipay_config['partner'] = $this->app_key; //安全检验码,以数字和字母组成的32位字符 $alipay_config['key'] = $this->app_secret; $alipay_config['sign_type'] = strtoupper('MD5'); //字符编码格式 目前支持 gbk 或 utf-8 $alipay_config['input_charset'] = strtolower('utf-8'); //ca证书路径地址,用于curl中ssl校验 //请保证cacert.pem文件在当前文件夹目录中 $alipay_config['cacert'] = base_path() . 'modules/oauth/libraries/alipay/cacert.pem'; //访问模式,根据自己的服务器是否支持ssl访问,若支持请选择https;若不支持请选择http $alipay_config['transport'] = 'http'; $this->alipay_config = $alipay_config; }
/** * load some required files */ function init() { parent::init(); Load::file(base_path() . 'modules/oauth/libraries/sina/SaeTOAuthV2.php'); $row = $this->member_get_oauth_type($this->type); if (!$row->id) { exit('access deny'); } $this->oauth_id = $row->id; $this->app_key = $row->key1; $this->app_secret = $row->key2; $this->url = host() . url('oauth/' . $this->type . '/return'); session_start(); }
/** * load some required files */ function init() { parent::init(); $row = $this->member_get_oauth_type($this->type); if (!$row->id) { exit('access deny'); } $this->oauth_id = $row->id; $this->app_key = $row->key1; $this->app_secret = $row->key2; $this->url = host() . url('oauth/' . $this->type . '/return'); Load::file(base_path() . 'modules/oauth/libraries/twitter-async/EpiCurl.php'); Load::file(base_path() . 'modules/oauth/libraries/twitter-async/EpiOAuth.php'); Load::file(base_path() . 'modules/oauth/libraries/twitter-async/EpiTwitter.php'); $this->auth = new \EpiTwitter($this->app_key, $this->app_secret); }