ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
Initialization
+ Collaboration diagram for Initialization:

Functions

 phpCAS::client ($server_version, $server_hostname, $server_port, $server_uri, $start_session=true)
 phpCAS client initializer. More...
 
 phpCAS::proxy ($server_version, $server_hostname, $server_port, $server_uri, $start_session=true)
 phpCAS proxy initializer. More...
 

Detailed Description

Function Documentation

◆ client()

phpCAS::client (   $server_version,
  $server_hostname,
  $server_port,
  $server_uri,
  $start_session = true 
)

phpCAS client initializer.

Note
Only one of the phpCAS::client() and phpCAS::proxy functions should be called, only once, and before all other methods (except phpCAS::getVersion() and phpCAS::setDebug()).
Parameters
$server_versionthe version of the CAS server
$server_hostnamethe hostname of the CAS server
$server_portthe port the CAS server is running on
$server_urithe URI the CAS server is responding on
$start_sessionHave phpCAS start PHP sessions (default true)
Returns
a newly created CASClient object

Definition at line 366 of file CAS.php.

366 {
368
370 if (is_object($PHPCAS_CLIENT)) {
371 phpCAS :: error($PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . $PHPCAS_INIT_CALL['file'] . ':' . $PHPCAS_INIT_CALL['line'] . ')');
372 }
373 if (gettype($server_version) != 'string') {
374 phpCAS :: error('type mismatched for parameter $server_version (should be `string\')');
375 }
376 if (gettype($server_hostname) != 'string') {
377 phpCAS :: error('type mismatched for parameter $server_hostname (should be `string\')');
378 }
379 if (gettype($server_port) != 'integer') {
380 phpCAS :: error('type mismatched for parameter $server_port (should be `integer\')');
381 }
382 if (gettype($server_uri) != 'string') {
383 phpCAS :: error('type mismatched for parameter $server_uri (should be `string\')');
384 }
385
386 // store where the initializer is called from
387 $dbg = phpCAS :: backtrace();
388 $PHPCAS_INIT_CALL = array (
389 'done' => TRUE,
390 'file' => $dbg[0]['file'],
391 'line' => $dbg[0]['line'],
392 'method' => __CLASS__ . '::' . __FUNCTION__
393 );
394
395 // initialize the global object $PHPCAS_CLIENT
396 $PHPCAS_CLIENT = new CASClient($server_version, FALSE /*proxy*/
397 , $server_hostname, $server_port, $server_uri, $start_session);
399 }
The CASClient class is a client interface that provides CAS authentication to PHP applications.
Definition: client.php:52
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
backtrace()
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4....
Definition: CAS.php:507
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode.
Definition: CAS.php:577
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_INIT_CALL
This global variable is used to store where the initializer is called from (to print a comprehensive ...
Definition: CAS.php:184
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176

References $PHPCAS_CLIENT, $PHPCAS_INIT_CALL, phpCAS\backtrace(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by ilCASAuth\ilCASAuth(), and ilAuthContainerCAS\initCAS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ proxy()

phpCAS::proxy (   $server_version,
  $server_hostname,
  $server_port,
  $server_uri,
  $start_session = true 
)

phpCAS proxy initializer.

Note
Only one of the phpCAS::client() and phpCAS::proxy functions should be called, only once, and before all other methods (except phpCAS::getVersion() and phpCAS::setDebug()).
Parameters
$server_versionthe version of the CAS server
$server_hostnamethe hostname of the CAS server
$server_portthe port the CAS server is running on
$server_urithe URI the CAS server is responding on
$start_sessionHave phpCAS start PHP sessions (default true)
Returns
a newly created CASClient object

Definition at line 415 of file CAS.php.

415 {
417
419 if (is_object($PHPCAS_CLIENT)) {
420 phpCAS :: error($PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . $PHPCAS_INIT_CALL['file'] . ':' . $PHPCAS_INIT_CALL['line'] . ')');
421 }
422 if (gettype($server_version) != 'string') {
423 phpCAS :: error('type mismatched for parameter $server_version (should be `string\')');
424 }
425 if (gettype($server_hostname) != 'string') {
426 phpCAS :: error('type mismatched for parameter $server_hostname (should be `string\')');
427 }
428 if (gettype($server_port) != 'integer') {
429 phpCAS :: error('type mismatched for parameter $server_port (should be `integer\')');
430 }
431 if (gettype($server_uri) != 'string') {
432 phpCAS :: error('type mismatched for parameter $server_uri (should be `string\')');
433 }
434
435 // store where the initialzer is called from
436 $dbg = phpCAS :: backtrace();
437 $PHPCAS_INIT_CALL = array (
438 'done' => TRUE,
439 'file' => $dbg[0]['file'],
440 'line' => $dbg[0]['line'],
441 'method' => __CLASS__ . '::' . __FUNCTION__
442 );
443
444 // initialize the global object $PHPCAS_CLIENT
445 $PHPCAS_CLIENT = new CASClient($server_version, TRUE /*proxy*/
446 , $server_hostname, $server_port, $server_uri, $start_session);
448 }

References $PHPCAS_CLIENT, $PHPCAS_INIT_CALL, phpCAS\backtrace(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

+ Here is the call graph for this function: