本文整理汇总了PHP中LinkedIn::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP LinkedIn::__construct方法的具体用法?PHP LinkedIn::__construct怎么用?PHP LinkedIn::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinkedIn
的用法示例。
在下文中一共展示了LinkedIn::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->app = JFactory::getApplication();
$this->input = $this->app->input;
$this->config = EB::config();
$this->apiKey = $this->config->get('integrations_linkedin_api_key');
$this->apiSecret = $this->config->get('integrations_linkedin_secret_key');
// Default redirection url
$this->redirect = rtrim(JURI::root(), '/') . '/administrator/index.php?option=com_easyblog&task=linkedin.grant';
if ($this->input->get('system', false, 'bool')) {
$this->redirect .= '&system=1';
}
$options = array('appKey' => $this->apiKey, 'appSecret' => $this->apiSecret, 'callbackUrl' => $this->redirect);
parent::__construct($options);
}
示例2: __construct
public function __construct($key, $secret, $callback)
{
$config = array('appKey' => $key, 'appSecret' => $secret, 'callbackUrl' => $callback);
parent::__construct($config);
$this->callback = $callback;
}
示例3: __construct
public function __construct($key, $secret, $callback)
{
parent::__construct(array('appKey' => $key, 'appSecret' => $secret, 'callbackUrl' => $callback));
}
示例4: In_connect
/**
* 1. In_connect class constructor
* Checks if we have access or request tokens in session
*/
public function In_connect()
{
/* load configuration from /application/config/linkedin.php file */
$ci =& get_instance();
$ci->config->load('linkedin', true);
$config = $ci->config->item('linkedin');
$config['callbackUrl'] = site_url($config['callbackUrl']);
parent::__construct($config);
$this->in_config = $config;
$this->setResponseFormat(self::_RESPONSE_JSON);
/* Save CodeIgniter instance for future use */
$this->in_ci = $ci;
/* getting linkedin state from user session data */
$this->in_authorised = $ci->session->userdata('in_authorised');
if ($this->in_authorised) {
// get access token from session
$this->in_access_token = $ci->session->userdata('in_access_token');
if (isset($this->in_access_token['oauth_token']) && isset($this->in_access_token['oauth_token_secret'])) {
// we have access token - we set them for LinkedIn object
$this->setTokenAccess($this->in_access_token);
// retrieving user information from session in case we have it
$this->in_user = $ci->session->userdata('in_user');
} else {
// we do not have access token, it means we are not authorised...
$this->in_authorised = false;
$ci->session->set_userdata('in_authorised', false);
// ... and we clear access token whatever it was
$this->in_access_token = null;
$ci->session->unset_userdata('in_access_token');
}
} else {
// we are not authorised - set in into session, maybe it was empty
$ci->session->set_userdata('in_authorised', false);
// maybe we have request token? getting it from session
$this->in_request_token = $ci->session->userdata('in_request_token');
if (!(isset($this->in_request_token['oauth_token']) && isset($this->in_request_token['oauth_token_secret']))) {
// we do not have request token, we clear it whatever it was
$this->in_request_token = null;
$ci->session->unset_userdata('in_request_token');
}
}
}