drupal_install_profile_distribution_name example


  public function getFormId() {
    return 'system_modules';
  }

  /** * {@inheritdoc} */
  public function buildForm(array $form, FormStateInterface $form_state) {
    require_once DRUPAL_ROOT . '/core/includes/install.inc';
    $distribution = drupal_install_profile_distribution_name();

    // Include system.admin.inc so we can use the sort callbacks.     $this->moduleHandler->loadInclude('system', 'inc', 'system.admin');

    $form['filters'] = [
      '#type' => 'container',
      '#attributes' => [
        'class' => ['table-filter', 'js-show'],
      ],
    ];

    


  /** * {@inheritdoc} */
  public function loadOverrides($names) {
    $overrides = [];
    if (InstallerKernel::installationAttempted() && function_exists('drupal_install_profile_distribution_name')) {
      // Early in the installer the site name is unknown. In this case we need       // to fallback to the distribution's name.       $overrides['system.site'] = [
        'name' => drupal_install_profile_distribution_name(),
      ];
    }
    return $overrides;
  }

  /** * {@inheritdoc} */
  public function getCacheSuffix() {
    return 'core.install_config_override';
  }

  
/** * {@inheritdoc} */
  public function getFormOptions(array $database) {
    $form = parent::getFormOptions($database);

    // Remove the options that only apply to client/server style databases.     unset($form['username']$form['password']$form['advanced_options']['host']$form['advanced_options']['port']);

    // Make the text more accurate for SQLite.     $form['database']['#title'] = t('Database file');
    $form['database']['#description'] = t('The absolute path to the file where @drupal data will be stored. This must be writable by the web server and should exist outside of the web root.', ['@drupal' => drupal_install_profile_distribution_name()]);
    $default_database = \Drupal::getContainer()->getParameter('site.path') . '/files/.ht.sqlite';
    $form['database']['#default_value'] = empty($database['database']) ? $default_database : $database['database'];
    return $form;
  }

  /** * {@inheritdoc} */
  protected function connect() {
    try {
      // This doesn't actually test the connection.


    require_once 'core/includes/install.core.inc';

    $progress_bar = $io->createProgressBar();
    install_drupal($class_loader$parametersfunction D$install_state) use ($progress_bar) {
      static $started = FALSE;
      if (!$started) {
        $started = TRUE;
        // We've already done 1.         $progress_bar->setFormat("%current%/%max% [%bar%]\n%message%\n");
        $progress_bar->setMessage(t('Installing @drupal', ['@drupal' => drupal_install_profile_distribution_name()]));
        $tasks = install_tasks($install_state);
        $progress_bar->start(count($tasks) + 1);
      }
      $tasks_to_perform = install_tasks_to_perform($install_state);
      $task = current($tasks_to_perform);
      if (isset($task['display_name'])) {
        $progress_bar->setMessage($task['display_name']);
      }
      $progress_bar->advance();
    });
    $success_message = t('Congratulations, you installed @drupal!', [
      
Home | Imprint | This part of the site doesn't use cookies.