antidot-fw/installer

Antidot Framework skeleton installer

Fund package maintenance!
kpicaza

Installs: 0

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 1

Open Issues: 8

Type:composer-plugin

1.0.x-dev 2021-11-20 09:26 UTC

README

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status Maintainability

Antidot Framework skeleton installer. This package let you choosing between different types of Antidot framework project skeletons:

  • Classic Web App
  • Serverless App
  • Console Line Tool
  • Micro Http App
  • React Http App

Requirements

  • PHP >= 7.4.0 for current
  • Composer

Micro HTTP App

Lightweight PSR-15 middleware application.

Dependencies

Routing

You can add your routes with it custom middlewares in public/index.php file, take a look at the example:

<?php
// public/index.php
declare(strict_types=1);

use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Psr\Http\Message\ResponseInterface;
...

    // Application Routes    
    $app->get('/', [
        static function(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface {
            $request = $request->withAttribute('docs_url', 'https://antidotfw.io');
            return $handler->handle($request);
        },
        static function(ServerRequestInterface $request): ResponseInterface {
            return new JsonResponse([
                'message' => 'Welcome to Antidot Framework Micro HTTP App.',
                'docs' => $request->getAttribute('docs_url'),
            ]);
        }
    ], 'homepage');
...

File structure

config/
    config.php
    container.php
    framework.prod.php
public/
    index.php
test/
var/
    cache/
.gitignore
composer.json
phpcs.xml.dist
phpunit.xml.dist
README.md        

Docker environment