mirror of
https://github.com/flarum/core.git
synced 2025-10-12 07:24:27 +02:00
* Rename `app` helper to `resolve`, deprecate old version * Rename $this->app to $this->container in service providers We no longer couple Flarum\Foundation\Application to the Laravel container; instead, we use the container separately. Changing our naming to reflect that will make things clearer.
34 lines
870 B
PHP
34 lines
870 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Flarum.
|
|
*
|
|
* For detailed copyright and license information, please view the
|
|
* LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Flarum\Formatter;
|
|
|
|
use Flarum\Foundation\AbstractServiceProvider;
|
|
use Flarum\Foundation\Paths;
|
|
use Illuminate\Cache\Repository;
|
|
use Illuminate\Contracts\Container\Container;
|
|
|
|
class FormatterServiceProvider extends AbstractServiceProvider
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function register()
|
|
{
|
|
$this->container->singleton('flarum.formatter', function (Container $container) {
|
|
return new Formatter(
|
|
new Repository($container->make('cache.filestore')),
|
|
$this->container[Paths::class]->storage.'/formatter'
|
|
);
|
|
});
|
|
|
|
$this->container->alias('flarum.formatter', Formatter::class);
|
|
}
|
|
}
|