/**
  * @param DrupalHelper $drupal
  */
 public function bootDrupal(DrupalHelper $drupal)
 {
     $this->getKernelHelper()->setClassLoader($drupal->getAutoLoadClass());
     $drupal->setInstalled($this->getKernelHelper()->bootKernel());
 }
 /**
  * Prepare drupal.
  *
  * @param DrupalHelper $drupal
  */
 public function prepare(DrupalHelper $drupal)
 {
     chdir($drupal->getRoot());
     $this->getSite()->setSiteRoot($drupal->getRoot());
     if ($drupal->isValidInstance()) {
         $this->bootDrupal($drupal);
     }
     if ($drupal->isInstalled()) {
         $disabledModules = $this->config->get('application.disable.modules');
         $this->getCommandDiscoveryHelper()->setDisabledModules($disabledModules);
         $commands = $this->getCommandDiscoveryHelper()->getCommands();
     } else {
         $commands = $this->getCommandDiscoveryHelper()->getConsoleCommands();
         if (!$commandName) {
             $this->getMessageHelper()->addWarningMessage($this->trans('application.site.errors.settings'));
         }
     }
     $this->registerCommands($commands);
 }