trait InstallerRedirectTrait (View source)

Provides methods for checking if Drupal is already installed.

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.

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.