Download the PHP package phonedotcom/mason-php without Composer
On this page you can find all versions of the php package phonedotcom/mason-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phonedotcom/mason-php
More information about phonedotcom/mason-php
Files in phonedotcom/mason-php
Package mason-php
Short Description PHP library for generating Mason hypermedia documents
License MIT
Informations about the package mason-php
Mason PHP
This project provides a PHP tool for building Hypermedia REST API's in Mason format.
At present, it includes a set of Mason Builder classes for producing data structures that can be passed to json_encode()
for rendering Mason response bodies.
Example
Here is a simple example:
This produces the following data structure:
Motivation
Mason is a Hypermedia RESTful API format first published in 2013 by Jørn Wildt. It combines lessons learned from years of API implementations and close study of other competing formats such as Hal, Collection+JSON, and JSON-LD. Each format has its strengths, but none has the desired balance of simplicity and features.
Mason-PHP was built to help promote Mason adoption within the PHP community, and to provide much needed tooling.
Installation
This project is integrated with Composer. You can put it in your composer.json
as a dependency:
Usage
Documentation is forthcoming. All public methods are documented inline, so at the moment, the best way to learn is to browse the code.
Tests
Run phpunit
in the top folder. If you have the XDebug
extension installed, you may also run it with the Code Coverage config which is provided separately, e.g. phpunit -c phpunit-coverage-html.xml
Contributors
This project was created and is managed by Phone.com. We're building a hot new Hypermedia API and we chose Mason!
Pull requests are welcome.
License
This project is released under the MIT License. Copyright (c) 2015 Phone.com, Inc. See LICENSE
for full details.