Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe Cache
+ Graphe d'héritage de Cache:

Fonctions membres publiques

 __construct (&$subject, $config, DocumentFactoryInterface $documentFactory, CacheControllerFactoryInterface $cacheControllerFactory, ?Profiler $profiler, ?SiteRouter $router)
 
 onAfterRoute (Event $event)
 
 onAfterRender (Event $event)
 
 onAfterRespond (Event $event)
 
- Fonctions membres publiques hérités de CMSPlugin
 __construct (&$subject, $config=array())
 
 loadLanguage ($extension='', $basePath=JPATH_ADMINISTRATOR)
 
 setApplication (CMSApplicationInterface $application)
 
- Fonctions membres publiques hérités de DispatcherAwareInterface
 setDispatcher (DispatcherInterface $dispatcher)
 
- Fonctions membres publiques hérités de PluginInterface
 registerListeners ()
 

Fonctions membres publiques statiques

static getSubscribedEvents ()
 

Fonctions membres privées

 appStateSupportsCaching ()
 
 getCacheController ()
 
 getCacheKey ()
 
 isExcluded ()
 

Attributs privés

 $cache
 
 $documentFactory
 
 $cacheControllerFactory
 
 $profiler
 
 $router
 

Membres hérités additionnels

- Champs de données hérités de CMSPlugin
 $params = null
 
- Fonctions membres protégées hérités de CMSPlugin
 registerLegacyListener (string $methodName)
 
 registerListener (string $methodName)
 
 getApplication ()
 
- Attributs protégés hérités de CMSPlugin
 $_name = null
 
 $_type = null
 
 $autoloadLanguage = false
 
 $allowLegacyListeners = true
 

Description détaillée

Joomla! Page Cache Plugin.

Depuis
1.5

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( $subject,
  $config,
DocumentFactoryInterface  $documentFactory,
CacheControllerFactoryInterface  $cacheControllerFactory,
?Profiler  $profiler,
?SiteRouter  $router 
)

Constructor

Paramètres
DispatcherInterface$subjectThe object to observe
array$configAn optional associative array of configuration settings. Recognized key values include 'name', 'group', 'params', 'language' (this list is not meant to be comprehensive).
DocumentFactoryInterface$documentFactoryThe application's document factory
CacheControllerFactoryInterface$cacheControllerFactoryCache controller factory
Profiler | null$profilerThe application profiler
SiteRouter | null$routerThe frontend router
Depuis
4.2.0

Références $config, $subject, et Symfony\Contracts\Service\__construct().

Documentation des fonctions membres

◆ appStateSupportsCaching()

appStateSupportsCaching ( )
private

Does the current application state allow for caching?

The following conditions must be met:

  • This is the frontend application. This plugin does not apply to other applications.
  • This is a GET request. This plugin does not apply to POST, PUT etc.
  • There is no currently logged in user (pages might have user–specific content).
  • The message queue is empty.

The first two tests are cached to make early returns possible; these conditions cannot change throughout the lifetime of the request.

The other two tests MUST NOT be cached because auto–login plugins may fire anytime within the application lifetime logging in a user and messages can be generated anytime within the application's lifetime.

Renvoie
boolean
Depuis
4.2.0

Références null.

◆ getCacheController()

getCacheController ( )
private

Get the cache controller

Renvoie
CacheController
Depuis
4.2.0

Références $options.

◆ getCacheKey()

getCacheKey ( )
private

Get a cache key for the current page based on the url and possible other factors.

Renvoie
string
Depuis
3.7

Références $key, $parts, Uri\getInstance(), et PluginHelper\importPlugin().

◆ getSubscribedEvents()

static getSubscribedEvents ( )
static

Returns an array of CMS events this plugin will listen to and the respective handlers.

Renvoie
array
Depuis
4.2.0

Note that onAfterRender and onAfterRespond must be the last handlers to run for this plugin to operate as expected. These handlers put pages into cache. We must make sure that a. the page SHOULD be cached and b. we are caching the complete page, as it's output to the browser.

Implémente SubscriberInterface.

Références Priority\LOW.

◆ isExcluded()

isExcluded ( )
private

Check if the page is excluded from the cache or not.

Renvoie
boolean True if the page is excluded else false
Depuis
3.5

Références $active, $results, Uri\getInstance(), et PluginHelper\importPlugin().

◆ onAfterRender()

onAfterRender ( Event  $event)

After Render Event. Check whether the current page is excluded from cache.

Paramètres
Event$eventThe CMS event we are handling.
Renvoie
void
Depuis
3.9.12

◆ onAfterRespond()

onAfterRespond ( Event  $event)

After Respond Event. Stores page in cache.

Paramètres
Event$eventThe application event we are handling.
Renvoie
void
Depuis
1.5

Références Laminas\Diactoros\getBody().

◆ onAfterRoute()

onAfterRoute ( Event  $event)

Returns a cached page if the current URL exists in the cache.

Paramètres
Event$eventThe Joomla event being handled
Renvoie
void
Depuis
4.0.0

Références $data, $document, $results, PluginHelper\importPlugin(), et JDEBUG.

Documentation des champs

◆ $cache

$cache
private

◆ $cacheControllerFactory

$cacheControllerFactory
private

◆ $documentFactory

$documentFactory
private

◆ $profiler

$profiler
private

◆ $router

$router
private

La documentation de cette classe a été générée à partir du fichier suivant :