Beispiel #1
0
} else {
    define('MODX_SETUP_URL', '/');
}
/* session loop-back tester */
if (!$isCommandLine && (!isset($_GET['s']) || $_GET['s'] != 'set') && !isset($_SESSION['session_test'])) {
    $_SESSION['session_test'] = 1;
    echo "<html><head><title>Loading...</title><script>window.location.href='" . MODX_SETUP_URL . "?s=set';</script></head><body></body></html>";
    exit;
} elseif (!$isCommandLine && isset($_GET['s']) && $_GET['s'] == 'set' && !isset($_SESSION['session_test'])) {
    die('<html><head><title></title></head><body><h1>FATAL ERROR: MODX Setup cannot continue.</h1><p>Make sure your PHP session configuration is valid and working.</p></body></html>');
}
$setupPath = strtr(realpath(dirname(__FILE__)), '\\', '/') . '/';
define('MODX_SETUP_PATH', $setupPath);
$installPath = strtr(realpath(dirname(dirname(__FILE__))), '\\', '/') . '/';
define('MODX_INSTALL_PATH', $installPath);
if (!(include MODX_SETUP_PATH . 'includes/config.core.php')) {
    die('<html><head><title></title></head><body><h1>FATAL ERROR: MODX Setup cannot continue.</h1><p>Make sure you have uploaded all of the setup/ files; your setup/includes/config.core.php file is missing.</p></body></html>');
}
if (!(include MODX_SETUP_PATH . 'includes/modinstall.class.php')) {
    die('<html><head><title></title></head><body><h1>FATAL ERROR: MODX Setup cannot continue.</h1><p>Make sure you have uploaded all of the setup/ files; your setup/includes/modinstall.class.php file is missing.</p></body></html>');
}
$modInstall = new modInstall();
if ($modInstall->getService('lexicon', 'modInstallLexicon')) {
    $modInstall->lexicon->load('default');
}
$modInstall->findCore();
$modInstall->doPreloadChecks();
$requestClass = $isCommandLine ? 'request.modInstallCLIRequest' : 'request.modInstallRequest';
$modInstall->getService('request', $requestClass);
echo $modInstall->request->handle();
exit;