Popularity
2.4
Growing
Activity
5.6
-
113
5
4

Description

A based PSR-15 microframework that also sets maximum flexibility with minimum complexity and easy replaceability of the individual components, but also of the framework. Although performance was not a focus, it's currently the fastest PSR-15 based framework (php-fpm) on the market.

Monthly Downloads: 442
Programming language: PHP
License: MIT License

chubbyphp-framework alternatives and similar libraries

Based on the "API" category.
Alternatively, view chubbyphp-framework alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of chubbyphp-framework or a related project?

Add another 'API' Library

README

chubbyphp-framework

CI Coverage Status Infection MSI Latest Stable Version Total Downloads Monthly Downloads

bugs code_smells coverage duplicated_lines_density ncloc sqale_rating alert_status reliability_rating security_rating sqale_index vulnerabilities

Description

A minimal, highly performant middleware PSR-15 microframework built with as little complexity as possible, aimed primarily at those developers who want to understand all the vendors they use.

[Application workflow](doc/Resources/workflow.png?raw=true "Application workflow")

Requirements

Suggest

Router

Any Router which implements Chubbyphp\Framework\Router\RouteMatcherInterface can be used.

PSR 7 / PSR 17

Installation

Through Composer as chubbyphp/chubbyphp-framework.

composer require chubbyphp/chubbyphp-framework "^3.5" \
    chubbyphp/chubbyphp-framework-router-fastroute "^1.2" \
    slim/psr7 "^1.4"

Usage

<?php

declare(strict_types=1);

namespace App;

use Chubbyphp\Framework\Application;
use Chubbyphp\Framework\Middleware\ExceptionMiddleware;
use Chubbyphp\Framework\Middleware\RouteMatcherMiddleware;
use Chubbyphp\Framework\RequestHandler\CallbackRequestHandler;
use Chubbyphp\Framework\Router\FastRoute\RouteMatcher;
use Chubbyphp\Framework\Router\Route;
use Chubbyphp\Framework\Router\Routes;
use Psr\Http\Message\ServerRequestInterface;
use Slim\Psr7\Factory\ResponseFactory;
use Slim\Psr7\Factory\ServerRequestFactory;

require __DIR__.'/vendor/autoload.php';

$responseFactory = new ResponseFactory();

$app = new Application([
    new ExceptionMiddleware($responseFactory, true),
    new RouteMatcherMiddleware(new RouteMatcher(new Routes([
        Route::get('/hello/{name:[a-z]+}', 'hello', new CallbackRequestHandler(
            static function (ServerRequestInterface $request) use ($responseFactory) {
                $response = $responseFactory->createResponse();
                $response->getBody()->write(sprintf('Hello, %s', $request->getAttribute('name')));

                return $response;
            }
        ))
    ])), $responseFactory),
]);

$app->emit($app->handle((new ServerRequestFactory())->createFromGlobals()));

Emitter

  • [Emitter][65]

Middleware

  • [CallbackMiddleware][70]
  • [ExceptionMiddleware][71]
  • [LazyMiddleware][72]
  • [MiddlewareDispatcher][73]
  • [NewRelicRouteMiddleware][74]
  • [RouteMatcherMiddleware][75]
  • [SlimCallbackMiddleware][76]
  • [SlimLazyMiddleware][77]

RequestHandler

  • [CallbackRequestHandler][80]
  • [LazyRequestHandler][81]
  • [RouteRequestHandler][82]
  • [SlimCallbackRequestHandler][83]
  • [SlimLazyRequestHandler][84]

Router

  • [Group][90]
  • [Route][91]

Server

  • [Builtin (development only)][100]
  • [Nginx][101]
  • [ReactPHP][102]
  • [Roadrunner][103]
  • Swoole
  • Workerman

Skeleton

Migration

  • [3.x to 4.x][212]
  • [2.x to 3.x][211]
  • [1.x to 2.x][210]
  • [Slim to Chubbyphp][219]

Copyright

Dominik Zogg 2021