2017 © Pedro Peláez
 

library psr15-middle-earth-framework

Micro framework middleware PSR-15

image

enderlab/psr15-middle-earth-framework

Micro framework middleware PSR-15

  • Friday, March 30, 2018
  • by ender9108
  • Repository
  • 0 Watchers
  • 0 Stars
  • 162 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

MIDDLE-EARTH-FRAMEWORK

It's a micro framework that implements middleware PSR-15 convention, (*1)

I created it just for fun and understand the use of PSR15 middlewares., (*2)

Build Status Coverage Status Latest Stable Version Total Downloads License, (*3)

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 !, (*4)

Author

Alexandre Berthelot alexandreberthelot9108@gmail.com, (*5)

The Versions