A tiny, yet powerful, PHP micro-framework.

Related tags

Frameworks framework
Overview

Equip Framework

Latest Stable Version License Build Status Code Coverage Scrutinizer Code Quality

A tiny and powerful PHP micro-framework created and maintained by the engineering team at When I Work.

Attempts to be PSR-1, PSR-2, PSR-3, PSR-4 and PSR-7 compliant. Also uses the ADR pattern. You should too!

To get started, check out the documentation. There's also a sample project that shows the best way to use this framework and is a quick way to start a new project.

Comments
  • Delete all responders and related configuration

    Delete all responders and related configuration

    The ADR triad is not meant to be implemented in an agnostic way, but rather implemented exactly as necessary for each use case. This makes general purpose responders pointless, since the responder attached to each action (or possibly groups of actions) will generate an exact response based on the requirements of the use case.

    Refs #75

    opened by shadowhand 10
  • Allow to use an instance (object) of middleware

    Allow to use an instance (object) of middleware

    This change will allow the use of prepared objects of middleware.

    Now ResolverTrait::resolve method does not check for object and fully trust a conctrete implementation of ResolverInterface. (I hope it will not affect performance) So now any Resolver must return the object back when an instance already exists.

    I guess for this case we need to have a test.

    opened by AlexMasterov 8
  • Content negotiation should have a failure scenario

    Content negotiation should have a failure scenario

    Currently, if an acceptable response content type cannot be determined, the first available formatter is used.

    From section 12.2 of RFC 2616:

    HTTP/1.1 defines the 300 (Multiple Choices) and 406 (Not Acceptable) status codes for enabling agent-driven negotiation when the server is unwilling or unable to provide a varying response using server-driven negotiation.

    It seems like we should be returning a 406 response code in that scenario instead.

    opened by elazar 6
  • Make actions first class citizens

    Make actions first class citizens

    According to the intent of ADR, the Action part of the triad is meant to be a completely custom class that provides a boundary between HTTP and domain logic. The action is aware of the domain and knows how to direct output through a responder.

    This is not how Equip has been treating the domain. Our attempts to make Domain pseudo-HTTP-aware with Payload and Input has not been very successful and is probably the least concise bit of the framework.

    This stems from a gist I made some time ago as a proof of concept.

    TODO

    • [x] update documentation
    • [x] decide what to do with responders
    • [x] delete equip/adr dependency (?)
    enhancement 
    opened by shadowhand 6
  • Upgrade PHPUnit version to 5.4

    Upgrade PHPUnit version to 5.4

    PHPUnit >= 5.2 requires PHP 5.6, but the Equip still supports PHP 5.5 (Travis CI) PHP 5.5 is no longer supported, so it should be removed from the builds.

    Now, every build has the warning that the TestCase::getMock method has been deprecated.

    Ref: equip/auth/pull/3

    opened by AlexMasterov 6
  • Allow to use any exception handler as the formatter

    Allow to use any exception handler as the formatter

    My attempt to remake the (Whoops) ExceptionHandler. These changes have a huge impact on performance. (less reponse time) But it's still work in progress, I have a proposal that may affect the final result.

    I used the Whoops handlers as a formatters, which are used a generic Responder like FormattedResponder and DTO Payload. That seems the obvious way, and does not violate the ADR pattern:

    Action-Domain-Responder: View vs Responder

    Note also that a generic Responder may be used by more than one Action. The point is that the Action leaves all header and content work to the Responder, not that there must be a different Responder for each different View.

    My suggestions To make an interfaces for exceptions, it's a sketch:

    use Equip\Exception\ExceptionInterface;
    interface EquipExceptionHandlerInterface
    {
        public function __invoke(
            ServerRequestInterface $request,
            ResponseInterface $response,
            callable $next
        );
        public function withEquipException(ExceptionInterface $exception);
    }
    
    use Exception;
    interface ExceptionHandlerInterface
    {
        public function withException(Exception $exception);
    }
    
    use Throwable;
    interface ThrowableHandlerInterface
    {
        public function withThrowable(Throwable $throwable);
    }
    

    Use a PSR logger as a decorator. Soon I'll add it. Use the Whoops as a separate package. It already looks like that. Use for the Equip a simple (native) exception handler by default, and change it using a DI.

    use Equip\Exception\ExceptionInterface;
    use Exception;
    public function __invoke(
        ServerRequestInterface $request,
        ResponseInterface $response,
        callable $next
    ) {
        try {
            return $next($request, $response);
        } catch (ExceptionInterface $exception) {
            return $this->exceptionHandler->withEquipException($request, $response, $exception);
        } catch (Exception $exception) {
            return $this->exceptionHandler->withException($request, $response, $exception);
        }
    }
    
    opened by AlexMasterov 6
  • Separate status response handling from formatting

    Separate status response handling from formatting

    Response body formatting should not be tied to status, as it prevents having responses with no body. For example, a 204 No Content response without a body is perfectly acceptable.

    Fixes #34

    enhancement 
    opened by shadowhand 6
  • Switch to using equip structures

    Switch to using equip structures

    Refs equip/structure@9bb7222d9570

    ~~Since the method names have changed, this will need to be released in v2.x.~~ Added a compatibility trait to ensure backwards compatibility.

    enhancement 
    opened by shadowhand 6
  • Move core configuration code to separate library?

    Move core configuration code to separate library?

    I'd like to be able to use the core configuration code (i.e. ConfigurationInterface and ConfigurationSet) apart from the rest of the framework. I think there may be sufficient value in this notion to warrant moving it to its own repository.

    It's under its own sub-namespace, so no namespace changes would be needed. The only potential difficulty I can see that it introducing is that any major version upgrades to equip/structure dependency would have to be done on both repositories simultaneously to avoid version conflicts.

    opened by elazar 5
  • Switch from routing to split dispatching

    Switch from routing to split dispatching

    Rather than having a single large routing table, split routing into separate dispatching classes, similar to a middleware set.

    See MIGRATING.md for how it would look to users.

    enhancement 
    opened by shadowhand 5
  • Project status

    Project status

    As title, is this project still maintain?

    It seems that this project has been inactive for about whiles.

    Once this project status is on maintained, let me do some contributions on that to keep this package better :).

    opened by peter279k 4
  • Add a Gitter chat badge to README.md

    Add a Gitter chat badge to README.md

    equip/framework now has a Chat Room on Gitter

    @ameech has just created a chat room. You can visit it here: https://gitter.im/equip/framework.

    This pull-request adds this badge to your README.md:

    Gitter

    If my aim is a little off, please let me know.

    Happy chatting.

    PS: Click here if you would prefer not to receive automatic pull-requests from Gitter in future.

    opened by gitter-badger 1
