diff options
Diffstat (limited to 'application/container')
-rw-r--r-- | application/container/ContainerBuilder.php | 5 | ||||
-rw-r--r-- | application/container/ShaarliContainer.php | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/application/container/ContainerBuilder.php b/application/container/ContainerBuilder.php index e2c78ccc..99c12334 100644 --- a/application/container/ContainerBuilder.php +++ b/application/container/ContainerBuilder.php | |||
@@ -7,6 +7,7 @@ namespace Shaarli\Container; | |||
7 | use Shaarli\Bookmark\BookmarkFileService; | 7 | use Shaarli\Bookmark\BookmarkFileService; |
8 | use Shaarli\Bookmark\BookmarkServiceInterface; | 8 | use Shaarli\Bookmark\BookmarkServiceInterface; |
9 | use Shaarli\Config\ConfigManager; | 9 | use Shaarli\Config\ConfigManager; |
10 | use Shaarli\Formatter\FormatterFactory; | ||
10 | use Shaarli\History; | 11 | use Shaarli\History; |
11 | use Shaarli\Plugin\PluginManager; | 12 | use Shaarli\Plugin\PluginManager; |
12 | use Shaarli\Render\PageBuilder; | 13 | use Shaarli\Render\PageBuilder; |
@@ -76,6 +77,10 @@ class ContainerBuilder | |||
76 | return new PluginManager($container->conf); | 77 | return new PluginManager($container->conf); |
77 | }; | 78 | }; |
78 | 79 | ||
80 | $container['formatterFactory'] = function (ShaarliContainer $container): FormatterFactory { | ||
81 | return new FormatterFactory($container->conf, $container->loginManager->isLoggedIn()); | ||
82 | }; | ||
83 | |||
79 | return $container; | 84 | return $container; |
80 | } | 85 | } |
81 | } | 86 | } |
diff --git a/application/container/ShaarliContainer.php b/application/container/ShaarliContainer.php index 3fa9116e..fdf2f77f 100644 --- a/application/container/ShaarliContainer.php +++ b/application/container/ShaarliContainer.php | |||
@@ -6,6 +6,7 @@ namespace Shaarli\Container; | |||
6 | 6 | ||
7 | use Shaarli\Bookmark\BookmarkServiceInterface; | 7 | use Shaarli\Bookmark\BookmarkServiceInterface; |
8 | use Shaarli\Config\ConfigManager; | 8 | use Shaarli\Config\ConfigManager; |
9 | use Shaarli\Formatter\FormatterFactory; | ||
9 | use Shaarli\History; | 10 | use Shaarli\History; |
10 | use Shaarli\Plugin\PluginManager; | 11 | use Shaarli\Plugin\PluginManager; |
11 | use Shaarli\Render\PageBuilder; | 12 | use Shaarli\Render\PageBuilder; |
@@ -23,6 +24,7 @@ use Slim\Container; | |||
23 | * @property BookmarkServiceInterface $bookmarkService | 24 | * @property BookmarkServiceInterface $bookmarkService |
24 | * @property PageBuilder $pageBuilder | 25 | * @property PageBuilder $pageBuilder |
25 | * @property PluginManager $pluginManager | 26 | * @property PluginManager $pluginManager |
27 | * @property FormatterFactory $formatterFactory | ||
26 | */ | 28 | */ |
27 | class ShaarliContainer extends Container | 29 | class ShaarliContainer extends Container |
28 | { | 30 | { |