2015-03-20 18:30:45 -06:00
|
|
|
<?php
|
|
|
|
|
2015-04-19 08:52:39 +01:00
|
|
|
/*
|
|
|
|
* This file is part of Cachet.
|
|
|
|
*
|
2015-07-06 17:37:01 +01:00
|
|
|
* (c) Alt Three Services Limited
|
2015-04-19 08:52:39 +01:00
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2015-03-20 18:30:45 -06:00
|
|
|
namespace CachetHQ\Cachet\Providers;
|
|
|
|
|
2015-06-12 22:38:49 +01:00
|
|
|
use Illuminate\Bus\Dispatcher;
|
2015-03-20 18:30:45 -06:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2015-06-12 22:44:57 +01:00
|
|
|
use Illuminate\Support\Str;
|
2015-03-20 18:30:45 -06:00
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
{
|
2015-06-12 22:37:46 +01:00
|
|
|
/**
|
|
|
|
* Boot the service provider.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Bus\Dispatcher $dispatcher
|
|
|
|
*/
|
|
|
|
public function boot(Dispatcher $dispatcher)
|
|
|
|
{
|
|
|
|
$dispatcher->mapUsing(function ($command) {
|
2015-08-06 21:16:49 -05:00
|
|
|
return Dispatcher::simpleMapping($command, 'CachetHQ\Cachet', 'CachetHQ\Cachet\Handlers');
|
2015-06-12 22:37:46 +01:00
|
|
|
});
|
2015-06-12 22:46:41 +01:00
|
|
|
|
2015-06-12 22:44:57 +01:00
|
|
|
Str::macro('canonicalize', function ($url) {
|
|
|
|
return preg_replace('/([^\/])$/', '$1/', $url);
|
|
|
|
});
|
2015-06-12 22:37:46 +01:00
|
|
|
}
|
|
|
|
|
2015-03-20 18:30:45 -06:00
|
|
|
/**
|
2015-05-28 19:46:54 +01:00
|
|
|
* Register the service provider.
|
2015-08-30 22:42:38 +01:00
|
|
|
*
|
|
|
|
* @return void
|
2015-03-20 18:30:45 -06:00
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
2015-05-28 19:46:54 +01:00
|
|
|
$this->app->bind('Illuminate\Contracts\Auth\Registrar', 'CachetHQ\Cachet\Services\Registrar');
|
2015-03-20 18:30:45 -06:00
|
|
|
}
|
|
|
|
}
|