function InstallCommand::isDrupalInstalled

Same name in other branches
  1. 9 core/lib/Drupal/Core/Command/InstallCommand.php \Drupal\Core\Command\InstallCommand::isDrupalInstalled()
  2. 8.9.x core/lib/Drupal/Core/Command/InstallCommand.php \Drupal\Core\Command\InstallCommand::isDrupalInstalled()
  3. 11.x core/lib/Drupal/Core/Command/InstallCommand.php \Drupal\Core\Command\InstallCommand::isDrupalInstalled()

Returns whether there is already an existing Drupal installation.

Return value

bool

1 call to InstallCommand::isDrupalInstalled()
InstallCommand::execute in core/lib/Drupal/Core/Command/InstallCommand.php

File

core/lib/Drupal/Core/Command/InstallCommand.php, line 126

Class

InstallCommand
Installs a Drupal site for local testing/development.

Namespace

Drupal\Core\Command

Code

protected function isDrupalInstalled() {
    try {
        $kernel = new DrupalKernel('prod', $this->classLoader, FALSE);
        $kernel::bootEnvironment();
        $kernel->setSitePath($this->getSitePath());
        Settings::initialize($kernel->getAppRoot(), $kernel->getSitePath(), $this->classLoader);
        $kernel->boot();
    } catch (ConnectionNotDefinedException $e) {
        return FALSE;
    }
    return !empty(Database::getConnectionInfo());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.