Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the page cache plugin #36042

Merged
merged 26 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7fcfd9c
Refactor the page cache plugin
Nov 14, 2021
e02d6de
Don't try to fix stupid
Nov 14, 2021
42946c0
Make the plugin class final
Nov 14, 2021
7c0ee86
Using low priority
Nov 15, 2021
6eda02a
Inject factories into the plugin
Nov 20, 2021
444fdb2
Refactor the page cache plugin
Nov 14, 2021
45c617b
Don't try to fix stupid
Nov 14, 2021
8576947
Make the plugin class final
Nov 14, 2021
e53aa91
Using low priority
Nov 15, 2021
b2a50ee
Inject factories into the plugin
Nov 20, 2021
4b6a2bf
Merge remote-tracking branch 'nikosdion/feature/cache-plugin-refactor…
nikosdion Jan 31, 2022
86369ce
Merge remote-tracking branch 'joomla/4.2-dev' into feature/cache-plug…
nikosdion Mar 4, 2022
1fcce43
Remove version attribute from the XML manifest
nikosdion Mar 5, 2022
1b57bc6
Remove useless line
nikosdion Mar 5, 2022
4217285
Make protected members private
nikosdion Mar 7, 2022
5a6d570
Inject the profiler
nikosdion Mar 9, 2022
52e20e3
Merge branch '4.2-dev' into feature/cache-plugin-refactor
laoneo Mar 9, 2022
8504b4e
Merge branch '4.2-dev' into feature/cache-plugin-refactor
nikosdion May 4, 2022
dbc7acd
Fix docblock
nikosdion May 4, 2022
8319325
Inject frontend router object
nikosdion May 4, 2022
3db06ca
Merge branch '4.2-dev' into feature/cache-plugin-refactor
laoneo May 9, 2022
47831bc
Update plugins/system/cache/services/provider.php
laoneo May 9, 2022
2eec592
Update plugins/system/cache/services/provider.php
laoneo May 9, 2022
89af2b8
Update plugins/system/cache/services/provider.php
laoneo May 9, 2022
6b36537
Update plugins/system/cache/services/provider.php
laoneo May 9, 2022
da17dd2
Merge branch '4.2-dev' into feature/cache-plugin-refactor
laoneo May 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
280 changes: 0 additions & 280 deletions plugins/system/cache/cache.php

This file was deleted.

4 changes: 3 additions & 1 deletion plugins/system/cache/cache.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
<authorUrl>www.joomla.org</authorUrl>
<version>3.0.0</version>
<description>PLG_CACHE_XML_DESCRIPTION</description>
<namespace path="src">Joomla\Plugin\System\Cache</namespace>
<files>
<filename plugin="cache">cache.php</filename>
<folder plugin="cache">services</folder>
<folder>src</folder>
</files>
<languages>
<language tag="en-GB">language/en-GB/plg_system_cache.ini</language>
Expand Down
48 changes: 48 additions & 0 deletions plugins/system/cache/services/provider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* @package Joomla.Plugin
* @subpackage System.cache
*
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

use Joomla\CMS\Cache\CacheControllerFactoryInterface;
use Joomla\CMS\Extension\PluginInterface;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Profiler\Profiler;
use Joomla\CMS\Router\SiteRouter;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\System\Cache\Extension\Cache;

return new class implements ServiceProviderInterface {
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
* @since __DEPLOY_VERSION__
*/
public function register(Container $container)
{
$container->set(
PluginInterface::class,
function (Container $container)
{
$plugin = PluginHelper::getPlugin('system', 'cache');
$dispatcher = $container->get(DispatcherInterface::class);
$documentFactory = $container->get('document.factory');
$cacheControllerFactory = $container->get(CacheControllerFactoryInterface::class);
$profiler = (defined('JDEBUG') && JDEBUG) ? Profiler::getInstance('Application') : null;
$router = $container->has(SiteRouter::class) ? $container->get(SiteRouter::class) : null;

return new Cache($dispatcher, (array) $plugin, $documentFactory, $cacheControllerFactory, $profiler, $router);
}
);
}
};
Loading