ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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}
An exception for terminatinating execution or to throw for unit testing.
static throwInsteadOfExiting()
Force phpcas to thow Exceptions instead of calling exit() Needed for unit testing.
__construct($message='Terminate Gracefully', $code=0)
Test if exceptions should be thrown or if we should just exit.
A root exception interface for all exceptions in phpCAS.
Definition: Exception.php:56
exit
Definition: login.php:29
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$message
Definition: xapiexit.php:14