|
@@ -6,6 +6,7 @@ namespace Chamilo\InstallerBundle\EventListener;
|
|
|
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
|
|
use Symfony\Component\HttpKernel\HttpKernel;
|
|
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
|
|
+use Symfony\Component\Routing\Router;
|
|
|
use Symfony\Component\Routing\RouterInterface;
|
|
|
|
|
|
class RequestListener
|
|
@@ -30,7 +31,10 @@ class RequestListener
|
|
|
protected $debug;
|
|
|
|
|
|
/**
|
|
|
- * Constructor
|
|
|
+ * RequestListener constructor.
|
|
|
+ * @param RouterInterface $router
|
|
|
+ * @param $installed
|
|
|
+ * @param bool $debug
|
|
|
*/
|
|
|
public function __construct(
|
|
|
RouterInterface $router,
|
|
@@ -42,6 +46,9 @@ class RequestListener
|
|
|
$this->debug = $debug;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param GetResponseEvent $event
|
|
|
+ */
|
|
|
public function onRequest(GetResponseEvent $event)
|
|
|
{
|
|
|
if (HttpKernel::MASTER_REQUEST != $event->getRequestType()) {
|
|
@@ -86,16 +93,10 @@ class RequestListener
|
|
|
// allow open the installer even if the application is already installed
|
|
|
// this is required because we are clearing the cache on the last installation step
|
|
|
// and as the result the login page is appeared instead of the final installer page
|
|
|
- if ($event->getRequest()->attributes->get(
|
|
|
- 'scenarioAlias'
|
|
|
- ) === 'chamilo_installer' &&
|
|
|
+ if ($event->getRequest()->attributes->get('scenarioAlias') === 'chamilo_installer' &&
|
|
|
(
|
|
|
- $event->getRequest()->attributes->get(
|
|
|
- '_route'
|
|
|
- ) === 'sylius_flow_forward' ||
|
|
|
- $event->getRequest()->attributes->get(
|
|
|
- '_route'
|
|
|
- ) === 'sylius_flow_display'
|
|
|
+ $event->getRequest()->attributes->get('_route') === 'sylius_flow_forward' ||
|
|
|
+ $event->getRequest()->attributes->get('_route') === 'sylius_flow_display'
|
|
|
)
|
|
|
) {
|
|
|
$event->stopPropagation();
|