interface PackageRepositoryInterface (View source)

Methods

RemotePackage|null
getPackage(ConnectionInterface $connection, string $packageId)

Load a package by its remote ID

array
getPackages(ConnectionInterface $connection, bool $latestOnly = false, bool $compatibleOnly = false)

Get a list of remote packages that are available for this connection

void
download(ConnectionInterface $connection, RemotePackage $package, bool $overwrite = false)

Download a remote package and make it available for install

ConnectionInterface|null
getConnection()

Get the existing connection if one is set

connect()

Attempt to connect to the package repository

void
registerUrl(ConnectionInterface $connection)

Registers a new canonical URL with an existing marketplace connection.

validate(ConnectionInterface $connection, bool $returnFullObject = false)

Determine if a given connection is valid for the current site

void
update(ConnectionInterface $connection, array $updatedFields)

Sends one or more updated fields to the marketplace backend for optional stage in the remote site object.

Details

RemotePackage|null getPackage(ConnectionInterface $connection, string $packageId)

Load a package by its remote ID

Parameters

ConnectionInterface $connection
string $packageId

Return Value

RemotePackage|null

array getPackages(ConnectionInterface $connection, bool $latestOnly = false, bool $compatibleOnly = false)

Get a list of remote packages that are available for this connection

Parameters

ConnectionInterface $connection
bool $latestOnly

Only show the latest version of each package

bool $compatibleOnly

Only show package versions that are compatible with the current concrete version

Return Value

array

void download(ConnectionInterface $connection, RemotePackage $package, bool $overwrite = false)

Download a remote package and make it available for install

Parameters

ConnectionInterface $connection
RemotePackage $package
bool $overwrite

Return Value

void

Exceptions

PackageAlreadyExistsException
UnableToPlacePackageException
InvalidPackageException

ConnectionInterface|null getConnection()

Get the existing connection if one is set

Return Value

ConnectionInterface|null

ConnectionInterface connect()

Attempt to connect to the package repository

void registerUrl(ConnectionInterface $connection)

Registers a new canonical URL with an existing marketplace connection.

Parameters

ConnectionInterface $connection

Return Value

void

bool|ValidateResult validate(ConnectionInterface $connection, bool $returnFullObject = false)

Determine if a given connection is valid for the current site

Parameters

ConnectionInterface $connection
bool $returnFullObject

Return Value

bool|ValidateResult

void update(ConnectionInterface $connection, array $updatedFields)

Sends one or more updated fields to the marketplace backend for optional stage in the remote site object.

Parameters

ConnectionInterface $connection
array $updatedFields

Return Value

void