Exemple #1
0
require_once IEM_PATH . '/event.php';
// --------------------------------------------------------------------------------
// This is the legacy "init" file that needed to be refactored/deprecated gradually
// as it contains procedure that are obsolete or shouldn't be used anymore.
// TODO: deprecate
// --------------------------------------------------------------------------------
require_once IEM_PATH . '/init-legacy.php';
// --------------------------------------------------------------------------------
// Initialize framework and trigger any events that might be listening
// to the "SYSTEM_STARTUP" (before and after) event
// --------------------------------------------------------------------------------
$tempEvent = new EventData_IEM_SYSTEM_STARTUP_BEFORE();
$tempEvent->trigger();
unset($tempEvent);
// Initialize the framework
if (IEM::configGet() !== false) {
    IEM::init();
}
// Register a shutdown function
register_shutdown_function('__iem_shutdown_function');
$tempEvent = new EventData_IEM_SYSTEM_STARTUP_AFTER();
$tempEvent->trigger();
unset($tempEvent);
/*
 * Check to see if the applicatin is installed. If not, redirect it to the
 * installation screen.
 */
if (!IEM::isInstalled() && !IEM::isInstalling()) {
    header('Location: index.php?Page=install');
    exit;
}