PHP code example of labor-digital / typo3-distributed-cache-clearing

1. Go to this page and download the library: Download labor-digital/typo3-distributed-cache-clearing library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

labor-digital / typo3-distributed-cache-clearing example snippets




namespace LaborDigital\T3baExample\Configuration\ExtConfig;

use LaborDigital\T3ba\ExtConfig\ExtConfigContext;
use LaborDigital\T3dcc\Core\Message\Backend\Registry\RegistryMessageBackend;
use LaborDigital\T3dcc\ExtConfigHandler\ConfigureDistributedCacheClearingInterface;
use LaborDigital\T3dcc\ExtConfigHandler\DccConfigurator;

class Dcc implements ConfigureDistributedCacheClearingInterface
{
    public static function configureDistributedCacheClearing(DccConfigurator $configurator, ExtConfigContext $context): void
    {
        // You can use any of the built-in backends or a class that implements the MessageBackendInterface here.
        // Additional options for the backend can be provided as second parameter
        $configurator->setMessageBackend(RegistryMessageBackend::class);
    }
}



namespace LaborDigital\T3baExample\Configuration\ExtConfig;

use LaborDigital\T3ba\ExtConfig\ExtConfigContext;
use LaborDigital\T3dcc\Core\Message\Backend\Registry\RegistryMessageBackend;
use LaborDigital\T3dcc\ExtConfigHandler\ConfigureDistributedCacheClearingInterface;
use LaborDigital\T3dcc\ExtConfigHandler\DccConfigurator;

class Dcc implements ConfigureDistributedCacheClearingInterface
{
    public static function configureDistributedCacheClearing(DccConfigurator $configurator, ExtConfigContext $context): void
    {
        $configurator->setCheckInEveryRequest(true)
    }
}


namespace LaborDigital\T3baExample\Configuration\ExtConfig\Site\Common;

use LaborDigital\T3dcc\Api\Bundle\DccBundle;
use LaborDigital\T3fa\ExtConfigHandler\Api\BundleCollector;
use LaborDigital\T3fa\ExtConfigHandler\Api\ConfigureApiInterface;

class Api implements ConfigureApiInterface
{
    public static function registerBundles(BundleCollector $collector): void
    {
        $collector->register(DccBundle::class);
    }
    
    /* ... */
}


define('T3DCC_AUTOLOAD_PATH', dirname(__DIR__, 2) . '/vendor/autoload.php');


namespace LaborDigital\T3baExample\Configuration\ExtConfig;

use LaborDigital\T3ba\ExtConfig\ExtConfigContext;
use LaborDigital\T3dcc\Core\Message\Backend\Redis\RedisMessageBackend;
use LaborDigital\T3dcc\ExtConfigHandler\ConfigureDistributedCacheClearingInterface;
use LaborDigital\T3dcc\ExtConfigHandler\DccConfigurator;

class Dcc implements ConfigureDistributedCacheClearingInterface
{
    public static function configureDistributedCacheClearing(DccConfigurator $configurator, ExtConfigContext $context): void
    {
        $configurator->setMessageBackend(
        RedisMessageBackend::class,
        [
            // Required
            'hostname' => 'host',
            // The following options are optional
            'password' => '', // Only needed if the host