protected function InstallCommand::isDrupalInstalled in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Command/InstallCommand.php \Drupal\Core\Command\InstallCommand::isDrupalInstalled()
- 9 core/lib/Drupal/Core/Command/InstallCommand.php \Drupal\Core\Command\InstallCommand::isDrupalInstalled()
Returns whether there is already an existing Drupal installation.
Return value
bool
File
- core/
lib/ Drupal/ Core/ Command/ InstallCommand.php, line 97
Class
- InstallCommand
- Installs a Drupal site for local testing/development.
Namespace
Drupal\Core\CommandCode
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());
}