Download the PHP package starcitizentools/apiunto without Composer

On this page you can find all versions of the php package starcitizentools/apiunto. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package apiunto

Apiunto

Apiunto lets MediaWiki templates pull live data from REST APIs. Configure an API source once in LocalSettings.php, then fetch from it in Lua with mw.ext.Apiunto.fetch(). Responses are cached automatically, so repeated lookups don't re-hit the upstream API.

CI

Requirements

Installation

Clone or download this repository into your extensions/ directory, then load it in LocalSettings.php:

Usage

Lua

fetch( source, uri, args ) takes:

Configurations

Variable Default Description
$wgApiuntoSources [] An array of API sources. Each source accepts baseUrl, and optional token, timeout (seconds, default 5), cacheDuration (seconds, default 86400), and followRedirects (default false).
$wgApiuntoEnableCache true Whether to cache API responses.

Editors can request any path on a source's host with its token attached, so only configure a token whose access every editor may have.

Following redirects

By default a 3xx is not followed and the fetch fails, so Lua gets the usual error string rather than a redirect page masquerading as data. Set followRedirects => true on a source whose API exposes a resolver endpoint — one that answers /search/{id} with a 302 to the canonical record URL — so fetch() returns the resolved record in a single call.

Each hop is issued as its own request, capped at 3. MediaWiki's built-in followRedirects option is deliberately not used: GuzzleHttpRequest streams every hop into one MWCallbackStream sink and Guzzle's redirect middleware reuses that sink for the follow-up request, so getContent() would return the intermediate redirect page concatenated in front of the real payload.

Redirects are only followed to the same scheme, host and port as the source's baseUrl; anything else fails the fetch. Responses are cached under the requested URL, not the resolved one.

Caching

Each response is cached for its source's cacheDuration. Purging a page (action=purge) clears the Apiunto responses cached for it, and a page's information page (action=info) shows the current cache status, URL, and time remaining.

A failed fetch is never cached, so an upstream blip costs one request rather than a cacheDuration of errors. When a fetch fails and a previous response is still held in the cache, that stale response is served instead of an error — and is deliberately not written back, so the next request retries upstream rather than extending the stale window by another full cacheDuration.

To purge the entire cache from the command line:

Add --dry-run to preview what would be purged without deleting anything.


All versions of apiunto with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
composer/installers Version >=1.0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package starcitizentools/apiunto contains the following files

Loading the files please wait ...