ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
Initialization
+ Collaboration diagram for Initialization:

Functions

static phpCAS::client ( $server_version, $server_hostname, $server_port, $server_uri, $changeSessionID=true)
 phpCAS client initializer. More...
 
static phpCAS::proxy ( $server_version, $server_hostname, $server_port, $server_uri, $changeSessionID=true)
 phpCAS proxy initializer. More...
 
static phpCAS::isInitialized ()
 Answer whether or not the client or proxy has been initialized. More...
 

Detailed Description

Function Documentation

◆ client()

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

phpCAS client initializer.

Parameters
string$server_versionthe version of the CAS server
string$server_hostnamethe hostname of the CAS server
string$server_portthe port the CAS server is running on
string$server_urithe URI the CAS server is responding on
bool$changeSessionIDAllow phpCAS to change the session_id (Single Sign Out/handleLogoutRequests is based on that change)
Returns
a newly created CAS_Client object
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()).

Definition at line 345 of file CAS.php.

351 {
353 if (is_object(self::$_PHPCAS_CLIENT)) {
354 phpCAS :: error(self::$_PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . self::$_PHPCAS_INIT_CALL['file'] . ':' . self::$_PHPCAS_INIT_CALL['line'] . ')');
355 }
356
357 // store where the initializer is called from
358 $dbg = debug_backtrace();
359 self::$_PHPCAS_INIT_CALL = array(
360 'done' => true,
361 'file' => $dbg[0]['file'],
362 'line' => $dbg[0]['line'],
363 'method' => __CLASS__ . '::' . __FUNCTION__
364 );
365
366 // initialize the object $_PHPCAS_CLIENT
367 try {
368 self::$_PHPCAS_CLIENT = new CAS_Client(
369 $server_version,
370 false,
371 $server_hostname,
372 $server_port,
373 $server_uri,
374 $changeSessionID
375 );
376 } catch (Exception $e) {
377 phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
378 }
380 }
The CAS_Client class is a client interface that provides CAS authentication to PHP applications.
Definition: Client.php:52
static traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:658
static traceBegin()
This method is used to indicate the start of the execution of a function in debug mode.
Definition: CAS.php:611
static error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:563

References Vendor\Package\$e, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by ilAuthProviderCAS\doAuthentication().

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

◆ isInitialized()

static phpCAS::isInitialized ( )
static

Answer whether or not the client or proxy has been initialized.

Returns
bool

Definition at line 439 of file CAS.php.

440 {
441 return (is_object(self::$_PHPCAS_CLIENT));
442 }

◆ proxy()

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

phpCAS proxy initializer.

Parameters
string$server_versionthe version of the CAS server
string$server_hostnamethe hostname of the CAS server
string$server_portthe port the CAS server is running on
string$server_urithe URI the CAS server is responding on
bool$changeSessionIDAllow phpCAS to change the session_id (Single Sign Out/handleLogoutRequests is based on that change)
Returns
a newly created CAS_Client object
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()).

Definition at line 397 of file CAS.php.

403 {
405 if (is_object(self::$_PHPCAS_CLIENT)) {
406 phpCAS :: error(self::$_PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . self::$_PHPCAS_INIT_CALL['file'] . ':' . self::$_PHPCAS_INIT_CALL['line'] . ')');
407 }
408
409 // store where the initialzer is called from
410 $dbg = debug_backtrace();
411 self::$_PHPCAS_INIT_CALL = array(
412 'done' => true,
413 'file' => $dbg[0]['file'],
414 'line' => $dbg[0]['line'],
415 'method' => __CLASS__ . '::' . __FUNCTION__
416 );
417
418 // initialize the object $_PHPCAS_CLIENT
419 try {
420 self::$_PHPCAS_CLIENT = new CAS_Client(
421 $server_version,
422 true,
423 $server_hostname,
424 $server_port,
425 $server_uri,
426 $changeSessionID
427 );
428 } catch (Exception $e) {
429 phpCAS :: error(get_class($e) . ': ' . $e->getMessage());
430 }
432 }

References Vendor\Package\$e, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

+ Here is the call graph for this function: