PHP Client for xczh/cas-proxy
xjtuana/cas-proxy-client-php
v1.0 compatible withxczh/cas-proxy
v1.1
- 通过Composer引入包(Packagist)
composer require xjtuana/cas-proxy-client ~1.0
- 示例代码
use Xjtuana\Cas\ProxyClient\ClientV1;
use Xjtuana\Cas\ProxyClient\CasProxyClientException;
$client = new ClientV1([
'protocol' => 'https',
'hostname' => 'ana.xjtu.edu.cn',
'prefix' => '/casproxy',
]);
try {
$user = $client->login();
} catch(CasProxyClientException $e) {
echo $e->getMessage();
}
echo $user;