本文整理汇总了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();
}