asgrim / side-effect

Side Effect Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Side Effect πŸ’₯

This is what stringly-typed programming is (h/t @nilsluxton)

Side effect is a middleware-ish framework that does NOT support PSR-15.

Everything is marshalling a string, basically. So, everything is __toString().

Features ✨

  • πŸ’» Dispatch controllers (extend \Asgrim\SideEffect\Features\AbstractController for ease of use!)
  • πŸ§… Dispatch middlewares (anything that implements \Asgrim\SideEffect\Dispatchable can be used!)
  • πŸ’Ύ Perform database queries using \Asgrim\SideEffect\Features\PerformDatabaseQuery
  • 🀫 Handle errors effectively with \Asgrim\SideEffect\Features\ShutTheHellUpDecorator

Basic Usage

echo (new Framework(
    $serverRequest, // You could use `guzzlehttp/psr7` to make this
    [
        // Add loads more middlewares here to do spooky things! πŸ’•
        new class extends AbstractController {
            public function __toString() : string
            {
                return 'Hello, world!';
            }
        },
    ]
));

Demo Script πŸ”₯

The demo.php script shows an example application using the framework. You can base your enterprise level application on this easy example.

You can run the demo.php script to see it in action like this:

php -S localhost:8000 demo.php

Then visit: http://localhost:8000/?who=james

About

Side Effect Framework

License:MIT License


Languages

Language:PHP 100.0%