本文整理汇总了PHP中Google_Client::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Google_Client::__construct方法的具体用法?PHP Google_Client::__construct怎么用?PHP Google_Client::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Google_Client
的用法示例。
在下文中一共展示了Google_Client::__construct方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
// Set our settings
$this->setApplicationName("WordPress SEO Premium");
// Not sure if used
$this->setClientId('887668307827-4jhsr06rntrt3g3ss2r72dblf3ca7msv.apps.googleusercontent.com');
$this->setClientSecret('pPW5gLoTNtNHyiDH6YRn-CIB');
$this->setRedirectUri('urn:ietf:wg:oauth:2.0:oob');
$this->setScopes(array('https://www.google.com/webmasters/tools/feeds/'));
// Let's get an access token if we've got a refresh token
$refresh_token = $this->get_refresh_token();
if ('' != $refresh_token) {
// Refresh the token
$response = $this->refreshToken($refresh_token);
// Check response
if ('' != $response) {
$response = json_decode($response);
// Check if there is an access_token
if (isset($response->access_token)) {
// Set access_token
$this->setAccessToken($response->access_token);
}
}
}
}
示例2: __construct
public function __construct()
{
parent::__construct();
// Set our settings
$this->setApplicationName('WordPress SEO by Yoast Premium');
// Not sure if used
$this->setClientId('972827778625-rvd2mfvj3fnc97es9p57vqaap2lucm3h.apps.googleusercontent.com');
$this->setClientSecret('i32Z2SFYPdxNRALHf25uwMFW');
$this->setRedirectUri('urn:ietf:wg:oauth:2.0:oob');
$this->setScopes(array('https://www.google.com/webmasters/tools/feeds/'));
// Let's get an access token if we've got a refresh token
$refresh_token = $this->get_refresh_token();
if ('' != $refresh_token) {
try {
// Refresh the token
$response = $this->refreshToken($refresh_token);
// Check response
if ('' != $response) {
$response = json_decode($response);
// Check if there is an access_token
if (isset($response->access_token)) {
// Set access_token
$this->setAccessToken($response->access_token);
}
}
} catch (Exception $e) {
delete_option('wpseo-premium-gwt');
$this->save_refresh_token('');
}
}
}
示例3: __construct
public function __construct($config = null)
{
parent::__construct($config);
$this->_key = Config::get('ssoGoogleKey');
$this->_secret = Config::get('ssoGoogleSecret');
$this->setClientId($this->_key);
$this->setClientSecret($this->_secret);
}
示例4: __construct
public function __construct($config = null)
{
parent::__construct($config);
$this->_key = config('services.google.key');
$this->_secret = config('services.google.secret');
$this->setClientId($this->_key);
$this->setClientSecret($this->_secret);
}
示例5: __construct
public function __construct($config = array())
{
parent::__construct($config);
if (empty(\GO::config()->googledrive_oauth2_client_id) || empty(\GO::config()->googledrive_oauth2_client_secret) || empty(\GO::config()->googledrive_simple_api_key)) {
throw new \Exception("Google drive API client not setup. \$config['googledrive_oauth2_client_id'], \$config['googledrive_oauth2_client_secret'] and \$config['googledrive_simple_api_key'] must be set.");
}
$this->setApplicationName(\GO::config()->title);
$this->setUseObjects(true);
$this->setClientId(\GO::config()->googledrive_oauth2_client_id);
$this->setClientSecret(\GO::config()->googledrive_oauth2_client_secret);
// $this->setDeveloperKey(\GO::config()->googledrive_simple_api_key);
}
示例6: implode
/**
* Constructor for the class. We call the parent constructor, set
* scopes array and service calendar instance that we will use
*/
function __construct()
{
parent::__construct();
/**
* Google calendar service may have the options:
* Google_Service_Calendar::CALENDAR_READONLY
* if you want read only access
* or
* Google_Service_Calendar::CALENDAR
* if you want read/write access to the calendar
*/
$this->_scopes = implode(' ', array(\Google_Service_Calendar::CALENDAR));
$this->_google_service_calendar = new \Google_Service_Calendar($this);
}
示例7: __construct
/**
* Class constructor
*
* @param \Illuminate\Session\SessionManager $session
* @return void
*/
public function __construct()
{
parent::__construct();
$this->setApplicationName(Config::get('services.google_oauth.app_name'));
$this->setAccessType(Config::get('services.google_oauth.access_type'));
$this->setClientId(Config::get('services.google_oauth.client_id'));
$this->setClientSecret(Config::get('services.google_oauth.client_secret'));
// http://stackoverflow.com/questions/21020898/403-error-with-messageaccess-not-configured-please-use-google-developers-conso
// $this->setDeveloperKey(Config::get('google::api.api_key'));
$this->setScopes(Config::get('services.google_oauth.scope'));
$url = url(Config::get('services.google_oauth.redirect'));
$this->setRedirectUri($url);
if ($access_token = Session::get('google.access_token')) {
$this->setAccessToken($access_token);
}
}
示例8: __construct
/**
* Constructor.
*
* @param array $config
*/
public function __construct(array $config)
{
// $gc = new \Google_Config();
// $gc->setApplicationName($config['application_name']);
// $gc->setClientId($config['client_id']);
// $gc->setClientSecret($config['client_secret']);
// $gc->setRedirectUri($config['redirect_uri']);
// $gc->setDeveloperKey($config['developer_key']);
// parent::__construct($gc);
// $gc = new \Google_Config();
// $gc->setApplicationName('delta-compass-88413');
// $gc->setClientId('325619265545-s52p0vqjttcmcbp4p5s70q2mbi2si9dt.apps.googleusercontent.com');
// $gc->setClientSecret('F6P1m7Hj4q821Gu_hfQzjV-n');
// $gc->setRedirectUri($config['redirect_uri']);
// $gc->setDeveloperKey($config['developer_key']);
// parent::__construct($gc);
parent::__construct();
}
示例9: array
function __construct($params = array())
{
parent::__construct();
}
示例10: __construct
public function __construct()
{
parent::__construct();
}