antidot-fw / installer
Antidot 框架骨架安装程序
1.0.x-dev
2021-11-20 09:26 UTC
Requires
- php: ^7.4.0
- composer-plugin-api: ^2.1
- ext-json: *
Requires (Dev)
- composer/composer: 1.10.10
- infection/infection: ^0.21.5
- mikey179/vfsstream: ^1.6
- phpro/grumphp: ^0.17.1 || ^0.19.0 || ^0.20.0
- phpstan/phpstan: ^1.2.0
- phpunit/phpunit: ^9.2
- squizlabs/php_codesniffer: ^3.4
- symfony/var-dumper: ^5.1
- vimeo/psalm: ^3.14
This package is auto-updated.
Last update: 2024-09-08 21:56:45 UTC
README
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