/**
  * 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->getConfig()->get('application.disable.modules');
         $this->getCommandDiscoveryHelper()->setDisabledModules($disabledModules);
         $commands = $this->getCommandDiscoveryHelper()->getCommands();
     } else {
         $commands = $this->getCommandDiscoveryHelper()->getConsoleCommands();
         $this->errorMessage = $this->trans('application.site.errors.settings');
     }
     $this->registerCommands($commands);
 }