Check existence panels shen creating debugger
[MAILPOET-3420]
This commit is contained in:
@ -190,7 +190,11 @@ class API {
|
||||
throw new \Exception(__('HTTP request method not allowed.', 'mailpoet'));
|
||||
}
|
||||
|
||||
if (class_exists(Debugger::class)) {
|
||||
if (
|
||||
class_exists(Debugger::class)
|
||||
&& class_exists(DIPanel::class)
|
||||
&& class_exists(ApiPanel::class)
|
||||
) {
|
||||
ApiPanel::init($endpoint, $this->requestMethod, $this->requestData);
|
||||
DIPanel::init();
|
||||
}
|
||||
|
@ -64,7 +64,10 @@ class PageRenderer {
|
||||
'wp_segment_state' => $wpSegmentState,
|
||||
];
|
||||
try {
|
||||
if (class_exists(Debugger::class)) {
|
||||
if (
|
||||
class_exists(Debugger::class)
|
||||
&& class_exists(DIPanel::class)
|
||||
) {
|
||||
DIPanel::init();
|
||||
}
|
||||
echo $this->renderer->render($template, $data + $defaults);
|
||||
|
@ -6,6 +6,8 @@ use MailPoet\Doctrine\EventListeners\EmojiEncodingListener;
|
||||
use MailPoet\Doctrine\EventListeners\LastSubscribedAtListener;
|
||||
use MailPoet\Doctrine\EventListeners\TimestampListener;
|
||||
use MailPoet\Doctrine\EventListeners\ValidationListener;
|
||||
use MailPoet\Tracy\ApiPanel\ApiPanel;
|
||||
use MailPoet\Tracy\DIPanel\DIPanel;
|
||||
use MailPoet\Tracy\DoctrinePanel\DoctrinePanel;
|
||||
use MailPoetVendor\Doctrine\DBAL\Connection;
|
||||
use MailPoetVendor\Doctrine\ORM\Configuration;
|
||||
@ -49,10 +51,13 @@ class EntityManagerFactory {
|
||||
$this->lastSubscribedAtListener = $lastSubscribedAtListener;
|
||||
}
|
||||
|
||||
public function createEntityManager() {
|
||||
public function createEntityManager(): EntityManager {
|
||||
$entityManager = EntityManager::create($this->connection, $this->configuration);
|
||||
$this->setupListeners($entityManager);
|
||||
if (class_exists(Debugger::class)) {
|
||||
if (
|
||||
class_exists(Debugger::class)
|
||||
&& class_exists(DoctrinePanel::class)
|
||||
) {
|
||||
DoctrinePanel::init($entityManager);
|
||||
}
|
||||
return $entityManager;
|
||||
|
Reference in New Issue
Block a user