Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
RegisterEntryPointPass example
new
AbstractArgument
(
)
,
new
AbstractArgument
(
)
,
new
AbstractArgument
(
)
,
null, // entry point,
]
)
;
$container
->
register
(
'custom_authenticator', CustomAuthenticator::
class
)
->
setAbstract
(
true
)
;
$container
->
setDefinition
(
'security.authenticator.custom_authenticator.main',
new
ChildDefinition
(
'custom_authenticator'
)
)
;
(
new
RegisterEntryPointPass
(
)
)
->
process
(
$container
)
;
$this
->
assertSame
(
'security.authenticator.custom_authenticator.main',
$config
->
getArgument
(
7
)
)
;
}
}
class
CustomAuthenticator
extends
AbstractAuthenticator
implements
AuthenticationEntryPointInterface
{
public
function
supports
(
Request
$request
)
: ?bool
{
return
false;
}
$extension
->
addUserProviderFactory
(
new
InMemoryFactory
(
)
)
;
$extension
->
addUserProviderFactory
(
new
LdapFactory
(
)
)
;
$container
->
addCompilerPass
(
new
AddExpressionLanguageProvidersPass
(
)
)
;
$container
->
addCompilerPass
(
new
AddSecurityVotersPass
(
)
)
;
$container
->
addCompilerPass
(
new
AddSessionDomainConstraintPass
(
)
, PassConfig::TYPE_BEFORE_REMOVING
)
;
$container
->
addCompilerPass
(
new
CleanRememberMeVerifierPass
(
)
)
;
$container
->
addCompilerPass
(
new
RegisterCsrfFeaturesPass
(
)
)
;
$container
->
addCompilerPass
(
new
RegisterTokenUsageTrackingPass
(
)
, PassConfig::TYPE_BEFORE_OPTIMIZATION, 200
)
;
$container
->
addCompilerPass
(
new
RegisterLdapLocatorPass
(
)
)
;
$container
->
addCompilerPass
(
new
RegisterEntryPointPass
(
)
)
;
// must be registered after RegisterListenersPass (in the FrameworkBundle)
$container
->
addCompilerPass
(
new
RegisterGlobalSecurityEventListenersPass
(
)
, PassConfig::TYPE_BEFORE_REMOVING, -200
)
;
// execute after ResolveChildDefinitionsPass optimization pass, to ensure class names are set
$container
->
addCompilerPass
(
new
SortFirewallListenersPass
(
)
, PassConfig::TYPE_BEFORE_REMOVING
)
;
$container
->
addCompilerPass
(
new
ReplaceDecoratedRememberMeHandlerPass
(
)
, PassConfig::TYPE_OPTIMIZE
)
;
$container
->
addCompilerPass
(
new
AddEventAliasesPass
(
array_merge
(
AuthenticationEvents::ALIASES,
SecurityEvents::ALIASES
)
)
)
;