phpCAS  version 1.4.0
GracefullTerminationException.php
Go to the documentation of this file.
1 <?php
2 
44 extends RuntimeException
45 implements CAS_Exception
46 {
47 
60  public function __construct ($message = 'Terminate Gracefully', $code = 0)
61  {
62  // Exit cleanly to avoid filling up the logs with uncaught exceptions.
63  if (self::$_exitWhenThrown) {
64  exit;
65  } else {
66  // Throw exceptions to allow unit testing to continue;
67  parent::__construct($message, $code);
68  }
69  }
70 
71  private static $_exitWhenThrown = true;
80  public static function throwInsteadOfExiting()
81  {
82  self::$_exitWhenThrown = false;
83  }
84 
85 }
86 ?>
__construct($message='Terminate Gracefully', $code=0)