Events 

ClearMyraCloudCacheEvent 

\CPSIT\MyraCloudConnector\Event\ClearMyraCloudCacheEvent is a PSR-14 event dispatched by every built-in trigger of a Myra Cloud cache clear request:

  • the CLI command
  • the backend AJAX endpoint used by the clear-cache buttons, the clear-cache menu entries and the context menu action
  • the AutoClear hooks (page update and file replace)
final class ClearMyraCloudCacheEvent
{
    public function __construct(
        public readonly Typo3CacheType $type,
        public readonly ?string $identifier = null,
        public readonly ?int $languageId = null,
    ) {}

    public function getCacheResult(): ?bool;
    public function setCacheResult(bool $result): void;
}
Copied!

type , identifier and languageId describe what should be cleared (see CLI command for the meaning of these values per type). A listener is expected to report the outcome of the clear request via setCacheResult() ; callers read it back via getCacheResult() .

Default listener 

\CPSIT\MyraCloudConnector\EventListener\ExternalClearCacheListener is registered by default. It resolves the affected page (for the page type when no explicit language is given), forwards the request to the configured Myra adapter, de-duplicates repeated requests for the same identifier/language within a request via the TYPO3 runtime cache, and reports the result back on the event.

Custom listeners 

Register an additional listener on ClearMyraCloudCacheEvent (via #[AsEventListener] or Configuration/Services.yaml) to react to a clear request, for example to clear an additional external cache alongside Myra Cloud, or to log specific requests.