Exemple #1
0
		$info = "PHP fatal error: ".Util::array2str(error_get_last());
		Logging::logError($info);
		if ($responseHandler == NULL) $responseHandler = new ResponseHandler(new OutputHandler());
		$responseHandler->unknownServerError($info);
		die();
	}
	register_shutdown_function("fatalErrorHandler");*/
require_once "configuration.php";
global $CONFIGURATION, $VERSION;
Logging::initialize($CONFIGURATION, $VERSION);
require_once "include/MollifyBackend.class.php";
require_once "include/Settings.class.php";
$responseHandler = new ResponseHandler(new OutputHandler(getSetting($CONFIGURATION, 'mime_types', array()), isSetting($CONFIGURATION, 'support_output_buffer')));
try {
    $settings = new Settings($CONFIGURATION);
    $backend = new MollifyBackend($settings, getDB($settings), $responseHandler);
    $backend->processRequest(new Request());
} catch (ServiceException $e) {
    Logging::logException($e);
    $responseHandler->error($e->type(), $e->details(), $e->data());
} catch (Exception $e) {
    Logging::logException($e);
    $responseHandler->unknownServerError($e->getMessage());
}
function getDB($settings)
{
    require_once "db/DBConnectionFactory.class.php";
    $f = new DBConnectionFactory();
    return $f->createConnection($settings);
}
function getSetting($settings, $name, $def)
Exemple #2
0
$info = "PHP fatal error: ".Util::array2str(error_get_last());
Logging::logError($info);
if ($responseHandler == NULL) $responseHandler = new ResponseHandler(new OutputHandler());
$responseHandler->unknownServerError($info);
die();
}
register_shutdown_function("fatalErrorHandler");*/
require_once "configuration.php";
global $CONFIGURATION, $VERSION;
Logging::initialize($CONFIGURATION, $VERSION);
require_once "include/MollifyBackend.class.php";
require_once "include/Settings.class.php";
$responseHandler = new ResponseHandler(new OutputHandler(getSetting($CONFIGURATION, 'mime_types', array()), isSetting($CONFIGURATION, 'support_output_buffer')));
try {
    $settings = new Settings($CONFIGURATION);
    $backend = new MollifyBackend($settings, getDB($settings), $responseHandler);
    $backend->processRequest(Request::get());
} catch (ServiceException $e) {
    Logging::logException($e);
    $responseHandler->error($e->type(), $e->details(), $e->data());
} catch (Exception $e) {
    Logging::logException($e);
    $responseHandler->unknownServerError($e->getMessage());
}
function getDB($settings)
{
    require_once "db/DBConnectionFactory.class.php";
    $f = new DBConnectionFactory();
    return $f->createConnection($settings);
}
function getSetting($settings, $name, $def)