2015-02-24 18:03:18 +08:00
|
|
|
<?php namespace Flarum\Api;
|
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
use Flarum\Api\Serializers\BaseSerializer;
|
|
|
|
|
|
|
|
class ApiServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap the application events.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
2015-02-26 10:18:23 +08:00
|
|
|
$this->app->singleton(
|
|
|
|
'Illuminate\Contracts\Debug\ExceptionHandler',
|
|
|
|
'Flarum\Api\ExceptionHandler'
|
|
|
|
);
|
|
|
|
|
2015-02-24 18:03:18 +08:00
|
|
|
include __DIR__.'/routes.php';
|
|
|
|
|
|
|
|
BaseSerializer::setActor($this->app['Flarum\Core\Support\Actor']);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the service provider.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
$this->app->singleton('Flarum\Core\Support\Actor');
|
|
|
|
}
|
|
|
|
}
|