Cachet/app/Providers/AppServiceProvider.php

44 lines
1.1 KiB
PHP
Raw Normal View History

2015-03-20 18:30:45 -06:00
<?php
/*
* This file is part of Cachet.
*
2015-07-06 17:37:01 +01:00
* (c) Alt Three Services Limited
*
* 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
{
/**
* Boot the service provider.
*
* @param \Illuminate\Bus\Dispatcher $dispatcher
*/
public function boot(Dispatcher $dispatcher)
{
$dispatcher->mapUsing(function ($command) {
return Dispatcher::simpleMapping($command, 'CachetHQ\Cachet\Commands', 'CachetHQ\Cachet\Handlers\Commands');
});
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-03-20 18:30:45 -06:00
/**
2015-05-28 19:46:54 +01:00
* Register the service provider.
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
}
}