Download the PHP package fourmation/rest-remote-object without Composer
On this page you can find all versions of the php package fourmation/rest-remote-object. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fourmation/rest-remote-object
More information about fourmation/rest-remote-object
Files in fourmation/rest-remote-object
Package rest-remote-object
Short Description This library provide a REST adapter for the Remote Object pattern implemented by the ProxyManager project.
License
Informations about the package rest-remote-object
Rest Remote Object
This library provide a REST adapter for the Remote Object pattern implemented by the ProxyManager project. A REST client is also provided to facilitate the REST interaction.
Installation
Rest remote objects examples
Some examples are provided in the examples/
directory : JIRA, ZenDesk, Xero, eWay, FlightStats and AgileZen !
Now, you can transform all REST API in remote objects !
Rest Adapter usages
A remote object proxy is an object that is located on a different system, but is used as if it was available locally.
To use the REST remote object, add two tags to yours services interfaces : @rest\http to define the HTTP method to use and @uri to define the resource URI :
That's all ! You are ready to use your REST API now :
Rest versioning
This project offer three way for the versioning :
- versioning included in a header (recommended)
- versioning included in URL
- versioning included in URL parameter
Rest authentication
Three authentication strategy are available :
- Query authentication (recommended)
- HTTP authentication
- simple token
You can easily use an authentication with your REST client :
Feature
To apply feature on your API request, just implement the FeatureInterface and use the addFeature
method. Example with the timestamp feature :
Custom response parser
Two response parser are provided : XML and JSON. The parser is selected automatically based on the response format.
You can write your own parser, just implements the RestRemoteObject\Client\Rest\ResponseHandler\Parser\ParserInterface
interface :
Use your parser like this :
Custom response builder
Two standards builder are provided : DefaultBuilder and GhostObjectBuilder.
The DefaultBuilder transform data (provide by the response parser) to an object. By default, the ClassMethods
hydrator
will use, so if you have defined your getter/setter, the object will be built easily.
The second builder is the GhostObjectBuilder which provide a proxy object (by setter/getter such as the DefaultBuilder) instead the real object, and allow remote call from uninitialized properties :
To have remote call, just define your annotations in your model :
All versions of rest-remote-object with dependencies
zendframework/zend-crypt Version >=2.2.0
zendframework/zend-filter Version >=2.2.0
zendframework/zend-http Version >=2.2.0
zendframework/zend-server Version >=2.2.0