antidot-fw/installer

Antidot 框架骨架安装程序

资助包维护!
kpicaza

安装次数: 0

依赖者: 1

建议者: 0

安全性: 0

星标: 1

关注者: 2

分叉: 1

开放问题: 8

类型: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 框架骨架安装程序。此包允许您选择不同类型的 Antidot 框架项目骨架

  • 经典Web应用
  • 无服务器应用
  • 控制台命令行工具
  • 微HTTP应用
  • React HTTP应用

要求

  • PHP >= 7.4.0(当前版本)
  • Composer

微HTTP应用

轻量级PSR-15中间件应用。

依赖项

路由

您可以在 public/index.php 文件中使用它添加自定义中间件的路由,请查看示例

<?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');
...

文件结构

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环境