ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPlainTextHandler Class Reference
+ Inheritance diagram for ilPlainTextHandler:
+ Collaboration diagram for ilPlainTextHandler:

Public Member Functions

 handle ()
 Last missing method from HandlerInterface. More...
 
- Public Member Functions inherited from Whoops\Handler\Handler
 setRun (Run $run)
 
 setInspector (Inspector $inspector)
 
 setException (Exception $exception)
 

Data Fields

const KEY_SPACE = 25
 
- Data Fields inherited from Whoops\Handler\Handler
const DONE = 0x10
 Return constants that can be returned from Handler::handle to message the handler walker. More...
 
const LAST_HANDLER = 0x20
 
const QUIT = 0x30
 

Protected Member Functions

 content ()
 Assemble the output for this handler. More...
 
 pageHeader ()
 Get the header for the page. More...
 
 exceptionContent ()
 Get a short info about the exception. More...
 
 tablesContent ()
 Get the header for the page. More...
 
 tables ()
 Get the tables that should be rendered. More...
 
- Protected Member Functions inherited from Whoops\Handler\Handler
 getRun ()
 
 getInspector ()
 
 getException ()
 

Detailed Description

Definition at line 20 of file class.ilPlainTextHandler.php.

Member Function Documentation

◆ content()

ilPlainTextHandler::content ( )
protected

Assemble the output for this handler.

Returns
string

Definition at line 39 of file class.ilPlainTextHandler.php.

References pageHeader().

Referenced by handle().

39  {
40  return $this->pageHeader()
41  .$this->exceptionContent()
42  .$this->tablesContent()
43  ;
44  }
pageHeader()
Get the header for the page.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exceptionContent()

ilPlainTextHandler::exceptionContent ( )
protected

Get a short info about the exception.

Returns
string

Definition at line 60 of file class.ilPlainTextHandler.php.

References Whoops\Handler\Handler\getInspector().

60  {
61  return Formatter::formatExceptionPlain($this->getInspector());
62  }
+ Here is the call graph for this function:

◆ handle()

ilPlainTextHandler::handle ( )

Last missing method from HandlerInterface.

Returns
null

Implements Whoops\Handler\HandlerInterface.

Definition at line 28 of file class.ilPlainTextHandler.php.

References content().

28  {
29  echo "<pre>\n";
30  echo $this->content();
31  echo "</pre>\n";
32  }
content()
Assemble the output for this handler.
+ Here is the call graph for this function:

◆ pageHeader()

ilPlainTextHandler::pageHeader ( )
protected

Get the header for the page.

Returns
string

Definition at line 51 of file class.ilPlainTextHandler.php.

Referenced by content().

51  {
52  return "";
53  }
+ Here is the caller graph for this function:

◆ tables()

ilPlainTextHandler::tables ( )
protected

Get the tables that should be rendered.

Returns
array $title => $table

Definition at line 104 of file class.ilPlainTextHandler.php.

References $_GET, $_POST, $_SERVER, and $_SESSION.

Referenced by tablesContent().

104  {
105  return array
106  ( "GET Data" => $_GET
107  , "POST Data" => $_POST
108  , "Files" => $_FILES
109  , "Cookies" => $_COOKIES
110  , "Session" => isset($_SESSION) ? $_SESSION : array()
111  , "Server/Request Data" => $_SERVER
112  , "Environment Variables" => $_ENV
113  );
114  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ tablesContent()

ilPlainTextHandler::tablesContent ( )
protected

Get the header for the page.

Returns
string

Definition at line 69 of file class.ilPlainTextHandler.php.

References $ret, and tables().

69  {
70  $ret = "";
71  foreach ($this->tables() as $title => $content) {
72  $ret .= "\n\n-- $title --\n\n";
73  if (count($content) > 0) {
74  foreach ($content as $key => $value) {
75  $key = str_pad($key, self::KEY_SPACE);
76 
77  // indent multiline values, first print_r, split in lines,
78  // indent all but first line, then implode again.
79  $first = true;
80  $indentation = str_pad("", self::KEY_SPACE);
81  $value = implode("\n", array_map(function($line) use (&$first, $indentation) {
82  if ($first) {
83  $first = false;
84  return $line;
85  }
86  return $indentation.$line;
87  }, explode("\n", print_r($value, true))));
88 
89  $ret .= "$key: $value\n";
90  }
91  }
92  else {
93  $ret .= "empty\n";
94  }
95  }
96  return $ret;
97  }
tables()
Get the tables that should be rendered.
+ Here is the call graph for this function:

Field Documentation

◆ KEY_SPACE

const ilPlainTextHandler::KEY_SPACE = 25

Definition at line 21 of file class.ilPlainTextHandler.php.


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