Initial commit
This commit is contained in:
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,189 @@
|
||||
<?php
|
||||
function sp_testwrite($d) {
|
||||
$tfile = "_test.txt";
|
||||
$fp = @fopen($d . "/" . $tfile, "w");
|
||||
if (!$fp) {
|
||||
return false;
|
||||
}
|
||||
fclose($fp);
|
||||
$rs = @unlink($d . "/" . $tfile);
|
||||
if ($rs) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function sp_dir_create($path, $mode = 0777) {
|
||||
if (is_dir($path))
|
||||
return true;
|
||||
$ftp_enable = 0;
|
||||
$path = sp_dir_path($path);
|
||||
$temp = explode('/', $path);
|
||||
$cur_dir = '';
|
||||
$max = count($temp) - 1;
|
||||
for ($i = 0; $i < $max; $i++) {
|
||||
$cur_dir .= $temp[$i] . '/';
|
||||
if (@is_dir($cur_dir))
|
||||
continue;
|
||||
@mkdir($cur_dir, 0777, true);
|
||||
@chmod($cur_dir, 0777);
|
||||
}
|
||||
return is_dir($path);
|
||||
}
|
||||
|
||||
function sp_dir_path($path) {
|
||||
$path = str_replace('\\', '/', $path);
|
||||
if (substr($path, -1) != '/')
|
||||
$path = $path . '/';
|
||||
return $path;
|
||||
}
|
||||
|
||||
function sp_execute_sql($db,$file,$tablepre){
|
||||
//读取SQL文件
|
||||
$sql = file_get_contents(MODULE_PATH . 'Data/'.$file);
|
||||
$sql = str_replace("\r", "\n", $sql);
|
||||
//替换存储类型
|
||||
$result=$db->query("show variables like '%storage_engine%'");
|
||||
$engine=$result[0][value];
|
||||
$sql=preg_replace("/(?i)ENGINE=([a-zA-Z])+ /", "ENGINE=".$engine." ", $sql);
|
||||
//
|
||||
$sql = explode(";\n", $sql);
|
||||
|
||||
//替换表前缀
|
||||
$default_tablepre = "cms_";
|
||||
$sql = str_replace(" `{$default_tablepre}", " `{$tablepre}", $sql);
|
||||
|
||||
//开始安装
|
||||
sp_show_msg('开始安装数据库...');
|
||||
foreach ($sql as $item) {
|
||||
$item = trim($item);
|
||||
if(empty($item)) continue;
|
||||
preg_match('/CREATE TABLE `([^ ]*)`/', $item, $matches);
|
||||
if($matches) {
|
||||
$table_name = $matches[1];
|
||||
$msg = "创建数据表{$table_name}";
|
||||
if(false !== $db->execute($item)){
|
||||
sp_show_msg($msg . ' 完成');
|
||||
} else {
|
||||
sp_show_msg($msg . ' 失败!', 'error');
|
||||
}
|
||||
} else {
|
||||
$db->execute($item);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示提示信息
|
||||
* @param string $msg 提示信息
|
||||
*/
|
||||
function sp_show_msg($msg, $class = ''){
|
||||
echo "<script type=\"text/javascript\">showmsg(\"{$msg}\", \"{$class}\")</script>";
|
||||
flush();
|
||||
ob_flush();
|
||||
}
|
||||
|
||||
function sp_update_site_configs($db,$table_prefix){
|
||||
$data=array();
|
||||
$data["sitename"]=I("post.sitename");
|
||||
$data["pagetitle"]=I("post.sitename");
|
||||
$data["pagekey"]=I("post.sitekeywords");
|
||||
$data["pagedes"]=I("post.siteinfo");
|
||||
$data["domain"]=I("post.siteurl");
|
||||
$data["indexFileName"]="index.html";
|
||||
$data["indexType"]="dynamic";
|
||||
$settingstr="<?php \n return ".var_export($data,true).";";//配置文件str
|
||||
$setting_path=APP_PATH."Common/Conf/setting.php";//配置文件路径
|
||||
file_put_contents($setting_path,$settingstr);//保存到配置文件里
|
||||
sp_show_msg("网站信息配置成功!");
|
||||
}
|
||||
|
||||
function sp_create_admin_account($db,$table_prefix){
|
||||
$username=I("post.manager");
|
||||
$password=md6(I("post.manager_pwd"));
|
||||
$email=I("post.manager_email");
|
||||
$create_date=date("Y-m-d h:i:s");
|
||||
$ip=get_client_ip(0,true);
|
||||
//删除之前已存在的userid为1,或者用户名为admin的用户
|
||||
$db->execute("delete from `{$table_prefix}user` where user_id=1 or user_name='$username'");
|
||||
//
|
||||
$sql =<<<hello
|
||||
INSERT INTO `{$table_prefix}user`
|
||||
(user_id,user_name,user_password,is_admin,status) VALUES
|
||||
('1', '{$username}', '{$password}', '1', '1');;
|
||||
hello;
|
||||
$db->execute($sql);
|
||||
sp_show_msg("管理员账号创建成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 写入配置文件
|
||||
* @param array $config 配置信息
|
||||
*/
|
||||
function sp_create_config($config){
|
||||
if(is_array($config)){
|
||||
//读取配置内容
|
||||
$conf = file_get_contents(MODULE_PATH . 'Data/config.php');
|
||||
|
||||
//替换配置项
|
||||
foreach ($config as $key => $value) {
|
||||
$conf = str_replace("#{$key}#", $value, $conf);
|
||||
}
|
||||
$conf = str_replace('#COOKIE_PREFIX#', sp_random_string(6) . "_", $conf);
|
||||
|
||||
//写入应用配置文件
|
||||
if(file_put_contents( APP_PATH.'Common/Conf/db.php', $conf)){
|
||||
sp_show_msg('配置文件写入成功');
|
||||
} else {
|
||||
sp_show_msg('配置文件写入失败!', 'error');
|
||||
}
|
||||
return '';
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 返回带协议的域名
|
||||
*/
|
||||
function sp_get_host(){
|
||||
$host=$_SERVER["HTTP_HOST"];
|
||||
$protocol=is_ssl()?"https://":"http://";
|
||||
return $protocol.$host;
|
||||
}
|
||||
/**
|
||||
* 随机字符串生成
|
||||
* @param int $len 生成的字符串长度
|
||||
* @return string
|
||||
*/
|
||||
function sp_random_string($len = 6) {
|
||||
$chars = array(
|
||||
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
|
||||
"l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
|
||||
"w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G",
|
||||
"H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
|
||||
"S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2",
|
||||
"3", "4", "5", "6", "7", "8", "9"
|
||||
);
|
||||
$charsLen = count($chars) - 1;
|
||||
shuffle($chars); // 将数组打乱
|
||||
$output = "";
|
||||
for ($i = 0; $i < $len; $i++) {
|
||||
$output .= $chars[mt_rand(0, $charsLen)];
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* CMF密码加密方法
|
||||
* @param string $pw 要加密的字符串
|
||||
* @return string
|
||||
*/
|
||||
function sp_password($pw,$authcode=''){
|
||||
if(empty($authcode)){
|
||||
$authcode=C("AUTHCODE");
|
||||
}
|
||||
$result="###".md5(md5($authcode.$pw));
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'DEFAULT_THEME' => '',
|
||||
|
||||
);
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
<?php
|
||||
namespace Install\Controller;
|
||||
use Think\Controller;
|
||||
use Think\Db;
|
||||
/**
|
||||
* 首页
|
||||
*/
|
||||
class IndexController extends Controller {
|
||||
function _initialize(){
|
||||
if(file_exists_case(APP_PATH."Install/install.lock")){
|
||||
$this->error("网站已经安装过,如要重新安装,请删除Application/Install/install.lock",0,60);
|
||||
}
|
||||
}
|
||||
//首页
|
||||
public function index() {
|
||||
$this->display(":index");
|
||||
}
|
||||
|
||||
public function step2(){
|
||||
if(file_exists_case(APP_PATH.'Common/Conf/db.php')){
|
||||
@unlink(APP_PATH.'Common/Conf/db.php');
|
||||
}
|
||||
$data=array();
|
||||
$data['phpversion'] = @ phpversion();
|
||||
$data['os']=PHP_OS;
|
||||
$tmp = function_exists('gd_info') ? gd_info() : array();
|
||||
$server = $_SERVER["SERVER_SOFTWARE"];
|
||||
$host = (empty($_SERVER["SERVER_ADDR"]) ? $_SERVER["SERVER_HOST"] : $_SERVER["SERVER_ADDR"]);
|
||||
$name = $_SERVER["SERVER_NAME"];
|
||||
$max_execution_time = ini_get('max_execution_time');
|
||||
$allow_reference = (ini_get('allow_call_time_pass_reference') ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>');
|
||||
$allow_url_fopen = (ini_get('allow_url_fopen') ? '<font color=green>[√]On</font>' : '<font color=red>[×]Off</font>');
|
||||
$safe_mode = (ini_get('safe_mode') ? '<font color=red>[×]On</font>' : '<font color=green>[√]Off</font>');
|
||||
|
||||
$err = 0;
|
||||
if (empty($tmp['GD Version'])) {
|
||||
$gd = '<font color=red>[×]Off</font>';
|
||||
$err++;
|
||||
} else {
|
||||
$gd = '<font color=green>[√]On</font> ' . $tmp['GD Version'];
|
||||
}
|
||||
|
||||
if (class_exists('pdo')) {
|
||||
$data['pdo'] = '<i class="fa fa-check correct"></i> 已开启';
|
||||
} else {
|
||||
$data['pdo'] = '<i class="fa fa-remove error"></i> 未开启';
|
||||
$err++;
|
||||
}
|
||||
|
||||
if (extension_loaded('pdo_mysql')) {
|
||||
$data['pdo_mysql'] = '<i class="fa fa-check correct"></i> 已开启';
|
||||
} else {
|
||||
$data['pdo_mysql'] = '<i class="fa fa-remove error"></i> 未开启';
|
||||
$err++;
|
||||
}
|
||||
|
||||
if (extension_loaded('curl')) {
|
||||
$data['curl'] = '<i class="fa fa-check correct"></i> 已开启';
|
||||
} else {
|
||||
$data['curl'] = '<i class="fa fa-remove error"></i> 未开启';
|
||||
$err++;
|
||||
}
|
||||
|
||||
if (extension_loaded('gd')) {
|
||||
$data['gd'] = '<i class="fa fa-check correct"></i> 已开启';
|
||||
} else {
|
||||
$data['gd'] = '<i class="fa fa-remove error"></i> 未开启';
|
||||
if (function_exists('imagettftext')) {
|
||||
$data['gd'].='<br><i class="fa fa-remove error"></i> FreeType Support未开启';
|
||||
}
|
||||
$err++;
|
||||
}
|
||||
|
||||
if (extension_loaded('mbstring')) {
|
||||
$data['mbstring'] = '<i class="fa fa-check correct"></i> 已开启';
|
||||
} else {
|
||||
$data['mbstring'] = '<i class="fa fa-remove error"></i> 未开启';
|
||||
if (function_exists('imagettftext')) {
|
||||
$data['mbstring'].='<br><i class="fa fa-remove error"></i> FreeType Support未开启';
|
||||
}
|
||||
$err++;
|
||||
}
|
||||
|
||||
if (ini_get('file_uploads')) {
|
||||
$data['upload_size'] = '<i class="fa fa-check correct"></i> ' . ini_get('upload_max_filesize');
|
||||
} else {
|
||||
$data['upload_size'] = '<i class="fa fa-remove error"></i> 禁止上传';
|
||||
}
|
||||
|
||||
if (function_exists('session_start')) {
|
||||
$data['session'] = '<i class="fa fa-check correct"></i> 支持';
|
||||
} else {
|
||||
$data['session'] = '<i class="fa fa-remove error"></i> 不支持';
|
||||
$err++;
|
||||
}
|
||||
|
||||
$folders = array(
|
||||
APP_PATH,
|
||||
APP_PATH.'Common/conf',
|
||||
APP_PATH.'runtime',
|
||||
APP_PATH.'runtime/Cache',
|
||||
APP_PATH.'runtime/Data',
|
||||
APP_PATH.'runtime/Logs',
|
||||
APP_PATH.'runtime/Temp',
|
||||
'./d',
|
||||
);
|
||||
$new_folders=array();
|
||||
foreach($folders as $dir){
|
||||
$Testdir = $dir;
|
||||
sp_dir_create($Testdir);
|
||||
if(sp_testwrite($Testdir)){
|
||||
$new_folders[$dir]['w']=true;
|
||||
}else{
|
||||
$new_folders[$dir]['w']=false;
|
||||
$err++;
|
||||
}
|
||||
if(is_readable($Testdir)){
|
||||
$new_folders[$dir]['r']=true;
|
||||
}else{
|
||||
$new_folders[$dir]['r']=false;
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
$data['folders']=$new_folders;
|
||||
|
||||
$this->assign($data);
|
||||
$this->display(":step2");
|
||||
}
|
||||
|
||||
public function step3(){
|
||||
$this->display(":step3");
|
||||
}
|
||||
|
||||
public function step4(){
|
||||
if(IS_POST){
|
||||
//创建数据库
|
||||
$dbconfig['DB_TYPE']="mysql";
|
||||
$dbconfig['DB_HOST']=I('post.dbhost');
|
||||
$dbconfig['DB_USER']=I('post.dbuser');
|
||||
$dbconfig['DB_PWD']=I('post.dbpw');
|
||||
$dbconfig['DB_PORT']=I('post.dbport');
|
||||
$db = Db::getInstance($dbconfig);
|
||||
$dbname=strtolower(I('post.dbname'));
|
||||
$sql = "CREATE DATABASE IF NOT EXISTS `{$dbname}` DEFAULT CHARACTER SET utf8";
|
||||
$db->execute($sql) || $this->error($db->getError());
|
||||
|
||||
$this->display(":step4");
|
||||
|
||||
//创建数据表
|
||||
$dbconfig['DB_NAME']=$dbname;
|
||||
$dbconfig['DB_PREFIX']=trim(I('post.dbprefix'));
|
||||
$db = Db::getInstance($dbconfig);
|
||||
|
||||
$table_prefix=I("post.dbprefix");
|
||||
sp_execute_sql($db, "jijincms.sql", $table_prefix);
|
||||
|
||||
//更新配置信息
|
||||
sp_update_site_configs($db, $table_prefix);
|
||||
//创建管理员
|
||||
sp_create_admin_account($db, $table_prefix);
|
||||
//生成网站配置文件
|
||||
sp_create_config($dbconfig, $authcode);
|
||||
//更新缓存文件
|
||||
|
||||
//
|
||||
session("_install_step",4);
|
||||
sleep(1);
|
||||
$this->redirect("step5");
|
||||
}else{
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
public function step5(){
|
||||
if(session("_install_step")==4){
|
||||
@touch(APP_PATH.'Install/install.lock');
|
||||
$this->display(":step5");
|
||||
}else{
|
||||
$this->error("非法安装!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function testdbpwd(){
|
||||
if(IS_POST){
|
||||
$dbconfig=I("POST.");
|
||||
$dbconfig['DB_TYPE']="mysql";
|
||||
$db = Db::getInstance($dbconfig);
|
||||
try{
|
||||
$db->query("show databases;");
|
||||
}catch (\Exception $e){
|
||||
die("");
|
||||
}
|
||||
exit("1");
|
||||
}else{
|
||||
exit("need post!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 配置文件
|
||||
*/
|
||||
return array(
|
||||
'DB_TYPE' => 'mysql',
|
||||
'DB_HOST' => '#DB_HOST#',
|
||||
'DB_NAME' => '#DB_NAME#',
|
||||
'DB_USER' => '#DB_USER#',
|
||||
'DB_PWD' => '#DB_PWD#',
|
||||
'DB_PORT' => '#DB_PORT#',
|
||||
'DB_PREFIX' => '#DB_PREFIX#',
|
||||
//cookies
|
||||
"COOKIE_PREFIX" => '#COOKIE_PREFIX#',
|
||||
);
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return array(
|
||||
'ACCEPT' => 'ACCEPT'
|
||||
);
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
return array(
|
||||
'ACCEPT' => '接 受'
|
||||
);
|
||||
@@ -0,0 +1,3 @@
|
||||
<div class="footer">
|
||||
© 2018-{:date('Y')} <a href="http://www.jijinweb.com" target="_blank">Jijincms</a>上海集锦信息科技有限公司出品
|
||||
</div>
|
||||
@@ -0,0 +1,4 @@
|
||||
<meta charset="utf-8" />
|
||||
<title>Jijincms 安装向导</title>
|
||||
<link rel="stylesheet" href="__PUBLIC__/install/css/theme.min.css" />
|
||||
<link rel="stylesheet" href="__PUBLIC__/install/css/install.css" />
|
||||
@@ -0,0 +1,4 @@
|
||||
<div class="header">
|
||||
<h1 class="logo">Jijincms 安装向导</h1>
|
||||
<div class="version">{$Think.config.VERSION}</div>
|
||||
</div>
|
||||
@@ -0,0 +1,55 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<include file="Public:head" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<include file="Public:header" />
|
||||
<div class="section">
|
||||
<div class="main">
|
||||
<pre class="agreement">Jijincms软件使用协议
|
||||
|
||||
版权所有 ©2013-{:date("Y")},Jijincms开源社区
|
||||
|
||||
感谢您选择Jijincms内容管理框架, 希望我们的产品能够帮您把网站发展的更快、更好、更强!
|
||||
|
||||
Jijincms遵循Apache2开源协议发布,并提供免费使用。
|
||||
|
||||
Jijincms建站系统由上海集锦信息科技有限公司(以下简称集锦科技,官网http://www.jijinweb.com)发起并开源发布。
|
||||
|
||||
|
||||
Apache Licence是著名的非盈利开源组织Apache采用的协议。
|
||||
该协议鼓励代码共享和尊重原作者的著作权,允许代码修改,再作为开源或商业软件发布。需要满足的条件:
|
||||
1. 需要给代码的用户一份Apache Licence ;
|
||||
2. 如果你修改了代码,需要在被修改的文件中说明;
|
||||
3. 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议,商标,专利声明和其他原来作者规定需要包含的说明;
|
||||
4. 如果再发布的产品中包含一个Notice文件,则在Notice文件中需要带有本协议内容。你可以在Notice中增加自己的许可,但不可以表现为对Apache Licence构成更改。
|
||||
|
||||
具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Jijincms免责声明
|
||||
1、使用Jijincms构建的网站的任何信息内容以及导致的任何版权纠纷和法律争议及后果,Jijincms官方不承担任何责任。
|
||||
2、您一旦安装使用Jijincms,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的权力的同时,受到相关的约束和限制。</pre>
|
||||
</div>
|
||||
<div class="bottom text-center">
|
||||
<a href="{:U('Install/Index/step2')}" class="btn btn-primary">{:L('ACCEPT')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<include file="Public:footer" />
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,168 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<include file="Public:head" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<include file="Public:header" />
|
||||
<section class="section">
|
||||
<div class="step">
|
||||
<ul class="unstyled">
|
||||
<li class="current"><em>1</em>检测环境</li>
|
||||
<li><em>2</em>创建数据</li>
|
||||
<li><em>3</em>完成安装</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="server">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="td1">环境检测</td>
|
||||
<td class="td1" width="25%">推荐配置</td>
|
||||
<td class="td1" width="25%">当前状态</td>
|
||||
<td class="td1" width="25%">最低要求</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>操作系统</td>
|
||||
<td>类UNIX</td>
|
||||
<td><i class="fa fa-check correct"></i> {$os}</td>
|
||||
<td>不限制</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PHP版本</td>
|
||||
<td>>5.6.x</td>
|
||||
<td><i class="fa fa-check correct"></i> {$phpversion}</td>
|
||||
<td>5.3.0</td>
|
||||
</tr>
|
||||
<!-- 模块检测 -->
|
||||
<tr>
|
||||
<td class="td1" colspan="4">
|
||||
模块检测
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>session</td>
|
||||
<td>开启</td>
|
||||
<td>
|
||||
{$session}
|
||||
</td>
|
||||
<td>开启</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
PDO
|
||||
<a href="https://www.baidu.com/s?wd=开启PDO,PDO_MYSQL扩展" target="_blank">
|
||||
<i class="fa fa-question-circle question"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>开启</td>
|
||||
<td>
|
||||
{$pdo}
|
||||
</td>
|
||||
<td>开启</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
PDO_MySQL
|
||||
<a href="https://www.baidu.com/s?wd=开启PDO,PDO_MYSQL扩展" target="_blank">
|
||||
<i class="fa fa-question-circle question"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>开启</td>
|
||||
<td>
|
||||
{$pdo_mysql}
|
||||
</td>
|
||||
<td>开启</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
CURL
|
||||
<a href="https://www.baidu.com/s?wd=开启PHP CURL扩展" target="_blank">
|
||||
<i class="fa fa-question-circle question"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>开启</td>
|
||||
<td>
|
||||
{$curl}
|
||||
</td>
|
||||
<td>开启</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
GD
|
||||
<a href="https://www.baidu.com/s?wd=开启PHP GD扩展" target="_blank">
|
||||
<i class="fa fa-question-circle question"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>开启</td>
|
||||
<td>
|
||||
{$gd}
|
||||
</td>
|
||||
<td>开启</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
MBstring
|
||||
<a href="https://www.baidu.com/s?wd=开启PHP MBstring扩展" target="_blank">
|
||||
<i class="fa fa-question-circle question"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>开启</td>
|
||||
<td>
|
||||
{$mbstring}
|
||||
</td>
|
||||
<td>开启</td>
|
||||
</tr>
|
||||
<!-- 大小限制检测 -->
|
||||
<tr>
|
||||
<td class="td1" colspan="4">
|
||||
大小限制检测
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>附件上传</td>
|
||||
<td>>2M</td>
|
||||
<td>
|
||||
{$upload_size}
|
||||
</td>
|
||||
<td>不限制</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="td1">目录、文件权限检查</td>
|
||||
<td class="td1" width="25%">写入</td>
|
||||
<td class="td1" width="25%">读取</td>
|
||||
</tr>
|
||||
<foreach name="folders" item="vo" key="dir">
|
||||
<tr>
|
||||
<td>
|
||||
{$dir}
|
||||
</td>
|
||||
<td>
|
||||
<if condition="$vo['w']">
|
||||
<i class="fa fa-check correct"></i> 可写
|
||||
<else/>
|
||||
<i class="fa fa-remove error"></i> 不可写
|
||||
</if>
|
||||
</td>
|
||||
<td>
|
||||
<if condition="$vo['r']">
|
||||
<i class="fa fa-check correct"></i> 可读
|
||||
<else/>
|
||||
<i class="fa fa-remove error"></i> 不可读
|
||||
</if>
|
||||
</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
</table>
|
||||
</div>
|
||||
<div class="bottom text-center">
|
||||
<a href="{:U('Install/Index/step2')}" class="btn btn-primary">重新检测</a>
|
||||
<a href="{:U('Install/Index/step3')}" class="btn btn-primary">下一步</a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<include file="Public:footer" />
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,261 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<include file="Public:head" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<include file="Public:header" />
|
||||
<section class="section">
|
||||
<div class="step">
|
||||
<ul class="unstyled">
|
||||
<li class="on"><em>1</em>检测环境</li>
|
||||
<li class="current"><em>2</em>创建数据</li>
|
||||
<li><em>3</em>完成安装</li>
|
||||
</ul>
|
||||
</div>
|
||||
<form id="js-install-form" action="{:U('Install/Index/step4')}" method="post">
|
||||
<input type="hidden" name="force" value="0" />
|
||||
<div class="server">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="td1" width="100">数据库信息</td>
|
||||
<td class="td1" width="200"> </td>
|
||||
<td class="td1"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">数据库服务器:</td>
|
||||
<td><input type="text" name="dbhost" id="dbhost" value="localhost" class="input"></td>
|
||||
<td>
|
||||
<div id="js-install-tip-dbhost">
|
||||
<span class="gray">数据库服务器地址,一般为localhost</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">数据库端口:</td>
|
||||
<td><input type="text" name="dbport" id="dbport" value="3306" class="input"></td>
|
||||
<td>
|
||||
<div id="js-install-tip-dbport">
|
||||
<span class="gray">数据库服务器端口,一般为3306</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">数据库用户名:</td>
|
||||
<td><input type="text" name="dbuser" id="dbuser" value="root" class="input"></td>
|
||||
<td><div id="js-install-tip-dbuser"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">数据库密码:</td>
|
||||
<td><input type="password" name="dbpw" id="dbpw" value="" class="input" autoComplete="off" onblur="TestDbPwd()"></td>
|
||||
<td><div id="js-install-tip-dbpw"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">数据库名:</td>
|
||||
<td><input type="text" name="dbname" id="dbname" value="" class="input"></td>
|
||||
<td><div id="js-install-tip-dbname"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">数据库表前缀:</td>
|
||||
<td><input type="text" name="dbprefix" id="dbprefix" readonly value="db_" class="input"></td>
|
||||
<td>
|
||||
<div id="js-install-tip-dbprefix">
|
||||
<span class="gray">建议使用默认</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="td1" width="100">网站配置</td>
|
||||
<td class="td1" width="200"> </td>
|
||||
<td class="td1"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">网站名称:</td>
|
||||
<td><input type="text" name="sitename" value="{$Think.config.setting.sitename}" class="input"></td>
|
||||
<td><div id="js-install-tip-sitename"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">网站域名:</td>
|
||||
<td><input type="text" name="siteurl" value="{:sp_get_host()}/" class="input" autoComplete="off"></td>
|
||||
<td>
|
||||
<div id="js-install-tip-siteurl">
|
||||
<span class="gray">请以“/”结尾</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">关键词:</td>
|
||||
<td><input type="text" name="sitekeywords" value="{$Think.config.setting.pagekey}" class="input" autoComplete="off"></td>
|
||||
<td><div id="js-install-tip-sitekeywords"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">描述:</td>
|
||||
<td><textarea class="span4" name="siteinfo" style='height:50px;'>{$Think.config.setting.pagedes}</textarea></td>
|
||||
<td><div id="js-install-tip-siteinfo"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td class="td1" width="100">创始人信息</td>
|
||||
<td class="td1" width="200"> </td>
|
||||
<td class="td1"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">管理员帐号:</td>
|
||||
<td><input type="text" name="manager" value="admin" class="input"></td>
|
||||
<td><div id="js-install-tip-manager"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">密码:</td>
|
||||
<td><input type="password" name="manager_pwd" id="js-manager-pwd" value="" class="input" autoComplete="off"></td>
|
||||
<td><div id="js-install-tip-manager_pwd"></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-left">重复密码:</td>
|
||||
<td><input type="password" name="manager_ckpwd" class="input" value="" autoComplete="off"></td>
|
||||
<td><div id="js-install-tip-manager_ckpwd"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="js-response-tips" style="display: none;"></div>
|
||||
</div>
|
||||
<div class="bottom text-center">
|
||||
<a href="{:U('Install/Index/step2')}" class="btn btn-primary">上一步</a>
|
||||
<button type="submit" class="btn btn-primary">创建数据</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<script src="__PUBLIC__/install/js/jquery.js"></script>
|
||||
<script src="__PUBLIC__/install/js/validate.js"></script>
|
||||
<script src="__PUBLIC__/install/js/ajaxForm.js"></script>
|
||||
<script>
|
||||
function TestDbPwd() {
|
||||
var dbHost = $('#dbhost').val();
|
||||
var dbUser = $('#dbuser').val();
|
||||
var dbPwd = $('#dbpw').val();
|
||||
var dbName = $('#dbname').val();
|
||||
var dbPort = $('#dbport').val();
|
||||
data = {
|
||||
'DB_HOST' : dbHost,
|
||||
'DB_USER' : dbUser,
|
||||
'DB_PWD' : dbPwd,
|
||||
'DB_PORT' : dbPort
|
||||
};
|
||||
var url = "{:U('Install/Index/testdbpwd')}";
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : url,
|
||||
data : data,
|
||||
beforeSend : function() {
|
||||
},
|
||||
success : function(msg) {
|
||||
if (msg) {
|
||||
|
||||
} else {
|
||||
$('#dbpw').val("");
|
||||
$('#js-install-tip-dbpw').html('<span for="dbname" generated="true" class="tips-error" style="">数据库链接配置失败</span>');
|
||||
}
|
||||
},
|
||||
complete : function() {
|
||||
},
|
||||
error : function() {
|
||||
$('#js-install-tip-dbpw').html('<span for="dbname" generated="true" class="tips-error" style="">数据库链接配置失败</span>');
|
||||
$('#dbpw').val("");
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
//聚焦时默认提示
|
||||
var focus_tips = {
|
||||
dbhost : '数据库服务器地址,一般为localhost',
|
||||
dbport : '数据库服务器端口,一般为3306',
|
||||
dbuser : '',
|
||||
dbpw : '',
|
||||
dbname : '',
|
||||
dbprefix : '建议使用默认',
|
||||
manager : '创始人帐号,拥有站点后台所有管理权限',
|
||||
manager_pwd : '',
|
||||
manager_ckpwd : '',
|
||||
sitename : '',
|
||||
siteurl : '请以“/”结尾',
|
||||
sitekeywords : '',
|
||||
siteinfo : '',
|
||||
};
|
||||
|
||||
var install_form = $("#js-install-form");
|
||||
|
||||
//validate插件修改了remote ajax验证返回的response处理方式;增加密码强度提示 passwordRank
|
||||
install_form.validate({
|
||||
//debug : true,
|
||||
//onsubmit : false,
|
||||
errorPlacement : function(error, element) {
|
||||
//错误提示容器
|
||||
$('#js-install-tip-' + element[0].name).html(error);
|
||||
},
|
||||
errorElement : 'span',
|
||||
//invalidHandler : , 未验证通过 回调
|
||||
//ignore : '.ignore' 忽略验证
|
||||
//onkeyup : true,
|
||||
errorClass : 'tips-error',
|
||||
validClass : 'tips-error',
|
||||
onkeyup : false,
|
||||
focusInvalid : false,
|
||||
rules : {
|
||||
dbhost : {required : true},
|
||||
dbport : {required : true},
|
||||
dbuser : {required : true},
|
||||
dbpw: {required : true},
|
||||
dbname : {required : true},
|
||||
dbprefix : {required : true},
|
||||
manager : {required : true},
|
||||
manager_pwd : {required : true},
|
||||
manager_ckpwd : {required : true,equalTo : '#js-manager-pwd'},
|
||||
},
|
||||
highlight : false,
|
||||
unhighlight : function(element, errorClass,validClass) {
|
||||
var tip_elem = $('#js-install-tip-'+ element.name);
|
||||
tip_elem.html('<span class="'+ validClass +'" data-text="text"><span>');
|
||||
},
|
||||
onfocusin : function(element) {
|
||||
var name = element.name;
|
||||
$('#js-install-tip-' + name).html('<span data-text="text">'+ focus_tips[name] + '</span>');
|
||||
$(element).parents('tr').addClass('current');
|
||||
},
|
||||
onfocusout : function(element) {
|
||||
var _this = this;
|
||||
$(element).parents('tr').removeClass('current');
|
||||
|
||||
if (element.name === 'email') {
|
||||
//邮箱匹配点击后,延时处理
|
||||
setTimeout(function() {
|
||||
_this.element(element);
|
||||
}, 150);
|
||||
} else {
|
||||
_this.element(element);
|
||||
}
|
||||
|
||||
},
|
||||
messages : {
|
||||
dbhost : {required : '数据库服务器地址不能为空'},
|
||||
dbport : {required : '数据库服务器端口不能为空'},
|
||||
dbuser : {required : '数据库用户名不能为空'},
|
||||
dbpw : {required : '数据库密码不能为空'},
|
||||
dbname : {required : '数据库名不能为空'},
|
||||
dbprefix : {required : '数据库表前缀不能为空'},
|
||||
manager : {required : '管理员帐号不能为空'},
|
||||
manager_pwd : {required : '密码不能为空'},
|
||||
manager_ckpwd : {required : '重复密码不能为空',equalTo : '两次输入的密码不一致,请重新输入.'},
|
||||
},
|
||||
submitHandler : function(form) {
|
||||
form.submit();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<include file="Public:footer" />
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,38 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<include file="Public:head" />
|
||||
<script src="__PUBLIC__/install/js/jquery.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<include file="Public:header" />
|
||||
<section class="section">
|
||||
<div class="step">
|
||||
<ul class="unstyled">
|
||||
<li class="on"><em>1</em>检测环境</li>
|
||||
<li class="on"><em>2</em>创建数据</li>
|
||||
<li class="current"><em>3</em>完成安装</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="install" id="log">
|
||||
<ul id="loginner" class="unstyled"></ul>
|
||||
</div>
|
||||
<div class="bottom text-center">
|
||||
<a href="javascript:;"><i class="fa fa-refresh fa-spin"></i> 正在安装...</a>
|
||||
</div>
|
||||
</section>
|
||||
<script type="text/javascript">
|
||||
function showmsg(content,status){
|
||||
var icon='<i class="fa fa-check correct"></i> ';
|
||||
if(status=="error"){
|
||||
icon ='<i class="fa fa-remove error"></i> ';
|
||||
}
|
||||
$('#loginner').append("<li>"+icon+content+"</li>");
|
||||
$("#log").scrollTop(1000000000);
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<include file="Public:footer" />
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,29 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<include file="Public:head" />
|
||||
<script src="__PUBLIC__/js/jquery.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<include file="Public:header" />
|
||||
<section class="section">
|
||||
<div style="padding: 40px 20px;">
|
||||
<div class="text-center">
|
||||
<a style="font-size: 18px;">恭喜您,安装完成!</a>
|
||||
<br>
|
||||
<br>
|
||||
<div class="alert alert-danger" style="width: 350px;display: inline-block;">
|
||||
为了您站点的安全,安装完成后即可将网站application目录下的“Install”文件夹删除!
|
||||
</div>
|
||||
<br>
|
||||
<a class="btn btn-success" href="__ROOT__/" onClick="return confirm('安装成功后进入后台需要点击后台的更新->更新缓存')">进入前台</a>
|
||||
<a class="btn btn-success" href="__ROOT__/index.php/admin" onClick="return confirm('安装成功后进入后台需要点击后台的更新->更新缓存')">进入后台</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<include file="Public:footer" />
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user