- md5
- 89e5ce5e627ab79bff0e3e7dfa0304eb
- sha1
- e6c0813f0afebdcd7121fca263bb24a7285719ed
- sha256
- a9f95670904d9365302c3e354187bb2576d1268f27fa810de436c72e6e7f9525
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
<?php
/**
* Joomla! Content Management System
*
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Cache;
use Joomla\CMS\Factory;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Defines the trait for a CacheControllerFactoryInterface Aware Class.
*
* @since 4.2.0
*/
trait CacheControllerFactoryAwareTrait
{
/**
* CacheControllerFactoryInterface
*
* @var CacheControllerFactoryInterface
*
* @since 4.2.0
*/
private $cacheControllerFactory;
/**
* Get the CacheControllerFactoryInterface.
*
* @return CacheControllerFactoryInterface
*
* @since 4.2.0
*/
protected function getCacheControllerFactory(): CacheControllerFactoryInterface
{
if ($this->cacheControllerFactory) {
return $this->cacheControllerFactory;
}
@trigger_error(
sprintf('A cache controller is needed in %s. An UnexpectedValueException will be thrown in 5.0.', __CLASS__),
E_USER_DEPRECATED
);
return Factory::getContainer()->get(CacheControllerFactoryInterface::class);
}
/**
* Set the cache controller factory to use.
*
* @param ?CacheControllerFactoryInterface $cacheControllerFactory The cache controller factory to use.
*
* @return void
*
* @since 4.2.0
*/
public function setCacheControllerFactory(?CacheControllerFactoryInterface $cacheControllerFactory = null): void
{
$this->cacheControllerFactory = $cacheControllerFactory;
}
}
The same content is in 2 releases, Joomla 5.2.0-beta1 to 5.2.0-beta2. See them all, or every version of this file.