class CRM_Extension_Manager

The extension manager handles installing, disabling enabling, and uninstalling extensions.

Constants

STATUS_INSTALLED

The extension is fully installed and enabled.

STATUS_DISABLED

The extension config has been applied to database but deactivated.

STATUS_UNINSTALLED

The extension code is visible, but nothing has been applied to DB

STATUS_UNKNOWN

The extension code is not locally accessible

STATUS_INSTALLED_MISSING

The extension is fully installed and enabled

STATUS_DISABLED_MISSING

The extension is fully installed and enabled

Properties

CRM_Extension_Container_Interface $fullContainer
CRM_Extension_Container_Basic|FALSE $defaultContainer
CRM_Extension_Mapper $mapper
array $typeManagers
array $statuses

Methods

__construct( $fullContainer, CRM_Extension_Container_Basic|FALSE $defaultContainer, $mapper, $typeManagers)

No description

replace(string $tmpCodeDir)

Install or upgrade the code for an extension -- and perform any necessary database changes (eg replacing extension metadata).

install(array $keys)

Add records of the extension to the database -- and enable it

enable(array $keys)

Add records of the extension to the database -- and enable it

disable(array $keys)

Add records of the extension to the database -- and enable it

uninstall(array $keys)

Remove all database references to an extension.

string
getStatus($key)

Determine the status of an extension.

array
getStatuses()

Determine the status of all extensions.

refresh()

No description

createInfoFromDB($key)

Auto-generate a place-holder for a missing extension using info from database.

Details

at line 107
__construct( $fullContainer, CRM_Extension_Container_Basic|FALSE $defaultContainer, $mapper, $typeManagers)

Parameters

$fullContainer
CRM_Extension_Container_Basic|FALSE $defaultContainer
$mapper
$typeManagers

at line 124
replace(string $tmpCodeDir)

Install or upgrade the code for an extension -- and perform any necessary database changes (eg replacing extension metadata).

This only works if the extension is stored in the default container.

Parameters

string $tmpCodeDir Path to a local directory containing a copy of the new (inert) code.

Exceptions

CRM_Extension_Exception

at line 206
install(array $keys)

Add records of the extension to the database -- and enable it

Parameters

array $keys List of extension keys.

Exceptions

CRM_Extension_Exception

at line 278
enable(array $keys)

Add records of the extension to the database -- and enable it

Parameters

array $keys List of extension keys.

Exceptions

CRM_Extension_Exception

at line 289
disable(array $keys)

Add records of the extension to the database -- and enable it

Parameters

array $keys List of extension keys.

Exceptions

CRM_Extension_Exception

at line 337
uninstall(array $keys)

Remove all database references to an extension.

Add records of the extension to the database -- and enable it

Parameters

array $keys List of extension keys.

Exceptions

CRM_Extension_Exception

at line 386
string getStatus($key)

Determine the status of an extension.

Parameters

$key

Return Value

string constant (STATUS_INSTALLED, STATUS_DISABLED, STATUS_UNINSTALLED, STATUS_UNKNOWN)

at line 402
array getStatuses()

Determine the status of all extensions.

Return Value

array ($key => status_constant)

at line 434
refresh()

at line 559
CRM_Extension_Info|NULL createInfoFromDB($key)

Auto-generate a place-holder for a missing extension using info from database.

Parameters

$key

Return Value

CRM_Extension_Info|NULL