本文整理汇总了PHP中show_install函数的典型用法代码示例。如果您正苦于以下问题:PHP show_install函数的具体用法?PHP show_install怎么用?PHP show_install使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了show_install函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: substr
$authkey = substr(md5($_SERVER['SERVER_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . $dbhost . $dbuser . $dbpw . $dbname . $username . $password . $pconnect . substr($timestamp, 0, 6)), 8, 6) . random(10);
$_config['db'][1]['dbhost'] = $dbhost;
$_config['db'][1]['dbname'] = $dbname;
$_config['db'][1]['dbpw'] = $dbpw;
$_config['db'][1]['dbuser'] = $dbuser;
$_config['db'][1]['tablepre'] = $tablepre;
$_config['admincp']['founder'] = (string) $uid;
$_config['security']['authkey'] = $authkey;
$_config['cookie']['cookiepre'] = random(4) . '_';
$_config['memory']['prefix'] = random(6) . '_';
save_config_file(ROOT_PATH . CONFIG, $_config, $default_config);
$db = new dbstuff();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, DBCHARSET);
if (!VIEW_OFF) {
show_header();
show_install();
}
if (DZUCFULL) {
install_uc_server();
}
$sql = file_get_contents($sqlfile);
$sql = str_replace("\r\n", "\n", $sql);
runquery($sql);
runquery($extrasql);
$sql = file_get_contents(ROOT_PATH . './install/data/install_data.sql');
$sql = str_replace("\r\n", "\n", $sql);
runquery($sql);
$onlineip = $_SERVER['REMOTE_ADDR'];
$timestamp = time();
$backupdir = substr(md5($_SERVER['SERVER_ADDR'] . $_SERVER['HTTP_USER_AGENT'] . substr($timestamp, 0, 4)), 8, 6);
$ret = false;
示例2: db_init
function db_init()
{
global $sqlfile, $db, $multitable, $step, $lockfile;
if (!isset($_SESSION['dbinfo'])) {
header("location: index.php?step=2");
}
$dbname = $_SESSION['dbinfo']['dbname'];
$dbinfo = $_SESSION['dbinfo'];
$adminpwd = $_SESSION['adminpwd'];
$adminemail = $_SESSION['founderemail'];
$multitable = $_SESSION['multitable'];
$config = "<?php \r\ndefine('SSO_MODE', '{$_SESSION['sso_mode']}');\r\n";
$config .= "define('MULTI_TABLE', '{$_SESSION['multitable']}');\r\n";
$config .= '$GLOBALS ["gDataBase"] ["db"] = array (
"dbname" => "' . $dbname . '",
"type" => "mysql",
"host" => "' . $dbinfo['dbhost'] . '",
"port" => 3306,
"user" => "' . $dbinfo['dbuser'] . '",
"passwd" => "' . $dbinfo['dbpw'] . '",
"charset"=> "utf8",
);
?>';
$fp = fopen(CONFIG, 'w');
fwrite($fp, $config);
fclose($fp);
$db = new dbstuff();
$db->connect($dbinfo['dbhost'], $dbinfo['dbuser'], $dbinfo['dbpw'], $dbname, 'UTF8');
$sql = file_get_contents($sqlfile);
$sql = str_replace("\r\n", "\n", $sql);
if (!VIEW_OFF) {
show_install();
}
runquery($sql);
$user['user'] = $adminemail;
$user['user_email'] = $adminemail;
$user['user_question'] = '';
$user['user_answer'] = '';
$user['user_password'] = md5(md5($adminpwd) . $user['user']);
$user['user_nickname'] = 'administrator';
$user['user_sex'] = 1;
$user['user_reg_ip'] = '127.0.0.1';
createNewUser($user);
VIEW_OFF && show_msg('initdbresult_succ');
$step++;
if (!VIEW_OFF) {
echo '<script type="text/javascript">document.getElementById("laststep").disabled=false;document.getElementById("laststep").value = \'' . lang('install_succeed') . '\';</script>' . "\r\n";
}
}