public function GlExchangeAdapter::getPDConfig in GlobalLink Connect for Drupal 8.2
Same name and namespace in other branches
- 8 src/GlExchangeAdapter.php \Drupal\globallink\GlExchangeAdapter::getPDConfig()
Get the PDConfig object.
Parameters
array $settings: Array of settings. Defaults to plugin settings. See getDefaultSettings for info about the expected structure.
Return value
\PDConfig PDConfig object with settings.
File
- src/
GlExchangeAdapter.php, line 82
Class
- GlExchangeAdapter
- Provides an interface to the provided library.
Namespace
Drupal\globallinkCode
public function getPDConfig($settings) {
$settings += $this
->getDefaultSettings();
$pd_config = new \PDConfig();
$url = strrev($settings['pd_url']);
if (ord($url) == 47) {
$url = substr($url, 1);
}
$pd_config->url = strrev($url);
$pd_config->username = $settings['pd_username'];
$pd_config->password = $settings['pd_password'];
$pd_config->userAgent = $settings['pd_user_agent'];
return $pd_config;
}