定制 strictlyphp/dolphpin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

strictlyphp/dolphpin

最新稳定版本:3.0.5

Composer 安装命令:

composer require strictlyphp/dolphpin

包简介

README 文档

README

Coverage Status CI Status Stable

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-20