<?php
// Hostmonster hack.
if (isset($_SERVER['ORIG_PATH_INFO']))
{
    $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
}

if (get_magic_quotes_gpc()) {
    $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
    while (list($key, $val) = each($process)) {
        foreach ($val as $k => $v) {
            unset($process[$key][$k]);
            if (is_array($v)) {
                $process[$key][stripslashes($k)] = $v;
                $process[] = &$process[$key][stripslashes($k)];
            } else {
                $process[$key][stripslashes($k)] = stripslashes($v);
            }
        }
    }
    unset($process);
}
//

$_SERVER['PATH_INFO']=str_replace("/web.php","/", $_SERVER['PATH_INFO']);
$_SERVER['PATH_INFO']=str_replace("/admin.php","/", $_SERVER['PATH_INFO']);


require 'core/library/environment.php';
environment::load(E_ALL | E_STRICT, 'core/template/exception.php');

include 'core/library/fractal.php';
fractal::load(array('admin/', 'extend/', 'core/'), 'library/');

call_user_func_array('db::set', include 'dsn.php');

$request = new request(include 'admin/config/front.php');
$response = $request->execute($request->PATH_INFO);
$response->send();
