enderlab/psr15-middle-earth-framework

Micro framework middleware PSR-15


License
MIT

Documentation

MIDDLE-EARTH-FRAMEWORK

It's a micro framework that implements middleware PSR-15 convention

I created it just for fun and understand the use of PSR15 middlewares.

Build Status Coverage Status Latest Stable Version Total Downloads License

Installation

composer require enderlab/middle-earth-framework

Get started

<?php
use EnderLab\Application\AppFactory;
use EnderLab\Logger\LoggerMiddleware;
use EnderLab\Router\TrailingSlashMiddleware;

/**
 * Create App object
 */
$app = AppFactory::create(__DIR__.'/../config/');

/** 
 * Use default error handler
 * If you want to use a different handler
 * Use $app->pipe(MyCustomErrorHandler)  
 */
$app->enableErrorHandler();

/**
 * Add new middleware in pipe
 */
$app->pipe(new LoggerMiddleware($app->getContainer()->get('logger')));
$app->pipe(new TrailingSlashMiddleware());

/**
 * Start router middleware
 */
$app->enableRouterHandler();

/**
 * Start dispatcher middleware
 */
$app->enableDispatcherHandler();

$app->run();

Documentation

You can see the documentation here !

Author

Alexandre Berthelot alexandreberthelot9108@gmail.com