Releases(2.1.2)
A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast! Condensed in a single ~65KB file

Bong Cosca 2.6k Dec 30, 2022
Biny is a tiny, high-performance PHP framework for web applications

Biny is high performance. Framework comes default with response time of less than 1ms. Stand-alone QPS easily up to 3000.

Tencent 1.7k Dec 9, 2022
PIP is a tiny application framework built for people who use a LAMP stack.

PIP is a tiny application framework built for people who use a LAMP stack. PIP aims to be as simple as possible to set up and use.

Ron Marasigan 244 Dec 30, 2022
Framework X is a simple and fast micro framework based on PHP

Framework X is a simple and fast micro framework based on PHP. I've created a simple CRUD application to understand how it works. I used twig and I created a custom middleware to handle PUT, DELETE methods.

Mahmut Bayri 6 Oct 14, 2022
Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

Framework X Framework X – the simple and fast micro framework for building reactive web applications that run anywhere. Quickstart Documentation Tests

Christian Lück 620 Jan 7, 2023
An extensible micro-framework for PHP

What is Flight? Flight is a fast, simple, extensible framework for PHP. Flight enables you to quickly and easily build RESTful web applications. requi

Mike Cao 2.5k Dec 30, 2022
A resource-oriented micro PHP framework

Bullet Bullet is a resource-oriented micro PHP framework built around HTTP URIs. Bullet takes a unique functional-style approach to URL routing by par

Vance Lucas 415 Dec 27, 2022
a micro mvc framework for php

micro-mvc-php a micro mvc framework for php Config your Web url in .env . lifecycle All request proccess by index.php Autoload files include in bootst

Amiranbari 6 Jul 9, 2022
Lite & fast micro PHP framework that is **easy to learn**.

Utopia Framework is a PHP MVC based framework with minimal must-have features for professional, simple, advanced and secure web development.

utopia 139 Dec 30, 2022
The Slim PHP micro framework paired with Laravel's Illuminate Database toolkit.

Slim & Eloquent The Slim PHP micro framework paired with Laravel's Illuminate Database toolkit. Getting started # Download composer curl -s https://ge

Kyle Ladd 111 Jul 23, 2022
⚡ Micro API using Phalcon Framework

Micro App (Rest API) ⚡ Micro API using Phalcon PHP Framework. PHPDocs I. Requirements A Laptop ?? Docker (docker-compose*) Makefile (cli) II. Installa

Neutrapp 7 Aug 6, 2021
Mutexes for Micro-Framework HLEB

Use of mutexes in a project (including projects based on the HLEB micro framework) The use of mutexes is worthwhile in cases, when access to any code

Foma Tuturov 1 Oct 11, 2022
A curated list of awesome tutorials and other resources for the Slim micro framework

Awesome Slim A curated list of awesome tutorials and other resources for the Slim micro framework Table of Contents Essentials Tutorials Packages and

Sawyer Charles 466 Dec 8, 2022
Plates Template Integration for Slim micro framework 3

Plates Template Integration for Slim micro framework 3 Render your Slim 3 application views using Plates template engine. Install Via Composer $ compo

Projek XYZ 26 Feb 5, 2022
Sunhill Framework is a simple, fast, and powerful PHP App Development Framework

Sunhill Framework is a simple, fast, and powerful PHP App Development Framework that enables you to develop more modern applications by using MVC (Model - View - Controller) pattern.

Mehmet Selcuk Batal 3 Dec 29, 2022
Lite & fast micro PHP abuse library that is **easy to use**.

Utopia Abuse Utopia framework abuse library is simple and lite library for managing application usage limits. This library is aiming to be as simple a

utopia 23 Dec 17, 2022
An application for building micro-services in PHP ^8.

Restolia An application for building micro-services in PHP ^8. Install composer create-project restolia/restolia my-app Services Each service lives i

null 1 May 1, 2022
Leaf is a PHP framework that helps you create clean, simple but powerful web apps and APIs quickly and easily.

Leaf is a PHP framework that helps you create clean, simple but powerful web apps and APIs quickly and easily. Leaf introduces a cleaner and much simpler structure to the PHP language while maintaining it's flexibility. With a simple structure and a shallow learning curve, it's an excellent way to rapidly build powerful and high performant web apps and APIs.

Leaf Framework 706 Jan 3, 2023
PhpBoot is an easy and powerful PHP framework for building RESTful/Microservices APIs.

?? tiny & fast PHP framework for building Microservices/RESTful APIs, with useful features: IOC, Hook, ORM, RPC, Swagger, Annotation, Parameters binding, Validation, etc.

tknet 656 Jan 4, 2023