mirror of
https://github.com/typecho/typecho.git
synced 2025-03-20 01:49:40 +01:00
Merge branch 'master' of https://github.com/typecho/typecho-replica
This commit is contained in:
commit
623cd31d7c
25
install.php
25
install.php
@ -60,6 +60,19 @@ if (!isset($_GET['finish']) && file_exists(__TYPECHO_ROOT_DIR__ . '/config.inc.p
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测是否为应用引擎
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
function _engine()
|
||||
{
|
||||
return !empty($_SERVER['HTTP_APPNAME']) // SAE
|
||||
|| !!getenv('HTTP_BAE_ENV_APPID') // BAE
|
||||
|| (isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false); // GAE
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取传递参数
|
||||
*
|
||||
@ -328,7 +341,7 @@ list($prefixVersion, $suffixVersion) = explode('/', $currentVersion);
|
||||
'ip' => '127.0.0.1', 'agent' => $options->generator, 'text' => '欢迎加入 Typecho 大家族', 'type' => 'comment', 'status' => 'approved', 'parent' => 0)));
|
||||
|
||||
/** 初始用户 */
|
||||
$password = substr(uniqid(), 7);
|
||||
$password = empty($config['userPassword']) ? substr(uniqid(), 7) : $config['userPassword'];
|
||||
|
||||
$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())));
|
||||
@ -463,6 +476,7 @@ list($prefixVersion, $suffixVersion) = explode('/', $currentVersion);
|
||||
Typecho_Cookie::set('__typecho_config', base64_encode(serialize(array_merge(array(
|
||||
'prefix' => _r('dbPrefix'),
|
||||
'userName' => _r('userName'),
|
||||
'userPassword' => _r('userPassword'),
|
||||
'userMail' => _r('userMail'),
|
||||
'adapter' => $adapter,
|
||||
'siteUrl' => _r('userUrl')
|
||||
@ -482,7 +496,9 @@ list($prefixVersion, $suffixVersion) = explode('/', $currentVersion);
|
||||
Typecho_Db::set(\$db);
|
||||
";
|
||||
$contents = implode('', $lines);
|
||||
@file_put_contents('./config.inc.php', $contents);
|
||||
if (!_engine()) {
|
||||
@file_put_contents('./config.inc.php', $contents);
|
||||
}
|
||||
|
||||
// 创建一个用于标识的临时文件
|
||||
$_SESSION['typecho'] = 1;
|
||||
@ -546,6 +562,11 @@ Typecho_Db::set(\$db);
|
||||
<p class="description"><?php _e('请填写您的用户名'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label" for="userPassword"><?php _e('登录密码'); ?></label>
|
||||
<input type="password" name="userPassword" id="userPassword" class="text" value="<?php _v('userPassword'); ?>" />
|
||||
<p class="description"><?php _e('请填写您的登录密码, 如果留空系统将为您随机生成一个'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<label class="typecho-label" for="userMail"><?php _e('邮件地址'); ?></label>
|
||||
<input type="text" name="userMail" id="userMail" class="text" value="<?php _v('userMail', 'webmaster@yourdomain.com'); ?>" />
|
||||
<p class="description"><?php _e('请填写一个您的常用邮箱'); ?></p>
|
||||
|
@ -21,8 +21,8 @@
|
||||
<h3 class="warning"><?php _e('系统将为您自动匹配 %s 环境的安装选项', 'BAE'); ?></h3>
|
||||
<li>
|
||||
<label class="typecho-label" for="dbDatabase"><?php _e('数据库名'); ?></label>
|
||||
<input type="text" class="text" id="dbDatabase" name="dbDatabase" value="<?php _v('dbDatabase', 'typecho'); ?>" />
|
||||
<p class="description"><?php _e('请您指定数据库名称'); ?></p>
|
||||
<input type="text" class="text" id="dbDatabase" name="dbDatabase" value="<?php _v('dbDatabase'); ?>" />
|
||||
<p class="description"><?php _e('可以在MySQL服务的管理页面看到您创建的数据库名称'); ?></p>
|
||||
</li>
|
||||
<input type="hidden" name="config" value="array (
|
||||
'host' => getenv('HTTP_BAE_ENV_ADDR_SQL_IP'),
|
||||
|
@ -19,7 +19,6 @@ update:
|
||||
|
||||
package:
|
||||
@echo 'package'
|
||||
rm -Rf build/mockup/
|
||||
rm -Rf build/tools/
|
||||
rm -Rf build/todo.txt
|
||||
rm -Rf build/usr/plugins/*
|
||||
@ -62,7 +61,12 @@ install:
|
||||
make update
|
||||
rm -Rf build/tools/
|
||||
rm -Rf build/todo.txt
|
||||
rm -Rf ${DIR}/usr/plugins/*
|
||||
rm -Rf build/usr/plugins/*
|
||||
rm -Rf build/admin/scss
|
||||
rm -Rf build/admin/img/editor
|
||||
rm -Rf build/admin/img/icons
|
||||
mkdir build/usr/uploads/
|
||||
chmod 777 build/usr/uploads/
|
||||
cp -Rf build/* ${DIR}
|
||||
make clear
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user