From 85c2abdc6a67eea8b4c623f46686484ba415fcd4 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 19 Feb 2016 11:42:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=9F=E9=99=A4use=5Fdb=5Fswitch=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=8F=8A=20=E5=BA=94=E7=94=A8=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E6=95=B0=E6=8D=AE=E5=BA=93=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=20=E5=BA=94=E7=94=A8=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E7=9B=B4=E6=8E=A5=E9=85=8D=E7=BD=AE=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E7=9A=84database=E5=8F=82=E6=95=B0=20=E8=80=8C?= =?UTF-8?q?=E4=B8=8D=E9=9C=80=E8=A6=81=E5=85=A8=E9=83=A8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- convention.php | 2 -- library/think/Db.php | 4 ---- 2 files changed, 6 deletions(-) diff --git a/convention.php b/convention.php index dc61842e..020f24be 100644 --- a/convention.php +++ b/convention.php @@ -154,8 +154,6 @@ return [ // | 数据库设置 // +---------------------------------------------------------------------- - // 是否启用多状态数据库配置 如果启用的话 需要跟随app_status配置不同的数据库信息 - 'use_db_switch' => false, 'db_fields_strict' => true, 'database' => [ // 数据库类型 diff --git a/library/think/Db.php b/library/think/Db.php index 408a1015..90237a63 100644 --- a/library/think/Db.php +++ b/library/think/Db.php @@ -61,10 +61,6 @@ class Db { if (empty($config)) { $config = Config::get('database'); - if (Config::get('use_db_switch')) { - $status = Config::get('app_status'); - $config = $config[$status ?: 'default']; - } } elseif (is_string($config) && false === strpos($config, '/')) { // 支持读取配置参数 $config = Config::get($config);