From 3f9831c5cf886c142c92e7038bc0340b78614481 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Wed, 4 Feb 2015 09:12:01 +0100 Subject: [PATCH] Check for correct facades --- src/Generator.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Generator.php b/src/Generator.php index cea5cae..74d8fd8 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -113,8 +113,8 @@ class Generator protected function detectDrivers() { - try{ - if (class_exists('Auth')) { + try{ + if (class_exists('Auth') && is_a('Auth', '\Illuminate\Support\Facades\Auth', true)) { $class = get_class(\Auth::driver()); $this->extra['Auth'] = array($class); $this->interfaces['\Illuminate\Auth\UserProviderInterface'] = $class; @@ -122,7 +122,7 @@ class Generator }catch (\Exception $e) {} try{ - if (class_exists('DB')) { + if (class_exists('DB') && is_a('DB', '\Illuminate\Support\Facades\DB', true)) { $class = get_class(\DB::connection()); $this->extra['DB'] = array($class); $this->interfaces['\Illuminate\Database\ConnectionInterface'] = $class; @@ -130,7 +130,7 @@ class Generator }catch (\Exception $e) {} try{ - if (class_exists('Cache')) { + if (class_exists('Cache') && is_a('Cache', '\Illuminate\Support\Facades\Cache', true)) { $driver = get_class(\Cache::driver()); $store = get_class(\Cache::getStore()); $this->extra['Cache'] = array($driver, $store); @@ -139,7 +139,7 @@ class Generator }catch (\Exception $e) {} try{ - if (class_exists('Queue')) { + if (class_exists('Queue') && is_a('Queue', '\Illuminate\Support\Facades\Queue', true)) { $class = get_class(\Queue::connection()); $this->extra['Queue'] = array($class); $this->interfaces['\Illuminate\Queue\QueueInterface'] = $class; @@ -147,7 +147,7 @@ class Generator }catch (\Exception $e) {} try{ - if (class_exists('SSH')){ + if (class_exists('SSH') && is_a('SSH', '\Illuminate\Support\Facades\SSH', true)){ $class = get_class(\SSH::connection()); $this->extra['SSH'] = array($class); $this->interfaces['\Illuminate\Remote\ConnectionInterface'] = $class;