aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/container
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-06-13 13:08:01 +0200
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commit9c75f877935fa6adec951a4d8d32b328aaab314f (patch)
tree1cdd09ddfc00c6cebb92bb2b90381a06fd31246d /application/container
parent818b3193ffabec57501e3bdfa997206e3c0671ef (diff)
downloadShaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.tar.gz
Shaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.tar.zst
Shaarli-9c75f877935fa6adec951a4d8d32b328aaab314f.zip
Use multi-level routes for existing controllers instead of 1 level everywhere
Also prefix most admin routes with /admin/
Diffstat (limited to 'application/container')
-rw-r--r--application/container/ContainerBuilder.php10
-rw-r--r--application/container/ShaarliContainer.php17
2 files changed, 12 insertions, 15 deletions
diff --git a/application/container/ContainerBuilder.php b/application/container/ContainerBuilder.php
index 85126246..72a85710 100644
--- a/application/container/ContainerBuilder.php
+++ b/application/container/ContainerBuilder.php
@@ -38,19 +38,17 @@ class ContainerBuilder
38 /** @var LoginManager */ 38 /** @var LoginManager */
39 protected $login; 39 protected $login;
40 40
41 /** @var string */ 41 /** @var string|null */
42 protected $webPath; 42 protected $basePath = null;
43 43
44 public function __construct( 44 public function __construct(
45 ConfigManager $conf, 45 ConfigManager $conf,
46 SessionManager $session, 46 SessionManager $session,
47 LoginManager $login, 47 LoginManager $login
48 string $webPath
49 ) { 48 ) {
50 $this->conf = $conf; 49 $this->conf = $conf;
51 $this->session = $session; 50 $this->session = $session;
52 $this->login = $login; 51 $this->login = $login;
53 $this->webPath = $webPath;
54 } 52 }
55 53
56 public function build(): ShaarliContainer 54 public function build(): ShaarliContainer
@@ -60,7 +58,7 @@ class ContainerBuilder
60 $container['conf'] = $this->conf; 58 $container['conf'] = $this->conf;
61 $container['sessionManager'] = $this->session; 59 $container['sessionManager'] = $this->session;
62 $container['loginManager'] = $this->login; 60 $container['loginManager'] = $this->login;
63 $container['webPath'] = $this->webPath; 61 $container['basePath'] = $this->basePath;
64 62
65 $container['plugins'] = function (ShaarliContainer $container): PluginManager { 63 $container['plugins'] = function (ShaarliContainer $container): PluginManager {
66 return new PluginManager($container->conf); 64 return new PluginManager($container->conf);
diff --git a/application/container/ShaarliContainer.php b/application/container/ShaarliContainer.php
index a95393cd..4b97aae2 100644
--- a/application/container/ShaarliContainer.php
+++ b/application/container/ShaarliContainer.php
@@ -21,21 +21,20 @@ use Slim\Container;
21/** 21/**
22 * Extension of Slim container to document the injected objects. 22 * Extension of Slim container to document the injected objects.
23 * 23 *
24 * @property mixed[] $environment $_SERVER automatically injected by Slim
25 * @property string $basePath Shaarli's instance base path (e.g. `/shaarli/`) 24 * @property string $basePath Shaarli's instance base path (e.g. `/shaarli/`)
25 * @property BookmarkServiceInterface $bookmarkService
26 * @property ConfigManager $conf 26 * @property ConfigManager $conf
27 * @property SessionManager $sessionManager 27 * @property mixed[] $environment $_SERVER automatically injected by Slim
28 * @property LoginManager $loginManager 28 * @property FeedBuilder $feedBuilder
29 * @property string $webPath 29 * @property FormatterFactory $formatterFactory
30 * @property History $history 30 * @property History $history
31 * @property BookmarkServiceInterface $bookmarkService 31 * @property HttpAccess $httpAccess
32 * @property LoginManager $loginManager
32 * @property PageBuilder $pageBuilder 33 * @property PageBuilder $pageBuilder
33 * @property PluginManager $pluginManager
34 * @property FormatterFactory $formatterFactory
35 * @property PageCacheManager $pageCacheManager 34 * @property PageCacheManager $pageCacheManager
36 * @property FeedBuilder $feedBuilder 35 * @property PluginManager $pluginManager
36 * @property SessionManager $sessionManager
37 * @property Thumbnailer $thumbnailer 37 * @property Thumbnailer $thumbnailer
38 * @property HttpAccess $httpAccess
39 */ 38 */
40class ShaarliContainer extends Container 39class ShaarliContainer extends Container
41{ 40{