mirror of
https://github.com/typecho/typecho.git
synced 2025-03-14 15:09:41 +01:00
修正bae 3.0兼容性问题
This commit is contained in:
parent
12c9df95d4
commit
d27fc51634
@ -70,6 +70,7 @@ function _engine()
|
||||
{
|
||||
return !empty($_SERVER['HTTP_APPNAME']) // SAE
|
||||
|| !!getenv('HTTP_BAE_ENV_APPID') // BAE
|
||||
|| !!getenv('HTTP_BAE_LOGID') // BAE 3.0
|
||||
|| (isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false); // GAE
|
||||
}
|
||||
|
||||
@ -512,8 +513,9 @@ Typecho_Db::set(\$db);
|
||||
|
||||
if (!file_exists('./config.inc.php')) {
|
||||
?>
|
||||
<div class="message notice"><p><?php _e('安装程序无法自动创建 config.inc.php 文件'); ?><br /><?php _e('您可以在网站根目录下手动创建 config.inc.php 文件, 并复制如下代码至其中'); ?></p>
|
||||
<p><textarea rows="5" onmouseover="this.select();" readonly><?php echo htmlspecialchars($contents); ?></textarea></p>
|
||||
<div class="message notice"><p><?php _e('安装程序无法自动创建 <strong>config.inc.php</strong> 文件'); ?><br />
|
||||
<?php _e('您可以在网站根目录下手动创建 <strong>config.inc.php</strong> 文件, 并复制如下代码至其中'); ?></p>
|
||||
<p><textarea rows="5" onmouseover="this.select();" class="w-100" readonly><?php echo htmlspecialchars($contents); ?></textarea></p>
|
||||
<p><button name="created" value="1" type="submit" class="primary">创建完毕, 继续安装 »</button></p></div>
|
||||
<?php
|
||||
} else {
|
||||
|
@ -18,7 +18,29 @@
|
||||
<input type="hidden" name="dbDatabase" value="<?php echo SAE_MYSQL_DB; ?>" />
|
||||
<?php elseif (!!getenv('HTTP_BAE_ENV_ADDR_SQL_IP')): ?>
|
||||
<!-- BAE -->
|
||||
<?php
|
||||
$baeDbUser = "getenv('HTTP_BAE_ENV_AK')";
|
||||
$baeDbPassword = "getenv('HTTP_BAE_ENV_SK')";
|
||||
?>
|
||||
<h3 class="warning"><?php _e('系统将为您自动匹配 %s 环境的安装选项', 'BAE'); ?></h3>
|
||||
<?php if (!getenv('HTTP_BAE_ENV_AK')): $baeDbUser = "'{user}'"; ?>
|
||||
<li>
|
||||
<label class="typecho-label" for="dbUser"><?php _e('应用API Key'); ?></label>
|
||||
<input type="text" class="text" name="dbUser" id="dbUser" value="<?php _v('dbUser'); ?>" />
|
||||
</li>
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="dbUser" value="<?php echo getenv('HTTP_BAE_ENV_AK'); ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!getenv('HTTP_BAE_ENV_SK')): $baeDbPassword = "'{password}'"; ?>
|
||||
<li>
|
||||
<label class="typecho-label" for="dbPassword"><?php _e('应用Secret Key'); ?></label>
|
||||
<input type="text" class="text" name="dbPassword" id="dbPassword" value="<?php _v('dbPassword'); ?>" />
|
||||
</li>
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="dbPassword" value="<?php echo getenv('HTTP_BAE_ENV_SK'); ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<li>
|
||||
<label class="typecho-label" for="dbDatabase"><?php _e('数据库名'); ?></label>
|
||||
<input type="text" class="text" id="dbDatabase" name="dbDatabase" value="<?php _v('dbDatabase'); ?>" />
|
||||
@ -26,16 +48,14 @@
|
||||
</li>
|
||||
<input type="hidden" name="config" value="array (
|
||||
'host' => getenv('HTTP_BAE_ENV_ADDR_SQL_IP'),
|
||||
'user' => getenv('HTTP_BAE_ENV_AK'),
|
||||
'password' => getenv('HTTP_BAE_ENV_SK'),
|
||||
'user' => <?php echo $baeDbUser; ?>,
|
||||
'password' => <?php echo $baeDbPassword; ?>,
|
||||
'charset' => '<?php _e('utf8'); ?>',
|
||||
'port' => getenv('HTTP_BAE_ENV_ADDR_SQL_PORT'),
|
||||
'database' => '{database}'
|
||||
)" />
|
||||
<input type="hidden" name="dbHost" value="<?php echo getenv('HTTP_BAE_ENV_ADDR_SQL_IP'); ?>" />
|
||||
<input type="hidden" name="dbPort" value="<?php echo getenv('HTTP_BAE_ENV_ADDR_SQL_PORT'); ?>" />
|
||||
<input type="hidden" name="dbUser" value="<?php echo getenv('HTTP_BAE_ENV_AK'); ?>" />
|
||||
<input type="hidden" name="dbPassword" value="<?php echo getenv('HTTP_BAE_ENV_SK'); ?>" />
|
||||
<?php elseif (isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false): ?>
|
||||
<!-- GAE -->
|
||||
<h3 class="warning"><?php _e('系统将为您自动匹配 %s 环境的安装选项', 'GAE'); ?></h3>
|
||||
|
Loading…
x
Reference in New Issue
Block a user