abstract class Repository implements RepositoryInterface

Repository driver base class

Properties

protected string $repositoryUrl Repository url
protected string $packageName Package name
protected string|null $repositoryName Repo name
protected StorageInterface|null $storage Local storage
protected HttpClientInterface|null $httpClient Http client
protected string|null $repositoryDir Storage repository dir
protected string|null $accessKey Access key
protected string|null $tempDir Temp directory
protected string|null $installDir Package install dir

Methods

__construct(string $repositoryUrl, string|null $repositoryDir = null, string|null $installDir = null, StorageInterface|null $storage = null, HttpClientInterface|null $httpClient = null, string|null $accessKey = null)

Constructor

bool
install(string|null $version = null)

Install package

string
getLastVersionUrl()

Should return last version url

string
getDownloadUrl(string $version)

Should return download repo url

bool
download(string|null $version = null)

Download package

string|null
getLastVersion()

Get package last version

bool
isPrivate()

Return true if repo is private

string|null
getAccessKey()

Get access key for private repo

string
getRepositoryUrl()

Get repository url

string
getPackageFileName(string $version)

Get package file name

string
getPackageName()

Get package name

string
getRepositoryName()

Get repository name

string|false
extractRepository(string $version, string|null $targetDir = null)

Extract repositry zip file to storage/temp folder

void
resolvePackageName()

Resolve package name and repository name

Details

at line 95
__construct(string $repositoryUrl, string|null $repositoryDir = null, string|null $installDir = null, StorageInterface|null $storage = null, HttpClientInterface|null $httpClient = null, string|null $accessKey = null)

Constructor

Parameters

string $repositoryUrl
string|null $repositoryDir
string|null $installDir
StorageInterface|null $storage
HttpClientInterface|null $httpClient
string|null $accessKey

at line 120
abstract bool install(string|null $version = null)

Install package

Parameters

string|null $version

Return Value

bool

at line 127
abstract string getLastVersionUrl()

Should return last version url

Return Value

string

at line 135
abstract string getDownloadUrl(string $version)

Should return download repo url

Parameters

string $version

Return Value

string

at line 143
abstract bool download(string|null $version = null)

Download package

Parameters

string|null $version

Return Value

bool

at line 150
abstract string|null getLastVersion()

Get package last version

Return Value

string|null

at line 157
abstract bool isPrivate()

Return true if repo is private

Return Value

bool

at line 164
string|null getAccessKey()

Get access key for private repo

Return Value

string|null

at line 174
string getRepositoryUrl()

Get repository url

Return Value

string

at line 185
string getPackageFileName(string $version)

Get package file name

Parameters

string $version

Return Value

string

at line 197
string getPackageName()

Get package name

Return Value

string

at line 207
string getRepositoryName()

Get repository name

Return Value

string

at line 219
protected string|false extractRepository(string $version, string|null $targetDir = null)

Extract repositry zip file to storage/temp folder

Parameters

string $version
string|null $targetDir

Return Value

string|false Return packge folder

at line 238
protected void resolvePackageName()

Resolve package name and repository name

Return Value

void