aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/container
diff options
context:
space:
mode:
Diffstat (limited to 'application/container')
-rw-r--r--application/container/ContainerBuilder.php5
-rw-r--r--application/container/ShaarliContainer.php2
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;
7use Shaarli\Bookmark\BookmarkFileService; 7use Shaarli\Bookmark\BookmarkFileService;
8use Shaarli\Bookmark\BookmarkServiceInterface; 8use Shaarli\Bookmark\BookmarkServiceInterface;
9use Shaarli\Config\ConfigManager; 9use Shaarli\Config\ConfigManager;
10use Shaarli\Formatter\FormatterFactory;
10use Shaarli\History; 11use Shaarli\History;
11use Shaarli\Plugin\PluginManager; 12use Shaarli\Plugin\PluginManager;
12use Shaarli\Render\PageBuilder; 13use 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
7use Shaarli\Bookmark\BookmarkServiceInterface; 7use Shaarli\Bookmark\BookmarkServiceInterface;
8use Shaarli\Config\ConfigManager; 8use Shaarli\Config\ConfigManager;
9use Shaarli\Formatter\FormatterFactory;
9use Shaarli\History; 10use Shaarli\History;
10use Shaarli\Plugin\PluginManager; 11use Shaarli\Plugin\PluginManager;
11use Shaarli\Render\PageBuilder; 12use 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 */
27class ShaarliContainer extends Container 29class ShaarliContainer extends Container
28{ 30{