Documentation

DrupalUtil
in package

Table of Contents

Methods

get_database_configuration()  : array<string|int, string>
Attempt to use a 'civicrm' labelled database connection if one exists.
getDrupalSiteDir()  : string
guessSslParams()  : array<string|int, mixed>
Guess if the CMS is using SSL for MySQL and what the corresponding parameters should be for PEAR::DB.
isDrush()  : bool

Methods

get_database_configuration()

Attempt to use a 'civicrm' labelled database connection if one exists.

public static get_database_configuration() : array<string|int, string>

Otherwise default to using the same connection used by drupal. Also handle the special case where this is running as a test.

Return values
array<string|int, string>

An array of what database-config to use.

getDrupalSiteDir()

public static getDrupalSiteDir(mixed $cmsPath) : string
Parameters
$cmsPath : mixed
Return values
string

guessSslParams()

Guess if the CMS is using SSL for MySQL and what the corresponding parameters should be for PEAR::DB.

public static guessSslParams(array<string|int, mixed> $cmsDatabaseParams) : array<string|int, mixed>

Not all combinations will work. See the install docs for a list of known configurations that do. We don't enforce that here since we're just trying to guess a default based on what they already have.

Parameters
$cmsDatabaseParams : array<string|int, mixed>

The contents of the section from drupal's settings.php where it defines the $database array, usually under 'default'.

Return values
array<string|int, mixed>

The corresponding guessed params for PEAR::DB.

isDrush()

public static isDrush() : bool
Return values
bool

        
On this page

Search results