-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace BotMan\Drivers\BotFramework\Providers; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use BotMan\BotMan\Drivers\DriverManager; | ||
use BotMan\Studio\Providers\StudioServiceProvider; | ||
use BotMan\Drivers\BotFramework\BotFrameworkDriver; | ||
use BotMan\Drivers\BotFramework\BotFrameworkImageDriver; | ||
|
||
class BotFrameworkServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Perform post-registration booting of services. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
if (! $this->isRunningInBotManStudio()) { | ||
$this->loadDrivers(); | ||
|
||
$this->publishes([ | ||
__DIR__.'/../../stubs/botframework.php' => config_path('botman/botframework.php'), | ||
]); | ||
|
||
$this->mergeConfigFrom(__DIR__.'/../../stubs/botframework.php', 'botman.botframework'); | ||
} | ||
} | ||
|
||
/** | ||
* Load BotMan drivers. | ||
*/ | ||
protected function loadDrivers() | ||
{ | ||
DriverManager::loadDriver(BotFrameworkDriver::class); | ||
DriverManager::loadDriver(BotFrameworkImageDriver::class); | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
protected function isRunningInBotManStudio() | ||
{ | ||
return class_exists(StudioServiceProvider::class); | ||
} | ||
} |