2017 © Pedro Peláez
 

library rest-framework

Micro framework for creating RESTful webservices

image

kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  • Friday, July 27, 2018
  • by belanur
  • Repository
  • 2 Watchers
  • 13 Stars
  • 1,633 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 19 Versions
  • 16 % Grown

The README.md

RESTful Server Framework

Scrutinizer Code Quality Build Status SensioLabsInsight, (*1)

The goal of this framework is to enable us to quickly bootstrap new RESTful Services while sticking to our very strict coding guidelines. This especially means that any kind of magic should be avoided., (*2)

Basic Concepts

Components

RestResource

  • Provides a Pattern that can be matches against an URI
  • Supports HTTP verbs by implementing interfaces like SupportsGetRequests
  • Returns Action objects through explicit methods like getPostCommand() or getQuery()

ResourceRouter

  • Holds references to all RestResource objects it is responsible for
  • Determines if it is responsible for routing a given URL in canRoute()
  • Returns a RestResource in doRoute()

Command

  • Changes the state of a resource (like creating or updating)

Query

  • Does not change the state of a resource and only returns existing data.

Using the Framework

Requirements

  • Composer
  • PHP 7.0+

Add the Framework to your composer.json:

    "require": {
        "kartenmacherei/rest-framework": "dev-master"
    }

Connect your code to the Framework:

// create a request
$request = Request::fromSuperGlobals();

// create config object
// 'app-name' will be used as newrelic appname, if monitoring was enabled
// bool $enableMonitoring if true, framework will set newrelic transaction name based on mapping
// array $transactionMapping, class name to transaction name mapping array for each action. If action was not set, fallback is transaction_name_was_not_set
$config = new Config('app-name', $enableMonitoring, $transactionNamesMapping);

// create a new instance of the framework
$framework = Framework::createInstance($config);

// register a RestResource Router
$framework->registerResourceRouter(new BasketResourceRouter());

// let the framework process the request
$response = $framework->run($request);

// send the response to the client
$response->flush();

See https://github.com/kartenmacherei/rest-framework-example for a working example., (*3)

License

This software is licensed under the terms of the MIT license. See LICENSE.md for the full license., (*4)

The Versions

27/07 2018

dev-master

9999999-dev https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

27/07 2018

3.0.0

3.0.0.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

26/07 2018

dev-mihailogajic-sub-task/SHOP-586-new-relic

dev-mihailogajic-sub-task/SHOP-586-new-relic https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

23/07 2018

dev-mfix-parameter-order

dev-mfix-parameter-order https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

22/05 2018

2.1.8

2.1.8.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

26/03 2018

2.1.7

2.1.7.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

30/11 2017

2.1.6

2.1.6.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

30/11 2017

dev-add-service-unavailable-response

dev-add-service-unavailable-response https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

16/11 2017

2.1.5

2.1.5.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

08/11 2017

2.1.4

2.1.4.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

04/10 2017

2.1.3

2.1.3.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

21/06 2017

2.1.2

2.1.2.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

26/01 2017

v2.1.x-dev

2.1.9999999.9999999-dev https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

26/01 2017

2.1.1

2.1.1.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

19/01 2017

2.1.0

2.1.0.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

18/01 2017

v2.0.x-dev

2.0.9999999.9999999-dev https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

18/01 2017

2.0.0

2.0.0.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

22/12 2016

v1.0.x-dev

1.0.9999999.9999999-dev https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei

22/12 2016

1.0.0

1.0.0.0 https://github.com/kartenmacherei/rest-framework

Micro framework for creating RESTful webservices

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Sebastian Heuer
by Lee Wilkins
by Victor Sanchez

framework rest restful kartenmacherei