<?php

require '../config.php';
require_once "{$C->add_dir}/init.php";
$exceptions = array('e_developer', 'e_syntax', 'e_hack', 'e_spam', 'e_system');
$exception = (string) $_GET['exception'];
$email = (string) $_GET['email'];
if ($exception) {
    if ($_REQUEST['is_live']) {
        add::environment_status('live');
    }
    add::content_type($_REQUEST['content_type']);
    e_add::$email_addresses = $email;
    $e = new $exception("Test Error Message");
    #debug::var_dump($e->mail_body());
    throw $e;
}
?>
<form method="GET">
   <select name="exception">
      <option><?php 
echo implode("</option><option>", $exceptions);
?>
</option>
   </select>
   <label>Email<input type="text" name="email" /></label>
   <label><input name="is_live" type="checkbox" />Live</label>
   <label>
      Content Type<select name="content_type">
         <option>text/html</option>
         <option>text/plain</option>
add::load_functions('common');
# Just initialize the variables according to the environment status
add::environment_status(true);
/**
 * Set the exception emails
 *
 * @see http://code.google.com/p/add-mvc-framework/issues/detail?id=38
 *
 *
 */
if (isset($C->developer_emails)) {
    if (is_string($C->developer_emails)) {
        e_add::$email_addresses = $C->developer_emails;
    } else {
        if (is_object($C->developer_emails) || is_array($C->developer_emails)) {
            e_add::$email_addresses = implode(", ", (array) $C->developer_emails);
        }
    }
}
if (add::is_development() && !is_writeable($C->caches_dir)) {
    $C->caches_dir = sys_get_temp_dir() . '/add_mvc_caches_' . sha1($C->root_dir);
    if (!file_exists($C->caches_dir)) {
        umask(0);
        mkdir($C->caches_dir);
    } else {
        if (!is_dir($C->caches_dir)) {
            throw new e_system("Cache directory is not a directory", $C->caches_dir);
        }
    }
}
if (!is_writeable($C->caches_dir)) {