strictlyphp/dolphpin
最新稳定版本:3.0.5
Composer 安装命令:
composer require strictlyphp/dolphpin
包简介
README 文档
README
Dolphin is a lightweight PHP framework designed for running DigitalOcean functions. It has two versions:
- v1: For PHP 8
- v2+: For PHP 8.2
Installation
Install Dolphin via Composer:
composer require strictlyphp/dolphin:^1.0 # For PHP 8 composer require strictlyphp/dolphin:^3.0 # For PHP 8.2
Usage
Controller Example
A controller handles the logic of the request. Example:
<?php namespace Service\User\Controllers; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use StrictlyPHP\Dolphin\Response\JsonResponse; class CreateUserController { public function __invoke(ServerRequestInterface $request): ResponseInterface { return new JsonResponse(['foo' => 'bar']); } }
Main Index File
In your main application file, you will include and run the app using the routes.php:
<?php use Service\User\Controllers\CreateUserController; use League\Route\Router; function main(array $event, object $context): array { $router = new Router; $router->post('/users', CreateUserController::class); $app = new \StrictlyPHP\Dolphin\App($router); return $app->run($event, $context); }
License
This project is licensed under the MIT License.
统计信息
- 总下载量: 887
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-20