public function __construct($config) { $this->_config = $config; /*if(empty($this->_config->APIURL) || empty($this->_config->APIKey) || empty($this->_config->SecretKey)){ throw new exception('Invalid API URL or API key or Secret key, please check config.inc.php'); }*/ parent::__construct(); }
/** * construct function * * @author tom.wang<*****@*****.**> */ public function __construct() { global $config; parent::__construct(); $this->_config = $config; if (empty($this->_config->AUTHORIZEURL) || empty($this->_config->ACCESSTOKENURL) || empty($this->_config->SESSIONKEYURL) || empty($this->_config->CALLBACK)) { throw new exception('Invalid AUTHORIZEURL or ACCESSTOKENURL or SESSIONKEYURL or CALLBACK, please check config.inc.php'); } }
public function __construct() { parent::__construct(); $this->_config = new stdClass(); $this->_config->APIURL = 'http://api.xiaonei.com/restserver.do'; //RenRen网的API调用地址,不需要修改 $this->_config->APIVersion = '1.0'; //当前API的版本号,不需要修改 $this->_config->decodeFormat = 'json'; //默认的返回格式,根据实际情况修改,支持:json,xml /* *@ 以下接口内容来自http://wiki.dev.renren.com/wiki/API,编写时请遵守以下规则: * key (键名) : API方法名,直接Copy过来即可,请区分大小写 * value(键值) : 把所有的参数,包括required及optional,除了api_key,method,v,format不需要填写之外, * 其它的都可以根据你的实现情况来处理,以英文半角状态下的逗号来分割各个参数。 */ $this->_config->APIMapping = array('admin.getAllocation' => '', 'connect.getUnconnectedFriendsCount' => '', 'friends.areFriends' => 'uids1,uids2', 'friends.get' => 'page,count', 'friends.getFriends' => 'page,count', 'notifications.send' => 'to_ids,notification', 'users.getInfo' => 'uids,fields'); }