From d9a959904377cd7fe9f619efebb869c598e5693d Mon Sep 17 00:00:00 2001
From: yunwuxin <448901948@qq.com>
Date: Wed, 29 Jun 2016 15:35:32 +0800
Subject: [PATCH] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E4=B8=8D?=
=?UTF-8?q?=E5=8C=BA=E5=88=86=E5=A4=A7=E5=B0=8F=E5=86=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
base.php | 4 +++-
library/think/App.php | 5 ++++-
library/think/Config.php | 8 ++++----
tpl/think_exception.tpl | 7 +++++--
4 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/base.php b/base.php
index 052febe7..7ab5a9ab 100644
--- a/base.php
+++ b/base.php
@@ -44,9 +44,11 @@ require CORE_PATH . 'Loader.php';
if (is_file(ROOT_PATH . 'env' . EXT)) {
$env = include ROOT_PATH . 'env' . EXT;
foreach ($env as $key => $val) {
- $name = ENV_PREFIX . $key;
+ $name = ENV_PREFIX . strtoupper($key);
if (is_bool($val)) {
$val = $val ? 1 : 0;
+ } elseif (!is_scalar($val)) {
+ continue;
}
putenv("$name=$val");
}
diff --git a/library/think/App.php b/library/think/App.php
index 9865d1d3..f03c31f8 100644
--- a/library/think/App.php
+++ b/library/think/App.php
@@ -352,9 +352,12 @@ class App
} else {
//重新申请一块比较大的buffer
if (ob_get_level() > 0) {
- ob_end_clean();
+ $output = ob_get_clean();
}
ob_start();
+ if (!empty($output)) {
+ echo $output;
+ }
}
// 应用命名空间
diff --git a/library/think/Config.php b/library/think/Config.php
index 330e57f1..105920b1 100644
--- a/library/think/Config.php
+++ b/library/think/Config.php
@@ -81,7 +81,7 @@ class Config
if (!strpos($name, '.')) {
// 判断环境变量
- $result = getenv(ENV_PREFIX . $name);
+ $result = getenv(ENV_PREFIX . strtoupper($name));
if (false !== $result) {
return $result;
}
@@ -89,7 +89,7 @@ class Config
} else {
// 二维数组设置和获取支持
$name = explode('.', $name);
- $result = getenv(ENV_PREFIX . $name[0] . '_' . $name[1]);
+ $result = getenv(ENV_PREFIX . strtoupper($name[0] . '_' . $name[1]));
// 判断环境变量
if (false !== $result) {
return $result;
@@ -113,7 +113,7 @@ class Config
}
if (!strpos($name, '.')) {
- $result = getenv(ENV_PREFIX . $name);
+ $result = getenv(ENV_PREFIX . strtoupper($name));
if (false !== $result) {
return $result;
}
@@ -122,7 +122,7 @@ class Config
} else {
// 二维数组设置和获取支持
$name = explode('.', $name);
- $result = getenv(ENV_PREFIX . $name[0] . '_' . $name[1]);
+ $result = getenv(ENV_PREFIX . strtoupper($name[0] . '_' . $name[1]));
// 判断环境变量
if (false !== $result) {
return $result;
diff --git a/tpl/think_exception.tpl b/tpl/think_exception.tpl
index aabf82a8..a978f1de 100644
--- a/tpl/think_exception.tpl
+++ b/tpl/think_exception.tpl
@@ -83,11 +83,11 @@