1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13: namespace Pry\Util;
14:
15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30:
31: class ExceptionHandler extends \Exception
32: {
33:
34: protected $image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFv0lEQVRYhc2WT2wU1x3Hv783783M7s7Oro1jY1uxLIQIyFaiCos/ElBRmUZqDm0jOEKknPIHRYJD4JADhxyqXjiEOjkiuHBqqwr1YNyiClSSmkYlLkSgWLYUvIkhNrs7453xzrz3y2HXwfhPDIuq9Cc9zWjfb9/v837vO7/3I2bGT2niJ43+/wAgn8X5+ssvq3h6ej+M+RWYBwB0NKe+A9FtCPFXt7//2r4vvkiedk16Gg1c7enJ6Wr1hGI+4RG1520bub4+KN8HlEIaBFj4+mtUgwAh83xCdNby/bMHS6WF5wYYy+eHLWMubCLqfmFwEO7Bg1Dbt4Pkk8ljZqRTU4jHxvDg888xZ8w3Wohjw0Ew1jLAmOcdzzCf7SkWZeGNN2APDGy0IQBAcvcuyufPozQ3l0ZEJ4bD8NwzA/zd845mmS909/Sg+O67EG1ta/ybGs811jDlMsojI/jm/n3UiI79IgwvPjXA1Xx+SBlzrae93S0ePw7L9xvO2WxjuG7jCJYBcJqC4xhcq4FrNQCArlZRPncOpfn5OBFi/8EguLky1qrPsHTmDJExH22yLNc7fBhQCpASVkcHrEIBQimQ1sDiIhDHjbG4CNIaQilYhQKsjg5ASkAp5A4fxiYpXTLmo9KZM7RhBv6Rz/82y/zHrqEh5F59FaqrC1Yms1b2NjQdRUhmZ7EwOorZ8XHUiF7/eRD8abnPqjpAxryZlRLO0BBUWxssAIiilgAsAGhrg7NrF7K3biFaXHwTwPoANzo7PQkMO1u2wO3qgqV1y8GXQ7gdHXC3bYOcmBi+0dnp7X3wIFwTwETRbhtwMwMDjYlaDY8mJsBKgQAQGqIhAET0+Lel96XjXHomCezBQUgAmZdegp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wAAAABJRU5ErkJggg%3D%3D';
35:
36: public function __construct($msg)
37: {
38: parent::__construct($msg);
39: }
40:
41: 42: 43: 44: 45:
46: public function getTime()
47: {
48: return date("d/m/Y H:i:s");
49: }
50:
51: 52: 53: 54: 55: 56:
57: public function getError($detail = false)
58: {
59: header('Content-Type: text/html; charset=utf-8');
60: $retour = '<div style="background:url(' . $this->image . ') 10px #FBE3E4 no-repeat; color: #8a1f11; border:1px solid #FBC2C4;">';
61: $retour.= $this->getTime() . ' : Une exception à été détectée :<br />';
62: $retour.= '<strong style="color:red">' . $this->getMessage() . '</strong><br />';
63: if ($detail)
64: {
65: $retour.= '<strong>Fichier : </strong> ' . $this->getFile() . '<br />';
66: $retour.= '<strong>Ligne : </strong>' . $this->getLine() . '<br />';
67: }
68: $retour.= '</div>';
69: return $retour;
70: }
71:
72: }
73:
74: ?>