Skip to content

Commit

Permalink
Check for correct facades
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh committed Feb 4, 2015
1 parent 5c846ca commit 317ef79
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,23 @@ public function generateJsonHelper()
protected function detectDrivers()
{
try{
if (class_exists('Auth') && method_exists('Auth', 'driver')) {
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;
}
}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;
}
}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);
Expand All @@ -139,15 +139,15 @@ protected function detectDrivers()
}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;
}
}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;
Expand Down

0 comments on commit 317ef79

Please sign in to comment.