Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. InstallCommand.php

function 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
Executes the current command.

File

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

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) {
        return FALSE;
    }
    return !empty(Database::getConnectionInfo());
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal