PHPackages                             kartenmacherei/rest-framework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. kartenmacherei/rest-framework

ActiveLibrary[Framework](/categories/framework)

kartenmacherei/rest-framework
=============================

Micro framework for creating RESTful webservices

3.0.2(4mo ago)1337.6k1MITPHPPHP &gt;=7.1.0

Since Dec 22Pushed 4mo ago4 watchersCompare

[ Source](https://github.com/kartenmacherei/rest-framework)[ Packagist](https://packagist.org/packages/kartenmacherei/rest-framework)[ Docs](https://github.com/kartenmacherei/rest-framework)[ RSS](/packages/kartenmacherei-rest-framework/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (2)Versions (20)Used By (0)

RESTful Server Framework
========================

[](#restful-server-framework)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/177ac4509f3bbe83265cf5021650bbd77b2d3dd52a9c2bb9310083e13771a528/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b617274656e6d616368657265692f726573742d6672616d65776f726b2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kartenmacherei/rest-framework/?branch=master)[![Build Status](https://camo.githubusercontent.com/ada908844a7800651400de4b051fdd470b38e8c5c8e3a69d2809ede462634410/68747470733a2f2f7472617669732d63692e6f72672f6b617274656e6d616368657265692f726573742d6672616d65776f726b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kartenmacherei/rest-framework)[![SensioLabsInsight](https://camo.githubusercontent.com/c2f4645b01584024d94bf3214465d697e17bbd48306d06b32ab5599768868342/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f33656230373261302d306635382d346433392d613931642d3731363632616462646364372f6d696e692e706e67)](https://insight.sensiolabs.com/projects/3eb072a0-0f58-4d39-a91d-71662adbdcd7)

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.

Basic Concepts
--------------

[](#basic-concepts)

Components
----------

[](#components)

### RestResource

[](#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

[](#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

[](#command)

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

### Query

[](#query)

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

Using the Framework
-------------------

[](#using-the-framework)

### Requirements

[](#requirements)

- Composer
- PHP 7.0+

### Add the Framework to your composer.json:

[](#add-the-framework-to-your-composerjson)

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

```

### Connect your code to the Framework:

[](#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  for a working example.

License
-------

[](#license)

This software is licensed under the terms of the [MIT license](https://opensource.org/licenses/MIT). See LICENSE.md for the full license.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance77

Regular maintenance activity

Popularity33

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 77.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~207 days

Recently: every ~712 days

Total

17

Last Release

125d ago

Major Versions

1.0.0 → v2.0.x-dev2017-01-18

2.1.8 → 3.0.02018-07-27

PHP version history (2 changes)v1.0.x-devPHP &gt;=7.0.0

3.0.1PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/de029409051bcffc2c4efe9e5392f7d90a19bcf6582124ac2813b934743746f6?d=identicon)[belanur](/maintainers/belanur)

---

Top Contributors

[![sebastianheuer](https://avatars.githubusercontent.com/u/169095?v=4)](https://github.com/sebastianheuer "sebastianheuer (96 commits)")[![leedwilkins](https://avatars.githubusercontent.com/u/22746165?v=4)](https://github.com/leedwilkins "leedwilkins (19 commits)")[![Celebrate-Reinhard](https://avatars.githubusercontent.com/u/100134454?v=4)](https://github.com/Celebrate-Reinhard "Celebrate-Reinhard (3 commits)")[![Tesla91](https://avatars.githubusercontent.com/u/28245098?v=4)](https://github.com/Tesla91 "Tesla91 (2 commits)")[![zeka001](https://avatars.githubusercontent.com/u/12069332?v=4)](https://github.com/zeka001 "zeka001 (1 commits)")[![eniebuhr](https://avatars.githubusercontent.com/u/79643413?v=4)](https://github.com/eniebuhr "eniebuhr (1 commits)")[![mihailogajic](https://avatars.githubusercontent.com/u/38126985?v=4)](https://github.com/mihailogajic "mihailogajic (1 commits)")[![omarsh1996](https://avatars.githubusercontent.com/u/132360208?v=4)](https://github.com/omarsh1996 "omarsh1996 (1 commits)")

---

Tags

frameworkrestrestfulkartenmacherei

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kartenmacherei-rest-framework/health.svg)

```
[![Health](https://phpackages.com/badges/kartenmacherei-rest-framework/health.svg)](https://phpackages.com/packages/kartenmacherei-rest-framework)
```

###  Alternatives

[phprest/phprest

PHP Rest Framework.

3049.3k](/packages/phprest-phprest)[psx/psx

PHP REST API Framework

17112.6k3](/packages/psx-psx)[patricksavalle/slim-rest-api

Production-grade REST-API App-class for PHP SLIM, in production on https://zaplog.pro (https://api.zaplog.pro/v1)

101.4k](/packages/patricksavalle-slim-rest-api)[flame/tiny-rest

Smart implementation of REST for Nette

101.1k](/packages/flame-tiny-rest)[podcastcrawler/podcastcrawler

PHP library to find podcasts

402.7k1](/packages/podcastcrawler-podcastcrawler)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
