aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/container/ContainerBuilder.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-01-23 21:52:03 +0100
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commit8e47af2b3620c920116ec056173277c039163ec1 (patch)
treed77f31f17bf4485f5a3ec0fea895205e9bde0554 /application/container/ContainerBuilder.php
parentb0428aa9b02b058b72c40b6e8dc2298d55bf692f (diff)
downloadShaarli-8e47af2b3620c920116ec056173277c039163ec1.tar.gz
Shaarli-8e47af2b3620c920116ec056173277c039163ec1.tar.zst
Shaarli-8e47af2b3620c920116ec056173277c039163ec1.zip
Process logout through Slim controller
Diffstat (limited to 'application/container/ContainerBuilder.php')
-rw-r--r--application/container/ContainerBuilder.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/application/container/ContainerBuilder.php b/application/container/ContainerBuilder.php
index 99c12334..c5c4a2c3 100644
--- a/application/container/ContainerBuilder.php
+++ b/application/container/ContainerBuilder.php
@@ -11,6 +11,7 @@ use Shaarli\Formatter\FormatterFactory;
11use Shaarli\History; 11use Shaarli\History;
12use Shaarli\Plugin\PluginManager; 12use Shaarli\Plugin\PluginManager;
13use Shaarli\Render\PageBuilder; 13use Shaarli\Render\PageBuilder;
14use Shaarli\Render\PageCacheManager;
14use Shaarli\Security\LoginManager; 15use Shaarli\Security\LoginManager;
15use Shaarli\Security\SessionManager; 16use Shaarli\Security\SessionManager;
16 17
@@ -34,19 +35,30 @@ class ContainerBuilder
34 /** @var LoginManager */ 35 /** @var LoginManager */
35 protected $login; 36 protected $login;
36 37
37 public function __construct(ConfigManager $conf, SessionManager $session, LoginManager $login) 38 /** @var string */
38 { 39 protected $webPath;
40
41 public function __construct(
42 ConfigManager $conf,
43 SessionManager $session,
44 LoginManager $login,
45 string $webPath
46 ) {
39 $this->conf = $conf; 47 $this->conf = $conf;
40 $this->session = $session; 48 $this->session = $session;
41 $this->login = $login; 49 $this->login = $login;
50 $this->webPath = $webPath;
42 } 51 }
43 52
44 public function build(): ShaarliContainer 53 public function build(): ShaarliContainer
45 { 54 {
46 $container = new ShaarliContainer(); 55 $container = new ShaarliContainer();
56
47 $container['conf'] = $this->conf; 57 $container['conf'] = $this->conf;
48 $container['sessionManager'] = $this->session; 58 $container['sessionManager'] = $this->session;
49 $container['loginManager'] = $this->login; 59 $container['loginManager'] = $this->login;
60 $container['webPath'] = $this->webPath;
61
50 $container['plugins'] = function (ShaarliContainer $container): PluginManager { 62 $container['plugins'] = function (ShaarliContainer $container): PluginManager {
51 return new PluginManager($container->conf); 63 return new PluginManager($container->conf);
52 }; 64 };
@@ -81,6 +93,10 @@ class ContainerBuilder
81 return new FormatterFactory($container->conf, $container->loginManager->isLoggedIn()); 93 return new FormatterFactory($container->conf, $container->loginManager->isLoggedIn());
82 }; 94 };
83 95
96 $container['pageCacheManager'] = function (ShaarliContainer $container): PageCacheManager {
97 return new PageCacheManager($container->conf->get('resource.page_cache'));
98 };
99
84 return $container; 100 return $container;
85 } 101 }
86} 102}