Symfony\Component\HttpKernel\Exception\HttpException {#1438 -statusCode: 500 -headers: [] }
self::respond($event->getResponse());
}
// rimanda in loop con i nuovi valori
$this->dispatch($dispatcher);
}
throw new HttpException(500, 'Failed ErrorController handling', $th);
}
throw new HttpException(500, "Dispatch ended without handling");
}
/**
$event = $dispatcher->dispatch($this->error, ErrorEvent::NAME);
if ($event->getResponse() instanceof ResponseInterface) {
self::respond($event->getResponse());
}
// rimanda in loop con i nuovi valori
$this->dispatch($dispatcher);
}
throw new HttpException(500, 'Failed ErrorController handling', $th);
}
throw new HttpException(500, "Dispatch ended without handling");
}
# carico i plugins nel dispatcher
# -------------------------------
$plugins = $yaml_loader->fetchConfig('plugins');
$this->addDispatchSubscribers($event->getDispatcher(), $plugins);
$this->dispatch($event->getDispatcher());
}
/**
* Dispatch the HTTP request to a controller/action.
*/
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
$projectDir = realpath(dirname(__FILE__) . '/..');
$dispatcher = new EventDispatcher();
$dispatcher->addSubscriber(new FrontPlugin($projectDir));
$dispatcher->dispatch(new StartEvent($dispatcher), StartEvent::NAME);
$this->cleanBuffer($obLevel);
throw $th;
} catch (Throwable $th) {
$this->cleanBuffer($obLevel);
throw new HttpException(500, "Error is not an HttpException", $th);
}
}
/**
* Se vi dovesse essere un errore questo metodo pulisce il buffer.
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
// effettuo il dispatch degli eventi sui plugin caricati
switch (true) {
case ($event = $dispatcher->dispatch(new DomainEvent($dispatcher), DomainEvent::NAME)) && ($event->getResponse() instanceof ResponseInterface):
/** @var \Vimar\Core\Event\DomainEvent $event */
case ($event = $dispatcher->dispatch(new ActionEvent($dispatcher), ActionEvent::NAME)) && ($event->getResponse() instanceof ResponseInterface):
/** @var \Vimar\Core\Event\ActionEvent $event */
// fase finale, invio della risposta al client
self::respond($event->getResponse());
}
$event = $dispatcher->dispatch($this->error, ErrorEvent::NAME);
if ($event->getResponse() instanceof ResponseInterface) {
self::respond($event->getResponse());
}
// rimanda in loop con i nuovi valori
$this->dispatch($dispatcher);
}
throw new HttpException(500, 'Failed ErrorController handling', $th);
}
throw new HttpException(500, "Dispatch ended without handling");
}
# carico i plugins nel dispatcher
# -------------------------------
$plugins = $yaml_loader->fetchConfig('plugins');
$this->addDispatchSubscribers($event->getDispatcher(), $plugins);
$this->dispatch($event->getDispatcher());
}
/**
* Dispatch the HTTP request to a controller/action.
*/
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
$projectDir = realpath(dirname(__FILE__) . '/..');
$dispatcher = new EventDispatcher();
$dispatcher->addSubscriber(new FrontPlugin($projectDir));
$dispatcher->dispatch(new StartEvent($dispatcher), StartEvent::NAME);
throw new \Exception('Invalid menu to render!');
}
// proxy all'elenco degli indirizzi
if (array_key_exists($id, $this->hrefs)) {
return $this->hrefs[$id];
}
// chiave di memorizzazione su redis
$redisKey = \Vimar\Core\Shared\RedisKey::menuKey($this->request, $id);
if ($this->redis && $cache && $this->redis->exists($redisKey)) {
return '';
}
return '';
},
'nodeDecorator' => function($node) use (&$level, $type) {
$href = $this->menu_proxy->getUrl($node['id']);
$href = $this->text_format->apply($href, 'escapeHtmlAttr');
$text = $this->text_format->apply($node['label'], 'escapeHtml');
$target = preg_match("~^https?://~i", $href) ? '_blank' : null;
$rel = preg_match("~^https?://~i", $href) ? 'noreferrer' : null;
$hasChildren = !empty($node['__children']);
foreach ($tree as $node) {
if ($this->isVisible($node) === false) {
continue;
}
$output .= $options['childOpen']($node);
$output .= $options['nodeDecorator']($node);
if (count($node['__children']) > 0) {
$output .= $build($node['__children']);
}
$output .= $options['childClose']($node);
}
continue;
}
$output .= $options['childOpen']($node);
$output .= $options['nodeDecorator']($node);
if (count($node['__children']) > 0) {
$output .= $build($node['__children']);
}
$output .= $options['childClose']($node);
}
$output .= $options['rootClose']($tree);
}
}
$output .= $options['rootClose']($tree);
}
return $output;
};
return $build($this->nestedTree);
}
/**
* Per elaborare il nodo, almeno uno dei sotto nodi deve essere visibile.
* Se tutti i sottonodi sono nascosti e nessuno visibile, nascondo altrimenti mostro.
<a class="nav-link" href="<?php
echo $this->url(['module' => 'catalog', 'controller' => 'product'], 'route-lang-market', true);?>"><?php
echo $this->trans("Catalogo prodotti"); ?></a>
</li><?php
if (isset($main_menu)) :
echo $main_menu->render($main_menu::TYPE_MOBILE);
endif;
?></ul>
</nav>
</div>
</div>
/**
* Includes the view script in a scope with only public $this variables.
*/
protected function run()
{
include func_get_arg(0);
}
/**
* @return mixed
*/
// find the script file name using the parent private method
$this->file = $this->resolveToScript($name);
unset($name); // remove $name from local scope
ob_start();
$this->run($this->file);
return ob_get_clean();
}
/**
* Escape a string for the HTML Attribute context. We use an extended set of characters
}
public function render(string $name): string
{
if (isset($this->lazyObjectState)) {
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->render(...\func_get_args());
}
return parent::render(...\func_get_args());
}
// se non è ajax o non è nelle azioni ajax permesse e non è disabilitato il layout
default:
// inizializza il layout
$this->layout->enableLayout()->setRenderer(function() {
$scriptPath = $this->pathmap->resolveProjectDir('{projectDir}/templates');
return $this->view->setScriptPath($scriptPath)->render($this->config['template']);
});
// prepara il nodo da cui derivare il menu
$this->initRootMenu($this->config);
}
return $this;
* Poi renderizza il layout usando la view impostata.
*/
public function render(): string
{
if ($this->renderer !== null) {
return $this->renderer->__invoke();
}
throw new \BadFunctionCallException("Rendering callback not defined");
}
}
* Poi renderizza il layout usando la view impostata.
*/
public function render(): string
{
if ($this->renderer !== null) {
return $this->renderer->__invoke();
}
throw new \BadFunctionCallException("Rendering callback not defined");
}
}
$obStartLevel = ob_get_level();
// in caso di errore sul rendering del layout, passo davanti a tutte le eccezioni
// e segnalo un errore nel layout
try {
$content = $this->layout->render();
$body->seek(0);
$body->write($content);
// la risposta la ritorno in un secondo momento
} catch (Throwable $th) {
while (ob_get_level() > $obStartLevel) {
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
ob_start();
$dispatcher = $event->getDispatcher();
try {
// get output from plugins
$bufferEvent = $dispatcher->dispatch(new BufferEvent($event->getDispatcher()), BufferEvent::NAME);
$response = $bufferEvent->getResponse();
if ($response instanceof ResponseInterface) {
$event->setResponse($response);
}
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
// effettuo il dispatch degli eventi sui plugin caricati
switch (true) {
case ($event = $dispatcher->dispatch(new DomainEvent($dispatcher), DomainEvent::NAME)) && ($event->getResponse() instanceof ResponseInterface):
/** @var \Vimar\Core\Event\DomainEvent $event */
case ($event = $dispatcher->dispatch(new ActionEvent($dispatcher), ActionEvent::NAME)) && ($event->getResponse() instanceof ResponseInterface):
/** @var \Vimar\Core\Event\ActionEvent $event */
// fase finale, invio della risposta al client
self::respond($event->getResponse());
}
$event = $dispatcher->dispatch($this->error, ErrorEvent::NAME);
if ($event->getResponse() instanceof ResponseInterface) {
self::respond($event->getResponse());
}
// rimanda in loop con i nuovi valori
$this->dispatch($dispatcher);
}
throw new HttpException(500, 'Failed ErrorController handling', $th);
}
throw new HttpException(500, "Dispatch ended without handling");
}
# carico i plugins nel dispatcher
# -------------------------------
$plugins = $yaml_loader->fetchConfig('plugins');
$this->addDispatchSubscribers($event->getDispatcher(), $plugins);
$this->dispatch($event->getDispatcher());
}
/**
* Dispatch the HTTP request to a controller/action.
*/
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
$projectDir = realpath(dirname(__FILE__) . '/..');
$dispatcher = new EventDispatcher();
$dispatcher->addSubscriber(new FrontPlugin($projectDir));
$dispatcher->dispatch(new StartEvent($dispatcher), StartEvent::NAME);
[3/3]
HttpException
|
---|
Symfony\Component\HttpKernel\Exception\HttpException: Failed ErrorController handling at /var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/FrontPlugin.php:138 at Vimar\Core\Plugins\FrontPlugin->dispatch() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/FrontPlugin.php:136) at Vimar\Core\Plugins\FrontPlugin->dispatch() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/FrontPlugin.php:106) at Vimar\Core\Plugins\FrontPlugin->setupBaseServices() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:220) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:56) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/var/www/vhosts/vimarcom/webroot/public/index.php:14) |
[2/3]
HttpException
|
---|
Symfony\Component\HttpKernel\Exception\HttpException: Error is not an HttpException at /var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/BufferPlugin.php:53 at Vimar\Core\Plugins\BufferPlugin->startBuffering() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:220) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:56) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/FrontPlugin.php:120) at Vimar\Core\Plugins\FrontPlugin->dispatch() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/FrontPlugin.php:136) at Vimar\Core\Plugins\FrontPlugin->dispatch() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/FrontPlugin.php:106) at Vimar\Core\Plugins\FrontPlugin->setupBaseServices() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:220) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:56) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/var/www/vhosts/vimarcom/webroot/public/index.php:14) |
[1/3]
TypeError
|
---|
TypeError: Vimar\Menu\Proxy\MenuProxy::getUrl(): Return value must be of type string, bool returned at /var/www/vhosts/vimarcom/webroot/src/Vimar/Menu/Proxy/MenuProxy.php:56 at Vimar\Menu\Proxy\MenuProxy->getUrl() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Service/MainMenu.php:103) at Vimar\Core\Service\MainMenu->Vimar\Core\Service\{closure}() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Service/MainMenu.php:227) at Vimar\Core\Service\MainMenu->Vimar\Core\Service\{closure}() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Service/MainMenu.php:229) at Vimar\Core\Service\MainMenu->Vimar\Core\Service\{closure}() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Service/MainMenu.php:237) at Vimar\Core\Service\MainMenu->render() (/var/www/vhosts/vimarcom/webroot/templates/vimar.phtml:189) at include('/var/www/vhosts/vimarcom/webroot/templates/vimar.phtml') (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Component/View/View.php:65) at Vimar\Core\Component\View\View->run() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Component/View/View.php:191) at Vimar\Core\Component\View\View->render() (/var/www/vhosts/vimarcom/webroot/var/cache/containers/9d30cc3490e7d54f33c6300f97a2d032.php:1703) at ViewProxyD13a242->render() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Service/SiteLayout.php:101) at Vimar\Core\Service\SiteLayout->Vimar\Core\Service\{closure}() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Component/View/Layout.php:95) at Closure->__invoke() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Component/View/Layout.php:95) at Vimar\Core\Component\View\Layout->render() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/LayoutPlugin.php:50) at Vimar\Core\Plugins\LayoutPlugin->createLayoutResponse() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:220) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:56) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/BufferPlugin.php:40) at Vimar\Core\Plugins\BufferPlugin->startBuffering() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:220) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:56) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/FrontPlugin.php:120) at Vimar\Core\Plugins\FrontPlugin->dispatch() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/FrontPlugin.php:136) at Vimar\Core\Plugins\FrontPlugin->dispatch() (/var/www/vhosts/vimarcom/webroot/src/Vimar/Core/Plugins/FrontPlugin.php:106) at Vimar\Core\Plugins\FrontPlugin->setupBaseServices() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:220) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (/var/www/vhosts/vimarcom/webroot/vendor/symfony/event-dispatcher/EventDispatcher.php:56) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (/var/www/vhosts/vimarcom/webroot/public/index.php:14) |