ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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;
66  }
67  }
68 
69  private static $_exitWhenThrown = true;
78  public static function throwInsteadOfExiting()
79  {
80  self::$_exitWhenThrown = false;
81  }
82 }
exit
Definition: login.php:29
__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.
__construct(Container $dic, ilPlugin $plugin)
$message
Definition: xapiexit.php:14
A root exception interface for all exceptions in phpCAS.
Definition: Exception.php:55