From 2508528596a648d3349eac47a635a54bda187031 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Thu, 16 Aug 2018 17:13:18 +0200 Subject: [PATCH] Move com_finder to services --- .../components/com_finder/dispatcher.php | 29 ----------- .../components/com_finder/finder.php | 19 ------- .../com_finder/services/provider.php | 52 +++++++++++++++++++ components/com_finder/dispatcher.php | 29 ----------- 4 files changed, 52 insertions(+), 77 deletions(-) delete mode 100644 administrator/components/com_finder/dispatcher.php delete mode 100644 administrator/components/com_finder/finder.php create mode 100644 administrator/components/com_finder/services/provider.php delete mode 100644 components/com_finder/dispatcher.php diff --git a/administrator/components/com_finder/dispatcher.php b/administrator/components/com_finder/dispatcher.php deleted file mode 100644 index 305da8d0701fa..0000000000000 --- a/administrator/components/com_finder/dispatcher.php +++ /dev/null @@ -1,29 +0,0 @@ -authorise('core.manage', 'com_finder')) -{ - throw new \JAccessExceptionNotallowed(\JText::_('JERROR_ALERTNOAUTHOR'), 403); -} - -$controller = \JControllerLegacy::getInstance('Finder'); -$controller->execute(\JFactory::getApplication()->input->get('task')); -$controller->redirect(); diff --git a/administrator/components/com_finder/services/provider.php b/administrator/components/com_finder/services/provider.php new file mode 100644 index 0000000000000..7011e9eb0d127 --- /dev/null +++ b/administrator/components/com_finder/services/provider.php @@ -0,0 +1,52 @@ +registerServiceProvider(new MVCFactoryFactory('\\Joomla\\Component\\Finder')); + $container->registerServiceProvider(new DispatcherFactory('\\Joomla\\Component\\Finder')); + $container->set( + ComponentInterface::class, + function (Container $container) + { + $component = new MVCComponent($container->get(DispatcherFactoryInterface::class)); + $component->setMvcFactoryFactory($container->get(MVCFactoryFactoryInterface::class)); + + return $component; + } + ); + } +}; diff --git a/components/com_finder/dispatcher.php b/components/com_finder/dispatcher.php deleted file mode 100644 index 722639aa990c9..0000000000000 --- a/components/com_finder/dispatcher.php +++ /dev/null @@ -1,29 +0,0 @@ -