register event listeners depending on the installed packages
This commit is contained in:
parent
e5b5d9ea14
commit
f61b0097f4
@ -89,9 +89,16 @@ final class MessengerTransportDoctrineSchemaSubscriber implements EventSubscribe
|
||||
|
||||
public function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
ToolEvents::postGenerateSchema,
|
||||
Events::onSchemaCreateTable,
|
||||
];
|
||||
$subscribedEvents = [];
|
||||
|
||||
if (class_exists(ToolEvents::class)) {
|
||||
$subscribedEvents[] = ToolEvents::postGenerateSchema;
|
||||
}
|
||||
|
||||
if (class_exists(Events::class)) {
|
||||
$subscribedEvents[] = Events::onSchemaCreateTable;
|
||||
}
|
||||
|
||||
return $subscribedEvents;
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,10 @@ final class PdoCacheAdapterDoctrineSchemaSubscriber implements EventSubscriber
|
||||
|
||||
public function getSubscribedEvents(): array
|
||||
{
|
||||
if (!class_exists(ToolEvents::class)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
ToolEvents::postGenerateSchema,
|
||||
];
|
||||
|
Reference in New Issue
Block a user