本文整理汇总了PHP中OpenCloud\Rackspace::setSslVerification方法的典型用法代码示例。如果您正苦于以下问题:PHP Rackspace::setSslVerification方法的具体用法?PHP Rackspace::setSslVerification怎么用?PHP Rackspace::setSslVerification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenCloud\Rackspace
的用法示例。
在下文中一共展示了Rackspace::setSslVerification方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_service
public function get_service($opts, $useservercerts = false, $disablesslverify = null)
{
$user = $opts['user'];
$apikey = $opts['apikey'];
$authurl = $opts['authurl'];
$region = !empty($opts['region']) ? $opts['region'] : null;
require_once UPDRAFTPLUS_DIR . '/vendor/autoload.php';
global $updraftplus;
# The new authentication APIs don't match the values we were storing before
$new_authurl = 'https://lon.auth.api.rackspacecloud.com' == $authurl || 'uk' == $authurl ? Rackspace::UK_IDENTITY_ENDPOINT : Rackspace::US_IDENTITY_ENDPOINT;
if (null === $disablesslverify) {
$disablesslverify = UpdraftPlus_Options::get_updraft_option('updraft_ssl_disableverify');
}
if (empty($user) || empty($apikey)) {
throw new Exception(__('Authorisation failed (check your credentials)', 'updraftplus'));
}
$updraftplus->log("Cloud Files authentication URL: " . $new_authurl);
$client = new Rackspace($new_authurl, array('username' => $user, 'apiKey' => $apikey));
$this->client = $client;
if ($disablesslverify) {
$client->setSslVerification(false);
} else {
if ($useservercerts) {
$client->setConfig(array($client::SSL_CERT_AUTHORITY, 'system'));
} else {
$client->setSslVerification(UPDRAFTPLUS_DIR . '/includes/cacert.pem', true, 2);
}
}
return $client->objectStoreService('cloudFiles', $region);
}