class CRM_Core_InnoDBIndexer

The InnoDB indexer is responsible for creating and destroying full-text indices on InnoDB classes.

Constants

IDX_PREFIX

Properties

protected array $indices Indices.
protected bool $isActive

Methods

singleton(bool $fresh = FALSE)

No description

static 
onToggleFts(bool $oldValue, bool $newValue, array $metadata)

(Setting Callback) Respond to changes in the "enable_innodb_fts" setting

__construct(bool $isActive, array $indices)

Class constructor.

fixSchemaDifferences()

Fix schema differences.

bool
hasDeclaredIndex(string $table, array $fields)

Determine if an index is expected to exist.

array
findActualFtsIndexNames(string $table)

Get a list of FTS index names that are currently defined in the database.

array
buildIndexSql($table)

Generate a "CREATE INDEX" statement for each desired FTS index.

array
dropIndexSql(string $table)

Generate a "DROP INDEX" statement for each existing FTS index.

array
reconcileIndexSqls(string $table)

Construct a set of SQL statements which will create (or preserve) required indices and destroy unneeded indices.

array
normalizeIndices($indices)

Put the indices into a normalized format.

setActive(bool $isActive)

Setter for isActive.

bool
getActive()

Getter for isActive.

Details

at line 44
static CRM_Core_InnoDBIndexer singleton(bool $fresh = FALSE)

Parameters

bool $fresh

Return Value

CRM_Core_InnoDBIndexer

at line 93
static onToggleFts(bool $oldValue, bool $newValue, array $metadata)

(Setting Callback) Respond to changes in the "enable_innodb_fts" setting

Parameters

bool $oldValue
bool $newValue
array $metadata Specification of the setting (per *.settings.php).

at line 125
__construct(bool $isActive, array $indices)

Class constructor.

Parameters

bool $isActive
array $indices

at line 137
fixSchemaDifferences()

Fix schema differences.

Limitation: This won't pick up stale indices on tables which are not declared in $this->indices. That's not much of an issue for now b/c we have a static list of tables.

at line 154
bool hasDeclaredIndex(string $table, array $fields)

Determine if an index is expected to exist.

Parameters

string $table
array $fields List of field names that must be in the index.

Return Value

bool

at line 179
array findActualFtsIndexNames(string $table)

Get a list of FTS index names that are currently defined in the database.

Parameters

string $table

Return Value

array (string $indexName => string $indexName)

at line 212
array buildIndexSql($table)

Generate a "CREATE INDEX" statement for each desired FTS index.

Parameters

$table

Return Value

array (string $indexName => string $sql)

at line 232
array dropIndexSql(string $table)

Generate a "DROP INDEX" statement for each existing FTS index.

Parameters

string $table

Return Value

array (string $idxName => string $sql)

at line 249
array reconcileIndexSqls(string $table)

Construct a set of SQL statements which will create (or preserve) required indices and destroy unneeded indices.

Parameters

string $table

Return Value

array

at line 279
array normalizeIndices($indices)

Put the indices into a normalized format.

Parameters

$indices

Return Value

array

at line 295
setActive(bool $isActive)

Setter for isActive.

Parameters

bool $isActive

at line 304
bool getActive()

Getter for isActive.

Return Value

bool