From 9c75f877935fa6adec951a4d8d32b328aaab314f Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 13 Jun 2020 13:08:01 +0200 Subject: Use multi-level routes for existing controllers instead of 1 level everywhere Also prefix most admin routes with /admin/ --- application/container/ContainerBuilder.php | 10 ++++------ application/container/ShaarliContainer.php | 17 ++++++++--------- 2 files changed, 12 insertions(+), 15 deletions(-) (limited to 'application/container') 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 /** @var LoginManager */ protected $login; - /** @var string */ - protected $webPath; + /** @var string|null */ + protected $basePath = null; public function __construct( ConfigManager $conf, SessionManager $session, - LoginManager $login, - string $webPath + LoginManager $login ) { $this->conf = $conf; $this->session = $session; $this->login = $login; - $this->webPath = $webPath; } public function build(): ShaarliContainer @@ -60,7 +58,7 @@ class ContainerBuilder $container['conf'] = $this->conf; $container['sessionManager'] = $this->session; $container['loginManager'] = $this->login; - $container['webPath'] = $this->webPath; + $container['basePath'] = $this->basePath; $container['plugins'] = function (ShaarliContainer $container): PluginManager { 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; /** * Extension of Slim container to document the injected objects. * - * @property mixed[] $environment $_SERVER automatically injected by Slim * @property string $basePath Shaarli's instance base path (e.g. `/shaarli/`) + * @property BookmarkServiceInterface $bookmarkService * @property ConfigManager $conf - * @property SessionManager $sessionManager - * @property LoginManager $loginManager - * @property string $webPath + * @property mixed[] $environment $_SERVER automatically injected by Slim + * @property FeedBuilder $feedBuilder + * @property FormatterFactory $formatterFactory * @property History $history - * @property BookmarkServiceInterface $bookmarkService + * @property HttpAccess $httpAccess + * @property LoginManager $loginManager * @property PageBuilder $pageBuilder - * @property PluginManager $pluginManager - * @property FormatterFactory $formatterFactory * @property PageCacheManager $pageCacheManager - * @property FeedBuilder $feedBuilder + * @property PluginManager $pluginManager + * @property SessionManager $sessionManager * @property Thumbnailer $thumbnailer - * @property HttpAccess $httpAccess */ class ShaarliContainer extends Container { -- cgit v1.2.3