public function TwitterAuth::initSdk in Open Social 8.3
Same name and namespace in other branches
- 8.9 modules/custom/social_auth_twitter/src/Plugin/Network/TwitterAuth.php \Drupal\social_auth_twitter\Plugin\Network\TwitterAuth::initSdk()
- 8 modules/custom/social_auth_twitter/src/Plugin/Network/TwitterAuth.php \Drupal\social_auth_twitter\Plugin\Network\TwitterAuth::initSdk()
- 8.2 modules/custom/social_auth_twitter/src/Plugin/Network/TwitterAuth.php \Drupal\social_auth_twitter\Plugin\Network\TwitterAuth::initSdk()
- 8.4 modules/custom/social_auth_twitter/src/Plugin/Network/TwitterAuth.php \Drupal\social_auth_twitter\Plugin\Network\TwitterAuth::initSdk()
- 8.5 modules/custom/social_auth_twitter/src/Plugin/Network/TwitterAuth.php \Drupal\social_auth_twitter\Plugin\Network\TwitterAuth::initSdk()
- 8.6 modules/custom/social_auth_twitter/src/Plugin/Network/TwitterAuth.php \Drupal\social_auth_twitter\Plugin\Network\TwitterAuth::initSdk()
- 8.7 modules/custom/social_auth_twitter/src/Plugin/Network/TwitterAuth.php \Drupal\social_auth_twitter\Plugin\Network\TwitterAuth::initSdk()
- 8.8 modules/custom/social_auth_twitter/src/Plugin/Network/TwitterAuth.php \Drupal\social_auth_twitter\Plugin\Network\TwitterAuth::initSdk()
File
- modules/
custom/ social_auth_twitter/ src/ Plugin/ Network/ TwitterAuth.php, line 58
Class
- TwitterAuth
- Defines Social Auth Twitter Network Plugin.
Namespace
Drupal\social_auth_twitter\Plugin\NetworkCode
public function initSdk() {
$class_name = '\\Abraham\\TwitterOAuth\\TwitterOAuth';
if (!class_exists($class_name)) {
throw new SocialApiException(sprintf('The PHP SDK for Twitter Client could not be found. Class: %s.', $class_name));
}
/* @var \Drupal\social_auth_twitter\Settings\TwitterAuthSettings $settings */
$settings = $this->settings;
if (!$this
->validateConfig($settings)) {
return FALSE;
}
// Creates a and sets data to TwitterOAuth object.
return new $class_name($settings
->getConsumerKey(), $settings
->getConsumerSecret());
}