From 7b51354c9de386bda26bf2bdc7f0b62b70aa86ca Mon Sep 17 00:00:00 2001 From: joyqi Date: Mon, 21 Oct 2013 11:38:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=94=E7=94=A8=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/install.php b/install.php index 7d05c0ce..f62f58ff 100644 --- a/install.php +++ b/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; +} + /** * 获取传递参数 * @@ -483,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;