ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
+ Collaboration diagram for Debugging:

Functions

 phpCAS::backtrace ()
 This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4.3.0 only) More...
 
 phpCAS::log ($str)
 Logs a string in debug mode. More...
 
 phpCAS::error ($msg)
 This method is used by interface methods to print an error and where the function was originally called from. More...
 
 phpCAS::trace ($str)
 This method is used to log something in debug mode. More...
 
 phpCAS::traceBegin ()
 This method is used to indicate the start of the execution of a function in debug mode. More...
 
 phpCAS::traceEnd ($res='')
 This method is used to indicate the end of the execution of a function in debug mode. More...
 
 phpCAS::traceExit ()
 This method is used to indicate the end of the execution of the program. More...
 

Detailed Description

Function Documentation

◆ backtrace()

phpCAS::backtrace ( )

This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4.3.0 only)

Definition at line 507 of file CAS.php.

Referenced by phpCAS\checkAuthentication(), phpCAS\client(), phpCAS\error(), phpCAS\forceAuthentication(), phpCAS\isAuthenticated(), phpCAS\proxy(), phpCAS\trace(), phpCAS\traceBegin(), and phpCAS\traceEnd().

507  {
508  if (function_exists('debug_backtrace')) {
509  return debug_backtrace();
510  } else {
511  // poor man's hack ... but it does work ...
512  return array ();
513  }
514  }
+ Here is the caller graph for this function:

◆ error()

phpCAS::error (   $msg)
private

This method is used by interface methods to print an error and where the function was originally called from.

Parameters
$msgthe message to print

Definition at line 544 of file CAS.php.

References $file, phpCAS\backtrace(), exit, phpCAS\trace(), and phpCAS\traceExit().

Referenced by phpCAS\authenticate(), CASClient\CASClient(), phpCAS\checkAuthentication(), phpCAS\client(), phpCAS\forceAuthentication(), CASClient\getAttributes(), phpCAS\getAttributes(), phpCAS\getServerLoginURL(), phpCAS\getServerLogoutURL(), phpCAS\getServiceURL(), PGTStorage\getStorageInfo(), PGTStorage\getStorageType(), CASClient\getUser(), phpCAS\getUser(), phpCAS\handleLogoutRequests(), CASClient\handleLogoutRequests(), PGTStorageDB\init(), phpCAS\isAuthenticated(), phpCAS\isSessionAuthenticated(), phpCAS\logout(), phpCAS\logoutWithRedirectService(), phpCAS\logoutWithRedirectServiceAndUrl(), phpCAS\logoutWithUrl(), PGTStorage\PGTStorage(), PGTStorageFile\PGTStorageFile(), phpCAS\proxy(), PGTStorage\read(), CASClient\readURL(), CASClient\renameSession(), phpCAS\retrievePT(), phpCAS\serviceMail(), phpCAS\serviceWeb(), phpCAS\setCacheTimesForAuthRecheck(), phpCAS\setCasServerCACert(), phpCAS\setCasServerCert(), phpCAS\setDebug(), phpCAS\setExtraCurlOption(), phpCAS\setFixedCallbackURL(), phpCAS\setFixedServiceURL(), phpCAS\setHTMLFooter(), phpCAS\setHTMLHeader(), phpCAS\setLang(), phpCAS\setNoCasServerValidation(), phpCAS\setPGTStorageDB(), CASClient\setPGTStorageDB(), phpCAS\setPGTStorageFile(), CASClient\setPGTStorageFile(), phpCAS\setServerLoginURL(), phpCAS\setServerLogoutURL(), phpCAS\setServerProxyValidateURL(), phpCAS\setServerSamlValidateURL(), phpCAS\setServerServiceValidateURL(), PGTStorage\write(), and PGTStorageFile\write().

544  {
545  $dbg = phpCAS :: backtrace();
546  $function = '?';
547  $file = '?';
548  $line = '?';
549  if (is_array($dbg)) {
550  for ($i = 1; $i < sizeof($dbg); $i++) {
551  if (is_array($dbg[$i])) {
552  if ($dbg[$i]['class'] == __CLASS__) {
553  $function = $dbg[$i]['function'];
554  $file = $dbg[$i]['file'];
555  $line = $dbg[$i]['line'];
556  }
557  }
558  }
559  }
560  echo "<br />\n<b>phpCAS error</b>: <font color=\"FF0000\"><b>" . __CLASS__ . "::" . $function . '(): ' . htmlentities($msg) . "</b></font> in <b>" . $file . "</b> on line <b>" . $line . "</b><br />\n";
561  phpCAS :: trace($msg);
563  exit ();
564  }
print $file
exit
Definition: login.php:54
backtrace()
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4...
Definition: CAS.php:507
trace($str)
This method is used to log something in debug mode.
Definition: CAS.php:569
traceExit()
This method is used to indicate the end of the execution of the program.
Definition: CAS.php:617
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ log()

