IntegrityService
readonly class \
Checks for redirects that conflict with existing pages
Table of Contents
Methods
- __construct() : mixed
- checkRedirectIntegrity() : Generator
- Checks all redirects by dispatching a PSR-14 event for each record, allowing listeners to validate targets and flag broken redirects.
- findConflictingRedirects() : Generator
- Resolves all conflicting redirects
- findShadowedRedirects() : Generator
- Resolves all redirects which can never match, because another redirect with the same source is matched first whenever the redirect itself would be active.
- resetIntegrityStatus() : void
- Resets the integrity status of all redirects which are not listed in $conflictingUids, except those with a status listed in $statusesToKeep.
- setIntegrityStatus() : void
- updateShadowedIntegrityStatus() : array<int, array>
- Updates the shadowed integrity status of all redirects of the given source hosts.
Methods
__construct()
public
__construct(RedirectService $redirectService, SiteFinder $siteFinder, ConnectionPool $connectionPool, EventDispatcherInterface $eventDispatcher, TcaSchemaFactory $tcaSchemaFactory) : mixed
Parameters
- $redirectService : RedirectService
- $siteFinder : SiteFinder
- $connectionPool : ConnectionPool
- $eventDispatcher : EventDispatcherInterface
- $tcaSchemaFactory : TcaSchemaFactory
checkRedirectIntegrity()
Checks all redirects by dispatching a PSR-14 event for each record, allowing listeners to validate targets and flag broken redirects.
public
checkRedirectIntegrity() : Generator
Return values
GeneratorfindConflictingRedirects()
Resolves all conflicting redirects
public
findConflictingRedirects([string|null $siteIdentifier = null ]) : Generator
Parameters
- $siteIdentifier : string|null = null
Return values
GeneratorfindShadowedRedirects()
Resolves all redirects which can never match, because another redirect with the same source is matched first whenever the redirect itself would be active.
public
findShadowedRedirects([string[] $sourceHosts = [] ]) : Generator
Parameters
- $sourceHosts : string[] = []
-
Limits the check to these source hosts, all are checked if empty
Return values
GeneratorresetIntegrityStatus()
Resets the integrity status of all redirects which are not listed in $conflictingUids, except those with a status listed in $statusesToKeep.
public
resetIntegrityStatus(int[] $conflictingUids[, string[] $statusesToKeep = [] ]) : void
Parameters
- $conflictingUids : int[]
- $statusesToKeep : string[] = []
setIntegrityStatus()
public
setIntegrityStatus(array $redirect) : void
Parameters
- $redirect : array
updateShadowedIntegrityStatus()
Updates the shadowed integrity status of all redirects of the given source hosts.
public
updateShadowedIntegrityStatus(string[] $sourceHosts) : array<int, array>
Parameters
- $sourceHosts : string[]
Return values
array<int, array> —The shadowed redirects