loadIni($path); $config->rootDir = $rootDir; } function prepareEnvironment($testEnvironment) { //prepare context global $context; global $startTime; $context = new StdClass; $context->startTime = $startTime; $config = getConfig(); TransferHelper::createDirectory($config->main->filesPath); TransferHelper::createDirectory($config->main->thumbsPath); //extension sanity checks $requiredExtensions = ['pdo', 'pdo_' . $config->main->dbDriver, 'gd', 'openssl', 'fileinfo']; foreach ($requiredExtensions as $ext) if (!extension_loaded($ext)) die('PHP extension "' . $ext . '" must be enabled to continue.' . PHP_EOL); if (\Chibi\Database::connected()) \Chibi\Database::disconnect(); Auth::setCurrentUser(null); Access::init(); Logger::init(); Mailer::init(); \Chibi\Database::connect( $config->main->dbDriver, TextHelper::absolutePath($config->main->dbLocation), isset($config->main->dbUser) ? $config->main->dbUser : null, isset($config->main->dbPass) ? $config->main->dbPass : null); } prepareConfig(false); prepareEnvironment(false);