Sources
A source is where apps come from. appstore.ini [Sources] SourceList[] lists them; each [Source_<id>] block
names its Type, and [SourceTypes] Types[<type>] the class.
| Type | Class | What it reads |
|---|---|---|
packagist | expAppStorePackagistSource | Packagist.org (or a server with its API): packages/list.json?vendor= and search.json for the catalogue of Vendors[], search.json for search, packages/<name>.json for an app, repo.packagist.org/p2/<name>.json for the newest release |
composer | expAppStoreComposerRepositorySource | any Composer repository: packages.json with the packages inline (Satis) or available-packages plus metadata-url (Composer v2: Private Packagist, Repman, the packages.exponential.earth registry), with a bearer token from the secret store |
Release notes come from the GitHub releases of a repository on github.com (expAppStoreGitHub).
The shape of an answer
Every source answers with the same arrays, so the pages never know where an app came from (see the class comment
of expAppStoreSource): an app summary (name, title, description, type, repository, url, downloads, favers,
category, latest ...) and an app detail (the summary plus versions, license, authors, stars, PHP requirement,
installer name ...).
Adding a source type
class mySourceGitLabGroup extends expAppStoreSource
{
public function catalogue( $refresh = false ) { /* summaries of the group's projects */ }
public function search( $query, $page = 1, $perPage = 24, $refresh = false, $type = '' ) { /* results, total, page, pages, error */ }
public function app( $name, $refresh = false ) { /* detail or null */ }
public function versions( $name, $refresh = false ) { /* version rows, for Updates */ }
}[SourceTypes]
Types[gitlab]=mySourceGitLabGroup
[Sources]
SourceList[]=gitlab-acme
[Source_gitlab-acme]
Type=gitlab
Name=ACME GitLab
URL=https://gitlab.example.com
TokenSecret=acme_gitlab_tokenFetch with expAppStoreHttp::json( $url, <kind>, $headers, $refresh ): https only, cached for [Cache] TTL[<kind>],
the older answer when the network fails, the offline snapshot in static mode. Build summaries with
$this->summary( array( ... ) ).
Planned sources
GitHub and GitLab accounts, other Packagist accounts, the packages.exponential.earth registry (a Composer v2
repository: the composer type already reads it), the 7x package store.