From cf002bb0c0b6f562f8e69a2cf51f6b19a52a374b Mon Sep 17 00:00:00 2001 From: joyqi Date: Fri, 3 Nov 2017 00:29:58 +0800 Subject: [PATCH] fix #643 --- install.php | 10 +++++++--- install/Mysql.php | 23 ++++++++++++++++++++--- install/Mysql.sql | 14 +++++++------- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/install.php b/install.php index 15acf230..e7ac7dfe 100644 --- a/install.php +++ b/install.php @@ -304,6 +304,10 @@ Typecho_Cookie::set('__typecho_lang', $lang); $scripts = str_replace('%charset%', $config['charset'], $scripts); } + if (isset($config['engine'])) { + $scripts = str_replace('%engine%', $config['engine'], $scripts); + } + $scripts = explode(';', $scripts); foreach ($scripts as $script) { $script = trim($script); @@ -496,12 +500,12 @@ Typecho_Cookie::set('__typecho_lang', $lang); } } - $_dbConfig = _rFrom('dbHost', 'dbUser', 'dbPassword', 'dbCharset', 'dbPort', 'dbDatabase', 'dbFile', 'dbDsn'); + $_dbConfig = _rFrom('dbHost', 'dbUser', 'dbPassword', 'dbCharset', 'dbPort', 'dbDatabase', 'dbFile', 'dbDsn', 'dbEngine'); $_dbConfig = array_filter($_dbConfig); $dbConfig = array(); foreach ($_dbConfig as $key => $val) { - $dbConfig[strtolower (substr($key, 2))] = $val; + $dbConfig[strtolower(substr($key, 2))] = $val; } // 在特殊服务器上的特殊安装过程处理 @@ -588,7 +592,7 @@ Typecho_Db::set(\$db); } // 安装不成功删除配置文件 - if($success != true && file_exists(__TYPECHO_ROOT_DIR__ . '/config.inc.php')) { + if(!$success && file_exists(__TYPECHO_ROOT_DIR__ . '/config.inc.php')) { @unlink(__TYPECHO_ROOT_DIR__ . '/config.inc.php'); } } diff --git a/install/Mysql.php b/install/Mysql.php index fec90dbd..3a82477e 100644 --- a/install/Mysql.php +++ b/install/Mysql.php @@ -22,7 +22,7 @@ if (defined('SAE_MYSQL_DB') && SAE_MYSQL_DB != "app_") { 'host' => SAE_MYSQL_HOST_M, 'user' => SAE_MYSQL_USER, 'password' => SAE_MYSQL_PASS, - 'charset' => '', + 'charset' => '{charset}', 'port' => SAE_MYSQL_PORT, 'database' => SAE_MYSQL_DB )" /> @@ -63,7 +63,7 @@ $baeDbPassword = "getenv('HTTP_BAE_ENV_SK')"; 'host' => getenv('HTTP_BAE_ENV_ADDR_SQL_IP'), 'user' => , 'password' => , - 'charset' => '', + 'charset' => '{charset}', 'port' => getenv('HTTP_BAE_ENV_ADDR_SQL_PORT'), 'database' => '{database}' )" /> @@ -102,7 +102,7 @@ $baeDbPassword = "getenv('HTTP_BAE_ENV_SK')"; - + +
  • + + +

    +
  • + +
  • + + +

    +
  • diff --git a/install/Mysql.sql b/install/Mysql.sql index d6dd0607..6fd457cf 100644 --- a/install/Mysql.sql +++ b/install/Mysql.sql @@ -35,7 +35,7 @@ CREATE TABLE `typecho_comments` ( PRIMARY KEY (`coid`), KEY `cid` (`cid`), KEY `created` (`created`) -) ENGINE=MyISAM DEFAULT CHARSET=%charset%; +) ENGINE=%engine% DEFAULT CHARSET=%charset%; -- -------------------------------------------------------- @@ -64,7 +64,7 @@ CREATE TABLE `typecho_contents` ( PRIMARY KEY (`cid`), UNIQUE KEY `slug` (`slug`), KEY `created` (`created`) -) ENGINE=MyISAM DEFAULT CHARSET=%charset%; +) ENGINE=%engine% DEFAULT CHARSET=%charset%; -- -------------------------------------------------------- @@ -82,7 +82,7 @@ CREATE TABLE `typecho_fields` ( PRIMARY KEY (`cid`,`name`), KEY `int_value` (`int_value`), KEY `float_value` (`float_value`) -) ENGINE=MyISAM DEFAULT CHARSET=%charset%; +) ENGINE=%engine% DEFAULT CHARSET=%charset%; -- -------------------------------------------------------- @@ -101,7 +101,7 @@ CREATE TABLE `typecho_metas` ( `parent` int(10) unsigned default '0', PRIMARY KEY (`mid`), KEY `slug` (`slug`) -) ENGINE=MyISAM DEFAULT CHARSET=%charset%; +) ENGINE=%engine% DEFAULT CHARSET=%charset%; -- -------------------------------------------------------- @@ -114,7 +114,7 @@ CREATE TABLE `typecho_options` ( `user` int(10) unsigned NOT NULL default '0', `value` text, PRIMARY KEY (`name`,`user`) -) ENGINE=MyISAM DEFAULT CHARSET=%charset%; +) ENGINE=%engine% DEFAULT CHARSET=%charset%; -- -------------------------------------------------------- @@ -126,7 +126,7 @@ CREATE TABLE `typecho_relationships` ( `cid` int(10) unsigned NOT NULL, `mid` int(10) unsigned NOT NULL, PRIMARY KEY (`cid`,`mid`) -) ENGINE=MyISAM DEFAULT CHARSET=%charset%; +) ENGINE=%engine% DEFAULT CHARSET=%charset%; -- -------------------------------------------------------- @@ -149,4 +149,4 @@ CREATE TABLE `typecho_users` ( PRIMARY KEY (`uid`), UNIQUE KEY `name` (`name`), UNIQUE KEY `mail` (`mail`) -) ENGINE=MyISAM DEFAULT CHARSET=%charset%; +) ENGINE=%engine% DEFAULT CHARSET=%charset%;