class ExceptionDetectNeedsInstallSubscriber implements EventSubscriberInterface (View source)

Exception handler to determine if an exception indicates an uninstalled site.

Traits

Provides methods for checking if Drupal is already installed.

Properties

protected Connection $connection

The default database connection.

Methods

bool
isCli()

Returns whether the current PHP process runs on CLI.

bool
shouldRedirectToInstaller(Exception $exception, Connection $connection = NULL)

Determines if an exception handler should redirect to the installer.

__construct(Connection $connection)

Constructs a new ExceptionDetectNeedsInstallSubscriber.

onException(ExceptionEvent $event)

Handles errors for this subscriber.

static array
getSubscribedEvents()

Registers the methods in this class that should be listeners.

Details

protected bool isCli()

Returns whether the current PHP process runs on CLI.

Return Value

bool

protected bool shouldRedirectToInstaller(Exception $exception, Connection $connection = NULL)

Determines if an exception handler should redirect to the installer.

Parameters

Exception $exception

The exception to check.

Connection $connection

(optional) The default database connection. If not provided, a less comprehensive check will be performed. This can be the case if the exception occurs early enough that a database connection object isn't available from the container yet.

Return Value

bool

TRUE if the exception handler should redirect to the installer because Drupal is not installed yet, or FALSE otherwise.

__construct(Connection $connection)

Constructs a new ExceptionDetectNeedsInstallSubscriber.

Parameters

Connection $connection

The default database connection.

onException(ExceptionEvent $event)

Handles errors for this subscriber.

Parameters

ExceptionEvent $event

The event to process.

static array getSubscribedEvents()

Registers the methods in this class that should be listeners.

Return Value

array

An array of event listener definitions.