本文整理匯總了PHP中phpCAS::isInitialized方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpCAS::isInitialized方法的具體用法?PHP phpCAS::isInitialized怎麽用?PHP phpCAS::isInitialized使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phpCAS
的用法示例。
在下文中一共展示了phpCAS::isInitialized方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initializeCASClient
protected function initializeCASClient()
{
if (!phpCAS::isInitialized()) {
// Set debug mode
phpCAS::setDebug(false);
//Initialize phpCAS
phpCAS::client(CAS_VERSION_2_0, Configure::read('user_config.cas.hostname'), Configure::read('user_config.cas.port'), Configure::read('user_config.cas.uri'), true);
phpCAS::setFixedServiceURL($this->loginRedirectURL());
// No SSL validation for the CAS server
phpCAS::setNoCasServerValidation();
}
return true;
}
示例2: setOptions
/**
* Set adapater state from options array
*
* @param array $options
* @return Zend_Auth_Adapter_Cas
*/
public function setOptions(array $options)
{
$forbidden = array('Options', 'Config');
foreach ($options as $key => $value) {
$normalized = ucfirst($key);
if (in_array($normalized, $forbidden)) {
continue;
}
$method = 'set' . $normalized;
if (method_exists($this, $method)) {
$this->{$method}($value);
}
}
if (empty($this->getApiKey())) {
throw new Exception("API Key not found");
}
if (empty($this->getSecret())) {
throw new Exception("API Secret not found");
}
if (!phpCAS::isInitialized()) {
phpCAS::client(CAS_VERSION_2_0, $this->getHostname(), $this->getPort(), $this->getPath());
phpCAS::setExtraCurlOption(CURLOPT_SSL_VERIFYHOST, false);
phpCAS::setExtraCurlOption(CURLOPT_SSL_VERIFYPEER, false);
}
// Set the URL
$url = $this->getUrl();
if (empty($url)) {
$this->setUrl();
}
// Set the service URL
$service = $this->getService();
if (empty($service)) {
$this->setService();
}
// Set the login URL
$loginUrl = $this->getLoginUrl();
if (empty($loginUrl)) {
$this->setLoginUrl();
}
// Set the logout URL
$logoutUrl = $this->getLogoutUrl();
if (empty($logoutUrl)) {
$this->setLogoutUrl();
}
$this->configureCasValidation($options);
return $this;
}
示例3: initialize
/**
* Initializes the PHP CAS client
*
* @return void
**/
private function initialize()
{
if (!phpCAS::isInitialized()) {
phpCAS::client(CAS_VERSION_2_0, 'www.purdue.edu', 443, '/apps/account/cas', false);
}
phpCAS::setNoCasServerValidation();
}