修正由于GAE的MySQL连接参数变化导致的安装失败问题

This commit is contained in:
KimiChen
2014-04-24 18:22:56 +08:00
parent d9ee03df73
commit 10d23e0e5f
2 changed files with 19 additions and 8 deletions
+2 -2
View File
@@ -358,9 +358,8 @@ list($prefixVersion, $suffixVersion) = explode('/', $currentVersion);
/** 初始用户 */
$password = empty($config['userPassword']) ? substr(uniqid(), 7) : $config['userPassword'];
$hasher = new PasswordHash(8, true);
$installDb->query($installDb->insert('table.users')->rows(array('name' => $config['userName'], 'password' => $hasher->HashPassword($password), 'mail' => $config['userMail'],
$installDb->query($installDb->insert('table.users')->rows(array('name' => $config['userName'], 'password' => Typecho_Common::hash($password), 'mail' => $config['userMail'],
'url' => 'http://www.typecho.org', 'screenName' => $config['userName'], 'group' => 'administrator', 'created' => Typecho_Date::gmtTime())));
unset($_SESSION['typecho']);
@@ -472,6 +471,7 @@ list($prefixVersion, $suffixVersion) = explode('/', $currentVersion);
}
$config = str_replace($replace, array_values($dbConfig), _r('config'));
$dbConfig['dsn'] = str_replace($replace, array_values($dbConfig), $dbConfig['dsn']);
}
if (!isset($config) && $success && !_r('created')) {