示例#1
0
function com_install() {
	if (version_compare ( phpversion (), '5.0.0', '<' )) {
		echo "ERROR: PHP 5.2 REQUIRED!";
		return false;
	}

	if (version_compare(JVERSION, '1.6','>')) {
		echo "ERROR: WRONG MANIFEST FILE LOADED, PLEASE TRY AGAIN WITH THE LATEST VERSION OF JOOMLA!";
		return false;
	}

	// Emulate J1.6 installer
	include_once(dirname(__FILE__).'/install.script.php');
	Com_KunenaInstallerScript::preflight( null, null );
	Com_KunenaInstallerScript::install ( null );

	// Redirect to Kunena Installer
	header ( "HTTP/1.1 303 See Other" );
	header ( "Location: " . JURI::base () . 'index.php?option=com_kunena&view=install&task=prepare&'.JUtility::getToken().'=1' );
}
示例#2
0
function com_install()
{
    if (version_compare(phpversion(), '5.0.0', '<')) {
        echo "ERROR: PHP 5.2 REQUIRED!";
        return false;
    }
    // Joomla 1.7 compatibility (class already exists)
    if (!class_exists('JVersion')) {
        // Joomla 1.5 and 1.6 compatibility (jimport needed)
        jimport('joomla.version');
    }
    $jversion = new JVersion();
    if ($jversion->RELEASE != '1.5') {
        echo "ERROR: WRONG MANIFEST FILE LOADED, PLEASE TRY AGAIN WITH THE LATEST VERSION OF JOOMLA!";
        return false;
    }
    // Emulate J1.6 installer
    include_once dirname(__FILE__) . '/install.script.php';
    Com_KunenaInstallerScript::preflight(null, null);
    Com_KunenaInstallerScript::install(null);
    // Redirect to Kunena Installer
    header("HTTP/1.1 303 See Other");
    header("Location: " . JURI::base() . "index.php?option=com_kunena&view=install");
}
示例#3
0
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();
// Class structure should be used after this and all the common task should be moved to this class
require_once KUNENA_PATH . '/class.kunena.php';
require_once KUNENA_PATH_ADMIN . '/admin.kunena.html.php';