Browse Source

Fix installer

jmontoyaa 7 years ago
parent
commit
e22b9b3f87

+ 1 - 2
src/Chamilo/CoreBundle/Entity/Repository/CourseRepository.php

@@ -9,8 +9,7 @@ use Doctrine\ORM\EntityRepository;
 use Doctrine\ORM\Query\Expr\Join;
 use Doctrine\ORM\QueryBuilder;
 use Sylius\Component\Resource\Repository\RepositoryInterface;
-use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
-
+//use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
 
 /**
  * Class CourseRepository

+ 11 - 10
src/Chamilo/InstallerBundle/EventListener/RequestListener.php

@@ -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();

+ 1 - 3
src/Chamilo/InstallerBundle/Process/InstallScenario.php

@@ -5,15 +5,13 @@ namespace Chamilo\InstallerBundle\Process;
 
 use Sylius\Bundle\FlowBundle\Process\Builder\ProcessBuilderInterface;
 use Sylius\Bundle\FlowBundle\Process\Scenario\ProcessScenarioInterface;
-use Symfony\Component\DependencyInjection\ContainerAware;
-use Symfony\Component\DependencyInjection\ContainerAwareInterface;
 use Symfony\Component\DependencyInjection\ContainerAwareTrait;
 
 /**
  * Class InstallScenario
  * @package Chamilo\InstallerBundle\Process
  */
-class InstallScenario implements ProcessScenarioInterface, ContainerAwareInterface
+class InstallScenario implements ProcessScenarioInterface
 {
     use ContainerAwareTrait;
 

+ 4 - 2
src/Chamilo/InstallerBundle/Process/Step/SetupStep.php

@@ -62,8 +62,10 @@ class SetupStep extends AbstractStep
     public function forwardAction(ProcessContextInterface $context)
     {
         /** @var UserManager $userManager */
-        $userManager = $this->get('sonata.user.orm.user_manager');
-        $adminUser = $userManager->findUserByUsername(LoadAdminUserData::DEFAULT_ADMIN_USERNAME);
+        $userManager = $this->get('sonata.user.user_manager');
+        $adminUser = $userManager->findUserByUsername(
+            LoadAdminUserData::DEFAULT_ADMIN_USERNAME
+        );
 
         if (!$adminUser) {
             throw new \RuntimeException(

+ 2 - 3
src/Chamilo/InstallerBundle/Process/UpgradeScenario.php

@@ -5,17 +5,16 @@ namespace Chamilo\InstallerBundle\Process;
 
 use Sylius\Bundle\FlowBundle\Process\Builder\ProcessBuilderInterface;
 use Sylius\Bundle\FlowBundle\Process\Scenario\ProcessScenarioInterface;
-use Symfony\Component\DependencyInjection\ContainerAware;
-use Symfony\Component\DependencyInjection\ContainerAwareInterface;
 use Symfony\Component\DependencyInjection\ContainerAwareTrait;
 
 /**
  * Class UpgradeScenario
  * @package Chamilo\InstallerBundle\Process
  */
-class UpgradeScenario implements ProcessScenarioInterface, ContainerAwareInterface
+class UpgradeScenario implements ProcessScenarioInterface
 {
     use ContainerAwareTrait;
+
     /**
      * {@inheritdoc}
      */