Exemple #1
0
if ($app->input->getCmd('view') == 'install' || !class_exists('KunenaForum') || !KunenaForum::isCompatible('4.0')) {
    // Run installer instead..
    require_once __DIR__ . '/install/controller.php';
    $controller = new KunenaControllerInstall();
    // TODO: execute special task that checks what's wrong
    $controller->execute($app->input->getCmd('task'));
    $controller->redirect();
    return;
}
if ($app->input->getCmd('view') == 'uninstall') {
    $allowed = $app->getUserState('com_kunena.uninstall.allowed');
    if ($allowed) {
        require_once __DIR__ . '/install/controller.php';
        $controller = new KunenaControllerInstall();
        $controller->execute('uninstall');
        $controller->redirect();
        $app->setUserState('com_kunena.uninstall.allowed', null);
        return;
    }
}
// Initialize Kunena Framework.
KunenaForum::setup();
// Initialize custom error handlers.
KunenaError::initialize();
// Kunena has been successfully installed: Load our main controller.
$controller = KunenaController::getInstance();
$controller->execute($app->input->getCmd('task'));
$controller->redirect();
// Remove custom error handlers.
KunenaError::cleanup();