phpCAS  version 1.4.0
Classes | Public Member Functions | Static Public Member Functions | Static Private Attributes | List of all members
CAS_GracefullTerminationException Class Reference
Inheritance diagram for CAS_GracefullTerminationException:
CAS_Exception

Classes

class  php
 

Public Member Functions

 __construct ($message='Terminate Gracefully', $code=0)
 

Static Public Member Functions

static throwInsteadOfExiting ()
 

Static Private Attributes

static $_exitWhenThrown = true
 

Detailed Description

Definition at line 43 of file GracefullTerminationException.php.

Constructor & Destructor Documentation

◆ __construct()

CAS_GracefullTerminationException::__construct (   $message = 'Terminate Gracefully',
  $code = 0 
)

Test if exceptions should be thrown or if we should just exit. In production usage we want to just exit cleanly when prompting the user for a redirect without filling the error logs with uncaught exceptions. In unit testing scenarios we cannot exit or we won't be able to continue with our tests.

Parameters
string$messageMessage Text
int$codeError code
Returns
self

Definition at line 60 of file GracefullTerminationException.php.

Member Function Documentation

◆ throwInsteadOfExiting()

static CAS_GracefullTerminationException::throwInsteadOfExiting ( )
static

Force phpcas to thow Exceptions instead of calling exit() Needed for unit testing. Generally shouldn't be used in production due to an increase in Apache error logging if CAS_GracefulTerminiationExceptions are not caught and handled.

Returns
void

Definition at line 80 of file GracefullTerminationException.php.

Member Data Documentation

◆ $_exitWhenThrown

CAS_GracefullTerminationException::$_exitWhenThrown = true
staticprivate

Definition at line 71 of file GracefullTerminationException.php.