Esempio n. 1
0
/**
 * 生产Key
 */
function install_step999()
{
    if (empty($_COOKIE['nokey'])) {
        if (empty($_SESSION)) {
            session_start();
        }
        $connection = _create_connection();
        $serviceKernel = ServiceKernel::create('prod', true);
        $serviceKernel->setParameterBag(new ParameterBag(array('kernel' => array('root_dir' => realpath(__DIR__ . '/../../app')))));
        $serviceKernel->setConnection($connection);
        $init = new SystemInit();
        $key = $init->initKey();
        echo json_encode($key);
    } else {
        echo json_encode(array('accessKey' => '__NOKEY__', 'secretKey' => '__NOKEY__'));
    }
}
Esempio n. 2
0
function install_step3()
{
    check_installed();
    global $twig;
    $connection = _create_connection();
    $serviceKernel = ServiceKernel::create('prod', true);
    $serviceKernel->setConnection($connection);
    // $serviceKernel->setParameterBag($kernel->getContainer()->getParameterBag());
    $error = null;
    if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
        $init = new SystemInit();
        $admin = $init->initAdmin($_POST['admin']);
        $init->initSiteSettings($_POST);
        $init->initRegisterSetting($admin);
        $init->initMailerSetting($_POST['sitename']);
        $init->initPaymentSetting();
        $init->initStorageSetting();
        $init->initTag();
        $init->initCategory();
        $init->initFile();
        $init->initPages();
        $init->initNavigations();
        $init->initBlocks();
        $init->initThemes();
        $init->initLockFile();
        $init->initRefundSetting();
        $init->initArticleSetting();
        $web = $_POST['web'];
        $userData = array();
        $userData['server_addr'] = $_SERVER['SERVER_ADDR'];
        $userData['server_name'] = $_SERVER['SERVER_NAME'];
        $userData['mobile'] = $web['mobile'];
        $userData['qq'] = $web['qq'];
        $userData['name'] = $web['name'];
        _postRequest("http://open.edusoho.com/track/install", $userData);
        header("Location: start-install.php?step=4");
        exit;
    }
    echo $twig->render('step-3.html.twig', array('step' => 3, 'error' => $error, 'request' => $_POST));
}