class CRM_Extension_Container_Basic implements CRM_Extension_Container_Interface

An extension container is a locally-accessible source tree which can be scanned for extensions.

Properties

string $baseDir
string $baseUrl
CRM_Utils_Cache_Interface|NULL $cache
string $cacheKey
array($key $relPaths
array($key $relUrls
protected array $filters

Methods

__construct(string $baseDir, string $baseUrl, CRM_Utils_Cache_Interface $cache = NULL, string $cacheKey = NULL)

No description

checkRequirements()

No description

getKeys()

No description

getPath(string $key)

No description

getResUrl(string $key)

No description

refresh()

No description

string
getBaseDir()

No description

string
getRelPath(string $key)

Determine the relative path of an extension directory.

array
getRelPaths()

Scan $basedir for a list of extension-keys

string
getRelUrl(string $key)

Determine the relative path of an extension directory.

array
getRelUrls()

Scan $basedir for a list of extension-keys

$this
addFilter(callable $callable)

Register a filter which determine whether a copy of an extension appears as available.

static array
convertPathsToUrls(string $dirSep, array $relPaths)

Convert a list of relative paths to relative URLs.

Details

at line 103
__construct(string $baseDir, string $baseUrl, CRM_Utils_Cache_Interface $cache = NULL, string $cacheKey = NULL)

Parameters

string $baseDir Local path to the container.
string $baseUrl Public URL of the container.
CRM_Utils_Cache_Interface $cache Cache in which to store extension metadata.
string $cacheKey Unique name for this container.

at line 115
checkRequirements()

at line 139
getKeys()

at line 146
getPath(string $key)

Parameters

string $key Fully-qualified extension name.

at line 153
getResUrl(string $key)

Parameters

string $key Fully-qualified extension name.

at line 170
refresh()

at line 180
string getBaseDir()

Return Value

string

at line 193
protected string getRelPath(string $key)

Determine the relative path of an extension directory.

Parameters

string $key Extension name.

Return Value

string

Exceptions

CRM_Extension_Exception_MissingException

at line 207
protected array getRelPaths()

Scan $basedir for a list of extension-keys

Return Value

array ($key => $relPath)

at line 255
protected string getRelUrl(string $key)

Determine the relative path of an extension directory.

Parameters

string $key Extension name.

Return Value

string

Exceptions

CRM_Extension_Exception_MissingException

at line 269
protected array getRelUrls()

Scan $basedir for a list of extension-keys

Return Value

array ($key => $relUrl)

at line 288
$this addFilter(callable $callable)

Register a filter which determine whether a copy of an extension appears as available.

Parameters

callable $callable function(CRM_Extension_Info $info): bool Each function returns TRUE if the extension should be visible.

Return Value

$this

at line 305
static array convertPathsToUrls(string $dirSep, array $relPaths)

Convert a list of relative paths to relative URLs.

Note: Treat as private. This is only public to facilitate testing.

Parameters

string $dirSep Directory separator ("/" or "\").
array $relPaths Array($key => $relPath).

Return Value

array Array($key => $relUrl).