This document explains how you upgrade from one version to another.
- We do not longer require
php-http/message
. You have to make sure to put that in your own composer.json.
- Using
php-http/discovery:1.0
- Code style changes.
- Using
php-http/discovery:0.9
which makes Puli optional - Using new URL's to LinkedIn API so users are provided with the new authentication UX. (Thanks to @mbarwick83)
- Introduced PHP-HTTP and PSR-7 messages
- Added constructor argument for responseDataType
- Added setResponseDataType()
- Moved authentication functions to
Authenticator
class
To make sure you can upgrade you need to install a HTTP adapter.
php composer.phar require php-http/guzzle6-adapter
- Removed
LinkedIn::setRequest
in favor ofLinkedIn::setHttpAdapter
- Removed
LinkedIn::getAppSecret
andLinkedIn::getAppId
- Removed
LinkedIn::getUser
- Removed
LinkedInApiException
in favor ofLinkedInException
,InvalidArgumentException
andLinkedInTransferException
- Removed
LinkedIn::getLastHeaders
in favor ofLinkedIn::getLastResponse
- Made the public functions
LinkedIn::getResponseDataType
andLinkedIn::getFormat
protected
- When exchanging the code for an access token we are now using the post body instead of query parameters
- Better error handling when exchange from code to access token fails
There are a few minor BC breaks. We removed the functions below:
LinkedIn::getUserId
, useLinkedIn::getUser
insteadAccessToken::constructFromJson
, Use the constructor instead.
The signature of LinkedIn::api
has changed to be more easy to work with.
// Version 0.4
public function api($resource, array $urlParams=array(), $method='GET', $postParams=array())
// Version 0.5
public function api($method, $resource, array $options=array())
This means that you have to modify your calls to:
// Version 0.5
$options = array('query'=>$urlParams, 'body'=>$postParams);
$linkedIn->api('POST', $resource, $options)
See the Readme about more options to the API function.
We have removed the protected LinkedIn::init
function. That means if you were using IlluminateSessionStorage
you have
to make a minor adjustment to your code.
// Version 0.4
$linkedIn=new Happyr\LinkedIn\LinkedIn('app_id', 'app_secret');
// Version 0.5
$linkedIn=new Happyr\LinkedIn\LinkedIn('app_id', 'app_secret');
$linkedIn->setStorage(new IlluminateSessionStorage());
If you don't know about IlluminateSessionStorage
you are probably good ignoring this.
The default format when communicating with LinkedIn API is changed to json.
The RequestInterface::send
was updated with a new signature. We did also introduce RequestInterface::getHeadersFromLastResponse
.