1 | <?php |
||
2 | |||
3 | $Page = new HTMLPage(); |
||
4 | |||
5 | $Page->Html->setElementStyle('html'); |
||
6 | |||
7 | $Page->Html->setDTD('<!DOCTYPE html>'); |
||
8 | $Page->Html->setAttribute('lang', 'en'); |
||
9 | $Page->addElementToHead(new XMLElement('meta', null, array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8')), 0); |
||
10 | $Page->addStylesheetToHead(ASSETS_URL . '/css/symphony.min.css', 'screen', null, false); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
11 | |||
12 | $Page->setHttpStatus($e->getHttpStatusCode()); |
||
13 | $Page->addHeaderToPage('Content-Type', 'text/html; charset=UTF-8'); |
||
14 | $Page->addHeaderToPage('Symphony-Error-Type', 'database'); |
||
15 | |||
16 | if (isset($e->getAdditional()->header)) { |
||
17 | $Page->addHeaderToPage($e->getAdditional()->header); |
||
18 | } |
||
19 | |||
20 | $Page->setTitle(__('%1$s – %2$s', array(__('Symphony'), __('Database Error')))); |
||
21 | $Page->Body->setAttribute('id', 'error'); |
||
22 | |||
23 | $div = new XMLElement('div', null, array('class' => 'frame')); |
||
24 | $div->appendChild(new XMLElement('h1', __('Symphony Database Error'))); |
||
25 | $div->appendChild(new XMLElement('p', $e->getAdditional()->message)); |
||
26 | $div->appendChild(new XMLElement('p', '<code>'.$e->getAdditional()->error->getDatabaseErrorCode().': '.$e->getAdditional()->error->getDatabaseErrorMessage().'</code>')); |
||
27 | |||
28 | $query = $e->getAdditional()->error->getQuery(); |
||
29 | |||
30 | if (isset($query)) { |
||
31 | $div->appendChild(new XMLElement('p', '<code>'.$e->getAdditional()->error->getQuery().'</code>')); |
||
32 | } |
||
33 | |||
34 | $Page->Body->appendChild($div); |
||
35 | |||
36 | $output = $Page->generate(); |
||
37 | echo $output; |
||
38 | |||
39 | exit; |
||
40 |