Download the PHP package bigz/halapi without Composer

On this page you can find all versions of the php package bigz/halapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package halapi

Hypertext Application Language for (REpresentational State Transfer) Application Programming Interfaces

Build
Status Test Coverage SensioLabsInsight Scrutinizer Quality
Score Code Climate

Given some conventions, displaying the HAL representation of any entity becomes very easy.

HAL is a json presentation format of the HATEOAS constraint, which is meant to add relations between objects.

It's whole specification is available here http://stateless.co/hal_specification.html

The work is in progress to make it framework agnostic but actually relies on you using symfony/http-foundation, which will change in a close future to use psr6 (while providing a bridge) For the object manager, you are free to choose the one you like, although only doctrine orm has been implemented at the mement. Relation findings relies also a lot on doctrine's ClassMetadata interface, that we should maybe abstract (you can still use your own implementaion)

Usage

composer req bigz/halapi

Symfony bundle

https://github.com/BigZ/HalapiBundle

Full fledged example using symfony (a good starting point for your api)

https://github.com/BigZ/promote-api

Example

Resources

List

Pagination

A list will give you a paginated ressource, HAL formatted.

/entities?limit=2&page=2

Filtering

You can filter out results on specific fields.

/entities?filter[id]=5&filteroperator[id]=>

Available operators are >, <, >=, <=, =, != Default operator is =

Sorting

You can sort the result by any property

/entities?sort=-created,title

Entity

Creating new entities

POST /entities

{ "entity": { "name": "eminem", "slug": "eminem", "bio": "rapper from detroit", "labels": [1, 2] } }

will return

{ "id": 2, "name": "eminem", "slug": "eminem", "bio": "rapper from detroit", "_links": { "self": "/artists/2", "labels": [ "/labels/1", "/labels/2" ] } }

PUT & PATCH works the same way

Embedding

By default, relations are not embeded. You can change this behaviour by specifiying wich embedeed entities you need. /entities/1?embed[]=gigs&embed[]=labels

To allow an relation to be embedded, you must add an @Embeddable Annotation to your entity property.

Roadmap to production readyness


All versions of halapi with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
doctrine/common Version ~2.0
doctrine/annotations Version ~1.0
jms/serializer Version ^1.0
symfony/options-resolver Version ^4.0
psr/http-message Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bigz/halapi contains the following files

Loading the files please wait ....