ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
GracefullTerminationException.php
Go to the documentation of this file.
1 <?php
2 
44 {
45 
58  public function __construct($message = 'Terminate Gracefully', $code = 0)
59  {
60  // Exit cleanly to avoid filling up the logs with uncaught exceptions.
61  if (self::$_exitWhenThrown) {
62  exit;
63  } else {
64  // Throw exceptions to allow unit testing to continue;
65  parent::__construct($message, $code);
66  }
67  }
68 
69  private static $_exitWhenThrown = true;
78  public static function throwInsteadOfExiting()
79  {
80  self::$_exitWhenThrown = false;
81  }
82 }
$code
Definition: example_050.php:99
__construct($message='Terminate Gracefully', $code=0)
Test if exceptions should be thrown or if we should just exit.
catch(Exception $e) $message
static throwInsteadOfExiting()
Force phpcas to thow Exceptions instead of calling exit() Needed for unit testing.
exit
Definition: backend.php:16
A root exception interface for all exceptions in phpCAS.
Definition: Exception.php:55