<?php /** * @desc: 版权所有,翻版必究,未经同意不得用于商业项目 * @author: 樊亚磊 * @mail:fanyalei@aliyun.com * @QQ:451802973 */ ini_set('display_errors', 'Off'); include_once 'conf/config.php'; if (!file_exists(CONFIG_PATH . 'install.lock')) { include_once ACTION_PATH . 'Install.class.php'; $install = new Install(); echo $install->install(); }
<?php if (defined(BASE_URL) or defined(UPLOAD_DIR) or defined(SITE_TITLE) or defined(SITE_THEME) or defined(ADMIN_THEME) or defined(MYSQL_SERVERNAME) or defined(MYSQL_USERNAME) or empty(MYSQL_DB)) { $flash = new Flash(); $flash->flash('flash_message', 'Please fix your gw-config.php!', 'danger'); } else { if (mysqli_ping(db_connect())) { $install = new Install(); $install->install(); } else { $flash = new Flash(); $flash->flash('flash_message', 'Could not connect to database!', 'danger'); } }
require_once dirname(__FILE__) . '/../includes/install/ConfigInstallException.class.php'; require_once dirname(__FILE__) . '/../includes/install/DatabaseInstallException.class.php'; require_once dirname(__FILE__) . '/../includes/install/Install.class.php'; require_once dirname(__FILE__) . '/../includes/clearbricks/common/lib.l10n.php'; if (isset($_POST['validate_install'])) { // ActionState business. $logUsers = isset($_POST['logs_users_activate']) ? 'true' : 'false'; $useOpenID = isset($_POST['openid_mode']) ? 'true' : 'false'; $useServiceBrowser = isset($_POST['service_browser_activate']) ? 'true' : 'false'; $errorMessage = ''; try { $configFileIn = dirname(__FILE__) . '/../includes/config-sample.php'; $configFileOut = dirname(__FILE__) . '/../includes/config.php'; $params = array('database_login' => $_POST['database_login'], 'database_password' => $_POST['database_password'], 'database_name' => $_POST['database_name'], 'database_url' => $_POST['database_url'], 'theme_name' => $_POST['theme_name'], 'language' => $_POST['language'], 'openid_mode' => $useOpenID, 'application_name' => $_POST['application_name'], 'logs_users_activate' => $logUsers, 'logs_users_path' => $_POST['logs_users_path'], 'service_browser_activate' => $useServiceBrowser, 'service_browser_uri' => $_POST['service_browser_uri'], 'portal_uri' => $_POST['portal_uri']); $installer = new Install($configFileIn, $configFileOut, $params); $installer->install(); header('Location: success.php'); exit; } catch (DatabaseInstallException $dbEx) { $dbmsError = $dbEx->getDBMSMessage(); switch ($dbEx->getCode()) { case DatabaseInstallException::FAILED_TO_CONNECT: $errorMessage = __("Failed to connect to the Database Management System. Please verify the provided database configuration."); break; case DatabaseInstallException::FAILED_TO_CREATE_DB: $errorMessage = __("Failed to create database: {$dbmsError}. Is the chosen database name already used ?"); break; case DatabaseInstallException::FAILED_TO_CREATE_TABLE: $errorMessage = __("Failed to create a table in the database: {$dbmsError}."); break; case DatabaseInstallException::FAILED_TO_INSERT_DATA: