Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
exceptions.php
Go to the documentation of this file.
1 <?php
2 
16 // notify some important people that a problem has occurred
17 // remember we can't rely on the database being available so everything here
18 // should be hard coded
19 $emails = array(
20  'admin@example.com',
21  'expert@example.com'
22 );
23 
24 $url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
25 $subject = "Exception: $url";
26 $message = $exception->getMessage();
27 
28 foreach ($emails as $email) {
29  mail($email, $subject, $message);
30 }
31 
32 
33 // output a custom error page to match the theme or give a custom message
34 $html = <<<HTML
35  <html>
36  <body>
37  Oops, a problem occurred. The authorities have been notified.
38  Sorry for the inconvenience.
39  </body>
40  </html>
41 HTML;
42 
43 // any output will prevent the default views from rendering allowing
44 // this script to control the entire page output
45 echo $html;
$message
Definition: exceptions.php:26
$subject
Definition: exceptions.php:25
body
Definition: admin.css.php:36
html
Definition: admin.css.php:36
$email
Definition: register.php:15
$url
Definition: exceptions.php:24
$exception
ui autocomplete a
Definition: forms.css.php:258
$emails
This is an optional script used to override Elgg's default handling of uncaught exceptions.
Definition: exceptions.php:19
foreach($emails as $email) $html
Definition: exceptions.php:34