예제 #1
0
$task = JRequest::getCmd('task');
require_once JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
require_once KUNENA_PATH_LIB . '/kunena.version.php';
kimport('error');
KunenaError::initialize();
$kunena_app =& JFactory::getApplication();
require_once KPATH_ADMIN . '/install/version.php';
$kn_version = new KunenaVersion();
if ($view == 'install') {
    require_once KPATH_ADMIN . '/install/controller.php';
    $controller = new KunenaControllerInstall();
    $controller->execute($task);
    $controller->redirect();
    return;
}
if (!$kn_version->checkVersion() && $task != 'schema' && $task != 'schemadiff') {
    require_once dirname(__FILE__) . '/install.script.php';
    Com_KunenaInstallerScript::preflight(null, null);
    Com_KunenaInstallerScript::install(null);
    while (@ob_end_clean()) {
    }
    $kunena_app->redirect(JURI::root() . 'administrator/index.php?option=com_kunena&view=install');
}
require_once KPATH_SITE . '/lib/kunena.defines.php';
$lang = JFactory::getLanguage();
$lang->load('com_kunena', JPATH_SITE);
jimport('joomla.utilities.arrayhelper');
// Now that we have the global defines we can use shortcut defines
require_once KUNENA_PATH_LIB . '/kunena.config.class.php';
$kunena_config = KunenaFactory::getConfig();
$kunena_db = JFactory::getDBO();
예제 #2
0
 * Kunena Component
 *
 * @package       Kunena.Installer
 *
 * @copyright (C) 2008 - 2015 Kunena Team. All rights reserved.
 * @license       http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link          http://www.kunena.org
 **/
defined('_JEXEC') or die;
/*
 ************************/
/*
  KUNENA FORUM INSTALLER */
$app = JFactory::getApplication();
$view = $app->input->getCmd('view');
$task = $app->input->getCmd('task');
// Special case for developer versions.
if ($view != 'install' && class_exists('KunenaForum') && KunenaForum::isDev()) {
    // Developer version found: Check if latest version of Kunena has been installed. If not, prepare installation.
    require_once __DIR__ . '/install/version.php';
    $kversion = new KunenaVersion();
    if (!$kversion->checkVersion()) {
        JFactory::getApplication()->redirect(JUri::base(true) . '/index.php?option=com_kunena&view=install');
    }
    return;
}
// Run the installer...
require_once __DIR__ . '/install/controller.php';
$controller = new KunenaControllerInstall();
$controller->execute($task);
$controller->redirect();
예제 #3
0
// Initialize Kunena (if Kunena System Plugin isn't enabled)
require_once JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';

// Initialize error handlers
KunenaError::initialize ();

// Get view and task
$view = JRequest::getCmd ( 'view', 'cpanel' );
$task = JRequest::getCmd ( 'task' );
JRequest::setVar( 'view', $view );

// Start by checking if Kunena has been installed -- if not, redirect to our installer
require_once(KPATH_ADMIN.'/install/version.php');
$kversion = new KunenaVersion();
if ($view != 'install' && !$kversion->checkVersion()) {
	$app = JFactory::getApplication ();
	$app->redirect(JURI::root(true).'/administrator/index.php?option=com_kunena&view=install&task=prepare&'.JUtility::getToken().'=1');

} elseif ($view == 'install') {
	// Load our installer (special case)
	require_once (KPATH_ADMIN . '/install/controller.php');
	$controller = new KunenaControllerInstall();

} else {
	// Kunena has been successfully installed: Load our main controller
	$controller = KunenaController::getInstance();
}
$controller->execute( $task );
$controller->redirect();