ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ?>
$code
Definition: example_050.php:99
__construct($message='Terminate Gracefully', $code=0)
Test if exceptions should be thrown or if we should just exit.
static throwInsteadOfExiting()
Force phpcas to thow Exceptions instead of calling exit() Needed for unit testing.
A root exception interface for all exceptions in phpCAS.
Definition: Exception.php:55