In this document:
As explained in Version Management, APS PHP runtime comes in several versions. The latest version is the same
as the major part of the platform version.
The APS controller allows getting a list of versions
it supports via its /aps
endpoint.
Also, the APS controller sends the current APS version in the APS-Version
header of each request
to an APS application endpoint.
If the APS controller does not support the needed version, the application should fall back to the functionality of an older APS version.
PHP runtime offers a set of functions to get the list of APS versions supported by the APS controller and select a version to work with.
By default, PHP runtime uses the version received from the APS controller in the APS-Version
header.
Instead of /aps/2/...
URL path, it uses the /aps/<APS-Version>/...
for all requests.
For example, the APS controller sends the header APS-Version: 7.3.
Respectively, PHP runtime uses paths /aps/7.3/resources
, /aps/7.3/types
, etc.
The APS PHP runtime exposes the following functions to help applications monitor APS versions and, in rare cases, even require to use a certain APS version:
getSupportedApsVersions()
- to get a list of supported versions and respective functionality
by sending a request to /aps
.getApsVersion()
- to get the APS version the APS PHP runtime currently specifies in requests initiated by the applicationsetApsVersion('<version>')
- to require the APS PHP runtime to use the specified version in all requests
initiated by the applicationThe following example illustrates how an application can get the APS version that the PHP runtime currently uses:
$apsc = \APS\Request::getController();
$apsVersion = $apsc->getApsVersion();
Using the getSupportedApsVersions
function allows you to get more details about supported features and
thus create a flexible application, compatible with several versions of APS API / platform.