2017 © Pedro Peláez
 

library php-rest-lightly

a lightweight component for implementing a REST API

image

evalok/php-rest-lightly

a lightweight component for implementing a REST API

  • Wednesday, March 16, 2016
  • by EvaLok
  • Repository
  • 1 Watchers
  • 0 Stars
  • 77 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

php-rest-lightly

a lightweight component for implementing a REST API, (*1)

this library helps you to leverage namespacing to implicitly define API endpoint routes rather than write them by hand; adding new endpoints wont require you to update a routes list, (*2)

authentication or other operations can be done within the endpoint classes themselves, (*3)

installation instructions

composer require evalok/php-rest-lightly, (*4)

example usage: https://github.com/EvaLok/php-rest-lightly/blob/master/demo/public/index.php, (*5)

demo

configure .htaccess in demo/public, (*6)

Examples

  • GET: api/v1/Thing1/555
{
    id: 555,
    owner: {
        *owner: null
    },
    class: "api\v1\Thing1",
    method: "api\v1\Thing1::get",
    message: "testing testing 123",
    params: [ ]
}
  • GET: api/v1/Thing1/555/Thing2/777?some=thing
{
    id: 777,
    owner: {
        *id: 555,
        *owner: { }
    },
    class: "api\v1\Thing1\Thing2",
    method: "api\v1\Thing1\Thing2::get",
    message: "testing testing 123",
    params: {
        some: "thing"
    }
}
  • api/v1/Restricted/Thing3/888
"403: Forbidden"

TODO

  • tests
  • versioning deprecation demo
  • non-json responses
  • support for request headers

The Versions

16/03 2016

dev-master

9999999-dev https://github.com/EvaLok/php-rest-lightly

a lightweight component for implementing a REST API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rest

16/03 2016

0.1.2

0.1.2.0 https://github.com/EvaLok/php-rest-lightly

a lightweight component for implementing a REST API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rest

15/02 2016

0.1.1

0.1.1.0 https://github.com/EvaLok/php-rest-lightly

a lightweight component for implementing a REST API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rest

30/09 2015

dev-tests

dev-tests https://github.com/EvaLok/php-rest-lightly

a lightweight component for implementing a REST API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

rest

25/07 2015

0.1.0

0.1.0.0 https://github.com/EvaLok/php-rest-lightly

a lightweight component for implementing a REST API

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

rest