From 7acf12b2e6b574ff9ad660624e46888a095411b3 Mon Sep 17 00:00:00 2001 From: Xujian Chen Date: Thu, 2 Jun 2016 18:04:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89=20Provider=20=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#12)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用自定义 Provider 时,因 initialDrivers 无相应的 key,会报 Undefined index 错误 --- src/SocialiteManager.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SocialiteManager.php b/src/SocialiteManager.php index 8815850..d7c0966 100644 --- a/src/SocialiteManager.php +++ b/src/SocialiteManager.php @@ -130,7 +130,8 @@ public function driver($driver = null) */ protected function createDriver($driver) { - if ($provider = $this->initialDrivers[$driver]) { + if (isset($this->initialDrivers[$driver])) { + $provider = $this->initialDrivers[$driver]; $provider = __NAMESPACE__.'\\Providers\\'.$provider.'Provider'; return $this->buildProvider($provider, $this->formatConfig($this->config->get($driver)));