phpCAS::log (   $str)
private

Logs a string in debug mode.

Parameters
$strthe string to write

Definition at line 523 of file CAS.php.

References $PHPCAS_DEBUG.

Referenced by CASClient\handleLogoutRequests(), CASClient\isAuthenticated(), CASClient\logout(), CASClient\redirectToCas(), phpCAS\trace(), phpCAS\traceBegin(), phpCAS\traceEnd(), phpCAS\traceExit(), and CASClient\validatePGT().

523  {
524  $indent_str = ".";
525  global $PHPCAS_DEBUG;
526 
527  if ($PHPCAS_DEBUG['filename']) {
528  for ($i = 0; $i < $PHPCAS_DEBUG['indent']; $i++) {
529  $indent_str .= '| ';
530  }
531  error_log($PHPCAS_DEBUG['unique_id'] . ' ' . $indent_str . $str . "\n", 3, $PHPCAS_DEBUG['filename']);
532  }
533 
534  }
$PHPCAS_DEBUG
This global variable is used to store phpCAS debug mode.
Definition: CAS.php:206
+ Here is the caller graph for this function:

◆ trace()

phpCAS::trace (   $str)

This method is used to log something in debug mode.

Definition at line 569 of file CAS.php.

References phpCAS\backtrace(), and phpCAS\log().

Referenced by CASClient\authError(), CASClient\callback(), CASClient\CASClient(), CASClient\checkAuthentication(), phpCAS\error(), CASClient\forceAuthentication(), phpCAS\forceAuthentication(), CASClient\getURL(), CASClient\isAuthenticated(), PGTStorageFile\read(), CASClient\readURL(), CASClient\renameSession(), CASClient\renewAuthentication(), CASClient\retrievePT(), CASClient\serviceWeb(), phpCAS\setDebug(), CASClient\setSessionAttributes(), CASClient\validatePGT(), CASClient\validatePT(), CASClient\validateSA(), CASClient\validateST(), and CASClient\wasPreviouslyAuthenticated().

569  {
570  $dbg = phpCAS :: backtrace();
571  phpCAS :: log($str . ' [' . basename($dbg[1]['file']) . ':' . $dbg[1]['line'] . ']');
572  }
backtrace()
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4...
Definition: CAS.php:507
log($str)
Logs a string in debug mode.
Definition: CAS.php:523
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ traceBegin()

phpCAS::traceBegin ( )

This method is used to indicate the start of the execution of a function in debug mode.

Definition at line 577 of file CAS.php.

References $PHPCAS_DEBUG, phpCAS\backtrace(), and phpCAS\log().

Referenced by CASClient\authError(), CASClient\buildSAMLPayload(), CASClient\callback(), CASClient\CASClient(), CASClient\checkAuthentication(), phpCAS\checkAuthentication(), phpCAS\client(), CASClient\forceAuthentication(), phpCAS\forceAuthentication(), PGTStorageFile\getPGTIouFilename(), CASClient\getServerLoginURL(), CASClient\getServerSamlValidateURL(), CASClient\handleLogoutRequests(), PGTStorageFile\init(), PGTStorageDB\init(), CASClient\isAuthenticated(), phpCAS\isAuthenticated(), CASClient\logout(), phpCAS\logout(), phpCAS\logoutWithRedirectService(), phpCAS\logoutWithRedirectServiceAndUrl(), phpCAS\logoutWithUrl(), PGTStorage\PGTStorage(), PGTStorageDB\PGTStorageDB(), PGTStorageFile\PGTStorageFile(), phpCAS\proxy(), PGTStorageFile\read(), CASClient\readURL(), CASClient\redirectToCas(), CASClient\renameSession(), CASClient\renewAuthentication(), CASClient\retrievePT(), phpCAS\serviceMail(), phpCAS\serviceWeb(), CASClient\serviceWeb(), phpCAS\setCasServerCACert(), phpCAS\setCasServerCert(), phpCAS\setExtraCurlOption(), phpCAS\setFixedCallbackURL(), phpCAS\setFixedServiceURL(), phpCAS\setNoCasServerValidation(), phpCAS\setPGTStorageDB(), phpCAS\setPGTStorageFile(), phpCAS\setServerLoginURL(), phpCAS\setServerLogoutURL(), phpCAS\setServerProxyValidateURL(), phpCAS\setServerSamlValidateURL(), phpCAS\setServerServiceValidateURL(), CASClient\setSessionAttributes(), CASClient\validatePGT(), CASClient\validatePT(), CASClient\validateSA(), CASClient\validateST(), CASClient\wasPreviouslyAuthenticated(), and PGTStorageFile\write().

