0.5.0
Pre-release-
CAUTION: This release drops support for PHP 5.3 due to the introduced dependency on
php-http/httplug
(see below). -
The client now depends on the HTTPlug library to perform HTTP requests. This means that the package now depends the virtual
php-http/client-implementation
. To satisfy this dependency you have to pick an implementation and install it together withphp-xapi/client
.For example, if you prefer to use Guzzle 6 you would do the following:
$ composer require --no-update php-http/guzzle6-adapter $ composer require php-xapi/client
-
The
setHttpClient()
andsetRequestFactory()
method have been added to theXApiClientBuilderInterface
and must be used to configure theHttpClient
andRequestFactory
instances you intend to use.To use Guzzle 6, for example, this will look like this:
use Http\Adapter\Guzzle6\Client; use Http\Message\MessageFactory\GuzzleMessageFactory; use Xabbuh\XApi\Client\XApiClientBuilder; $builder = new XApiClientBuilder(); $client = $builder->setHttpClient(new Client()) ->setRequestFactory(new GuzzleMessageFactory()) ->setBaseUrl('http://example.com/xapi/') ->build();
You can avoid calling
setHttpClient()
andsetRequestFactory
by installing the HTTP discovery package. -
The
xabbuh/oauth1-authentication
package now must be installed if you want to use OAuth1 authentication. -
Bumped the required versions of all
php-xapi
packages to the1.x
release series. -
Include the raw attachment content wrapped in a
multipart/mixed
encoded request when raw content is part of a statement's attachment. -
Added the possibility to decide whether or not to include attachments when requesting statements from an LRS. A second optional
$attachments
argument (defaulting totrue
) has been added for this purpose to thegetStatement()
,getVoidedStatement()
, andgetStatements()
methods of theStatementsApiClient
class and theStatementsApiClientInterface
. -
An optional fifth
$headers
parameter has been added to thecreateRequest()
method of theHandlerInterface
and theHandler
class which allows to pass custom headers when performing HTTP requests.