Documentation

CRM_Extension_Browser
in package

This class glues together the various parts of the extension system.

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

Constants

SINGLE_FILE_PATH  = '/single'
Relative path below remote repository URL for single extensions file.

Properties

$indexPath  : string
$repoUrl  : string
$_remotesDiscovered  : array<string|int, mixed>
$guzzleClient  : Client

Methods

__construct()  : mixed
checkRequirements()  : array<string|int, mixed>
Determine whether downloading is supported.
downloadError()  : mixed
A dummy function required for suppressing download errors.
getExtension()  : CRM_Extension_Info|null
Get a description of a particular extension.
getExtensions()  : array<string|int, CRM_Extension_Info>
Get a list of all available extensions.
getGuzzleClient()  : Client
getRepositoryUrl()  : string
isEnabled()  : bool
Determine whether the system policy allows downloading new extensions.
refresh()  : mixed
Refresh the cache of remotely-available extensions.
setGuzzleClient()  : mixed
_discoverRemote()  : array<string|int, CRM_Extension_Info>
getCacheKey()  : mixed
Returns a cache key based on the repository URL, which can be updated by admins in civicrm.settings.php or passed as a command-line option to cv.
grabCachedJson()  : string
Loads the extensions data from the cache file. If it is empty or doesn't exist, try fetching from remote instead.
grabRemoteJson()  : string
Connects to public server and grabs the list of publicly available extensions.

Constants

SINGLE_FILE_PATH

Relative path below remote repository URL for single extensions file.

public mixed SINGLE_FILE_PATH = '/single'

Properties

$_remotesDiscovered

protected array<string|int, mixed> $_remotesDiscovered

$guzzleClient

protected Client $guzzleClient

Methods

__construct()

public __construct(string $repoUrl, string $indexPath) : mixed
Parameters
$repoUrl : string

URL of the remote repository.

$indexPath : string

Relative path of the 'index' file within the repository.

checkRequirements()

Determine whether downloading is supported.

public checkRequirements() : array<string|int, mixed>
Return values
array<string|int, mixed>

List of error messages; empty if OK.

downloadError()

A dummy function required for suppressing download errors.

public static downloadError(mixed $errorNumber, mixed $errorString) : mixed
Parameters
$errorNumber : mixed
$errorString : mixed

getGuzzleClient()

public getGuzzleClient() : Client
Return values
Client

getRepositoryUrl()

public getRepositoryUrl() : string
Return values
string

isEnabled()

Determine whether the system policy allows downloading new extensions.

public isEnabled() : bool

This is reflection of policy and intent; it does not indicate whether the browser will actually work. For that, see checkRequirements().

Return values
bool

refresh()

Refresh the cache of remotely-available extensions.

public refresh() : mixed

setGuzzleClient()

public setGuzzleClient(Client $guzzleClient) : mixed
Parameters
$guzzleClient : Client

getCacheKey()

Returns a cache key based on the repository URL, which can be updated by admins in civicrm.settings.php or passed as a command-line option to cv.

private getCacheKey() : mixed

grabCachedJson()

Loads the extensions data from the cache file. If it is empty or doesn't exist, try fetching from remote instead.

private grabCachedJson() : string
Return values
string

grabRemoteJson()

Connects to public server and grabs the list of publicly available extensions.

private grabRemoteJson() : string
Tags
throws
CRM_Extension_Exception
Return values
string

        
On this page

Search results