577  {
578  global $PHPCAS_DEBUG;
579 
580  $dbg = phpCAS :: backtrace();
581  $str = '=> ';
582  if (!empty ($dbg[2]['class'])) {
583  $str .= $dbg[2]['class'] . '::';
584  }
585  $str .= $dbg[2]['function'] . '(';
586  if (is_array($dbg[2]['args'])) {
587  foreach ($dbg[2]['args'] as $index => $arg) {
588  if ($index != 0) {
589  $str .= ', ';
590  }
591  $str .= str_replace("\n", "", var_export($arg, TRUE));
592  }
593  }
594  $str .= ') [' . basename($dbg[2]['file']) . ':' . $dbg[2]['line'] . ']';
595  phpCAS :: log($str);
596  $PHPCAS_DEBUG['indent']++;
597  }
backtrace()
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4...
Definition: CAS.php:507
log($str)
Logs a string in debug mode.
Definition: CAS.php:523
$PHPCAS_DEBUG
This global variable is used to store phpCAS debug mode.
Definition: CAS.php:206
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ traceEnd()

phpCAS::traceEnd (   $res = '')

This method is used to indicate the end of the execution of a function in debug mode.

Parameters
$resthe result of the function

Definition at line 604 of file CAS.php.

References $PHPCAS_DEBUG, $res, phpCAS\backtrace(), and phpCAS\log().

Referenced by CASClient\buildSAMLPayload(), CASClient\CASClient(), CASClient\checkAuthentication(), phpCAS\checkAuthentication(), phpCAS\client(), CASClient\forceAuthentication(), PGTStorageFile\getPGTIouFilename(), CASClient\getServerLoginURL(), CASClient\getServerSamlValidateURL(), CASClient\getURL(), CASClient\handleLogoutRequests(), PGTStorageFile\init(), CASClient\isAuthenticated(), phpCAS\isAuthenticated(), phpCAS\logout(), phpCAS\logoutWithRedirectService(), phpCAS\logoutWithRedirectServiceAndUrl(), phpCAS\logoutWithUrl(), PGTStorage\PGTStorage(), PGTStorageDB\PGTStorageDB(), PGTStorageFile\PGTStorageFile(), phpCAS\proxy(), PGTStorageFile\read(), CASClient\readURL(), CASClient\renameSession(), CASClient\renewAuthentication(), CASClient\retrievePT(), phpCAS\serviceMail(), phpCAS\serviceWeb(), phpCAS\setCasServerCACert(), phpCAS\setCasServerCert(), phpCAS\setExtraCurlOption(), phpCAS\setFixedCallbackURL(), phpCAS\setFixedServiceURL(), phpCAS\setNoCasServerValidation(), phpCAS\setPGTStorageDB(), phpCAS\setPGTStorageFile(), phpCAS\setServerLoginURL(), phpCAS\setServerLogoutURL(), phpCAS\setServerProxyValidateURL(), phpCAS\setServerSamlValidateURL(), phpCAS\setServerServiceValidateURL(), CASClient\setSessionAttributes(), CASClient\validatePGT(), CASClient\validateSA(), CASClient\validateST(), CASClient\wasPreviouslyAuthenticated(), and PGTStorageFile\write().

604  {
605  global $PHPCAS_DEBUG;
606 
607  $PHPCAS_DEBUG['indent']--;
608  $dbg = phpCAS :: backtrace();
609  $str = '';
610  $str .= '<= ' . str_replace("\n", "", var_export($res, TRUE));
611  phpCAS :: log($str);
612  }
backtrace()
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4...
Definition: CAS.php:507
log($str)
Logs a string in debug mode.
Definition: CAS.php:523
$PHPCAS_DEBUG
This global variable is used to store phpCAS debug mode.
Definition: CAS.php:206
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ traceExit()

phpCAS::traceExit ( )

This method is used to indicate the end of the execution of the program.

Definition at line 617 of file CAS.php.

References $PHPCAS_DEBUG, and phpCAS\log().

Referenced by CASClient\authError(), CASClient\callback(), phpCAS\error(), CASClient\handleLogoutRequests(), CASClient\logout(), and CASClient\redirectToCas().

617  {
618  global $PHPCAS_DEBUG;
619 
620  phpCAS :: log('exit()');
621  while ($PHPCAS_DEBUG['indent'] > 0) {
622  phpCAS :: log('-');
623  $PHPCAS_DEBUG['indent']--;
624  }
625  }
log($str)
Logs a string in debug mode.
Definition: CAS.php:523
$PHPCAS_DEBUG
This global variable is used to store phpCAS debug mode.
Definition: CAS.php:206
+ Here is the call graph for this function:
+ Here is the caller graph for this function: