final class PackageRepository implements PackageRepositoryInterface (View source)

Properties

private Client $client
private Serializer $serializer
private Repository $config
private Repository $databaseConfig
private Service $siteService
private string $baseUri
private array<string,string> $paths
private File $fileHelper

Methods

__construct(Client $client, Serializer $serializer, Repository $config, Repository $databaseConfig, Service $siteService, File $fileHelper, string $baseUri, array $paths)

No description

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

bool
rename(string $old, string $new)

No description

rimraf(string $handle)

No description

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)

No description

void
update(ConnectionInterface $connection, array $updatedFields)

No description

RequestInterface
authenticate(RequestInterface $request, ConnectionInterface $connection, string $algo = 'sha256')

No description

RequestInterface
requestFor(string $method, string $pathKey, ...$interpolate)

No description

string
getUrl(Site $site)

No description

RequestInterface
addQuery(RequestInterface $request)

No description

Details

__construct(Client $client, Serializer $serializer, Repository $config, Repository $databaseConfig, Service $siteService, File $fileHelper, string $baseUri, array $paths)

No description

Parameters

Client $client
Serializer $serializer
Repository $config
Repository $databaseConfig
Service $siteService
File $fileHelper
string $baseUri
array $paths

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

protected bool rename(string $old, string $new)

No description

Parameters

string $old
string $new

Return Value

bool

protected rimraf(string $handle)

No description

Parameters

string $handle

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)

No description

Parameters

ConnectionInterface $connection
bool $returnFullObject

Return Value

bool|ValidateResult

void update(ConnectionInterface $connection, array $updatedFields)

No description

Parameters

ConnectionInterface $connection
array $updatedFields

Return Value

void

protected RequestInterface authenticate(RequestInterface $request, ConnectionInterface $connection, string $algo = 'sha256')

No description

Parameters

RequestInterface $request
ConnectionInterface $connection
string $algo

Return Value

RequestInterface

protected RequestInterface requestFor(string $method, string $pathKey, ...$interpolate)

No description

Parameters

string $method
string $pathKey
...$interpolate

Return Value

RequestInterface

private string getUrl(Site $site)

No description

Parameters

Site $site

Return Value

string

protected RequestInterface addQuery(RequestInterface $request)

No description

Parameters

RequestInterface $request

Return Value

RequestInterface