ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
Whoops\Util\Misc Class Reference
+ Collaboration diagram for Whoops\Util\Misc:

Static Public Member Functions

static canSendHeaders ()
 Can we at this point in time send HTTP headers? More...
 
static translateErrorCode ($error_code)
 Translate ErrorException code into the represented constant. More...
 

Detailed Description

Definition at line 9 of file Misc.php.

Member Function Documentation

◆ canSendHeaders()

static Whoops\Util\Misc::canSendHeaders ( )
static

Can we at this point in time send HTTP headers?

Currently this checks if we are even serving an HTTP request, as opposed to running from a command line.

If we are serving an HTTP request, we check if it's not too late.

Returns
bool

Definition at line 21 of file Misc.php.

References $_SERVER.

Referenced by Whoops\Handler\JsonResponseHandler\handle(), and Whoops\Handler\PlainTextHandler\handle().

22  {
23  return isset($_SERVER["REQUEST_URI"]) && !headers_sent();
24  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
+ Here is the caller graph for this function:

◆ translateErrorCode()

static Whoops\Util\Misc::translateErrorCode (   $error_code)
static

Translate ErrorException code into the represented constant.

Parameters
int$error_code
Returns
string
Examples:
/usr/local/src/ilias/release_5-1/Services/Exceptions/lib/Whoops/Handler/PrettyPageHandler.php.

Definition at line 32 of file Misc.php.

Referenced by Whoops\Handler\PrettyPageHandler\handle().

33  {
34  $constants = get_defined_constants(true);
35  if (array_key_exists('Core' , $constants)) {
36  foreach ($constants['Core'] as $constant => $value) {
37  if (substr($constant, 0, 2) == 'E_' && $value == $error_code) {
38  return $constant;
39  }
40  }
41  }
42  return "E_UNKNOWN";
43  }
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: