Exemplo n.º 1
0
    $_REQUEST = stripslashes_array($_REQUEST);
    if (is_array($_FILES)) {
        // Don't strip valid slashes from tmp_name path on Windows
        foreach ($_FILES as $key => $value) {
            $_FILES[$key]['tmp_name'] = str_replace('\\', '\\\\', $value['tmp_name']);
        }
        $_FILES = stripslashes_array($_FILES);
    }
}
// If a cookie name is not specified in config.php, we use the default (pun_cookie)
if (empty($cookie_name)) {
    $cookie_name = 'pun_cookie';
}
// Load the cache module
require PUN_ROOT . 'modules/cache/src/Cache.php';
$cache = Flux_Cache::load($flux_config['cache']['type'], array('dir' => $flux_config['cache']['dir']), 'VarExport');
// TODO: Move this config into config.php
// Define a few commonly used constants
define('PUN_UNVERIFIED', 0);
define('PUN_ADMIN', 1);
define('PUN_MOD', 2);
define('PUN_GUEST', 3);
define('PUN_MEMBER', 4);
// Load the DB module
require PUN_ROOT . 'modules/database/src/Database/Adapter.php';
$db_options = array_merge($flux_config['db'], array('debug' => defined('PUN_DEBUG')));
$db = Flux_Database_Adapter::factory($flux_config['db']['type'], $db_options);
// Start a transaction
$db->startTransaction();
// Load cached config
$pun_config = $cache->get('config');
Exemplo n.º 2
0
@set_time_limit(0);
if (file_exists(PUN_ROOT . 'config.php')) {
    // Check to see whether FluxBB is already installed
    include PUN_ROOT . 'config.php';
    // If we have the 1.3-legacy constant defined, define the proper 1.4 constant so we don't get an incorrect "need to install" message
    if (defined('FORUM')) {
        define('PUN', FORUM);
    }
}
// If the cache directory is not specified, we use the default setting
if (!defined('FORUM_CACHE_DIR')) {
    define('FORUM_CACHE_DIR', PUN_ROOT . 'cache/');
}
// Load the cache module
require PUN_ROOT . 'modules/cache/src/Cache.php';
$cache = Flux_Cache::load('File', array('dir' => FORUM_CACHE_DIR), 'VarExport');
// TODO: Move this config into config.php
// TODO: according to the comment above - how do you want to move this to config when it doesn't exist? :)
// Load the language system
require PUN_ROOT . 'include/classes/lang.php';
$lang = new Flux_Lang();
// If we've been passed a default language, use it
$install_lang = isset($_REQUEST['install_lang']) ? trim($_REQUEST['install_lang']) : 'English';
$lang->setLanguage($install_lang);
// Load the install.php language file
$lang->load('install');
// If PUN is defined, config.php is probably valid and thus the software is installed
if (defined('PUN')) {
    exit($lang->t('Already installed'));
}
// Define PUN because email.php requires it