示例#1
0
 * @todo use the $_configuration array for all the needed variables
 * @todo remove the code that displays the button that links to the install page
 * 		but use a redirect immediately. By doing so the $alreadyInstalled variable can be removed.
 * @todo make it possible to enable / disable the tracking through the Chamilo config page.
 *
 */
// Showing/hiding error codes in global error messages.
define('SHOW_ERROR_CODES', false);
require_once __DIR__ . '/../../app/AppKernel.php';
$kernel = new AppKernel();
// Determine the directory path where this current file lies.
// This path will be useful to include the other initialisation files.
$includePath = __DIR__;
// Include the main Chamilo platform configuration file.
$alreadyInstalled = false;
if (file_exists($kernel->getConfigurationFile())) {
    require_once $kernel->getConfigurationFile();
    $alreadyInstalled = true;
} else {
    $_configuration = array();
}
//Redirects to the main/install/ page
if (!$alreadyInstalled) {
    $global_error_code = 2;
    // The system has not been installed yet.
    require $includePath . '/global_error_message.inc.php';
    die;
}
// Ensure that _configuration is in the global scope before loading
// main_api.lib.php. This is particularly helpful for unit tests
if (!isset($GLOBALS['_configuration'])) {