定制 cloverphp/clover 二次开发

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

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

cloverphp/clover

最新稳定版本:v0.0.1

Composer 安装命令:

composer create-project cloverphp/clover

包简介

Clover PHP: a modern, unopinionated, and lightweight framework.

README 文档

README

CloverPHP Clover PHP is a modern, unopinionated, and lightweight Express.js-style framework for PHP 8.4. It helps you build REST APIs, web apps, and microservices with the simplicity of Express.js and the power of modern PHP.

Code Coverage CodeQL Tests Packagist Version Packagist Dependency Version Packagist License Packagist Downloads Packagist Stars

✨ Features

🚀 Minimal & Fast – Simple API design, inspired by Express.js.

⚡ Async Support – Built with PHP Fibers & AMPHP for non-blocking I/O.

🗂️ Routing System – Intuitive get(), post(), etc., with async router support.

🔑 Auth Ready – Supports sessions, cookies, and JWT-based authentication.

🧩 Extensible Middleware – Add global and route-level middleware for logging, security, and validation.

💾 Database Agnostic – Works with both SQL and NoSQL databases.(Upcoming)

🛠️ MVC Support – Controllers, models, and views with interfaces for clean architecture.

🛡️ Error Handling & Logging – Developer-friendly error responses and logging tools.

🎨 Unopinionated – Flexible enough for small apps or large enterprise projects.

📦 Composer & PSR-12 – Modern PHP practices with full Composer/PSR-12 compliance.

📦 Installation

composer create-project cloverphp/clover my-app
cd my-app
php -S localhost:3000 -t public

🚀 Quick Start

<?php

require_once __DIR__ . "/vendor/autoload.php";

use Clover\Clover;
use Clover\Http\Request;
use Clover\Http\Response;

$app = new Clover();
$router = $app->router();

// Home route
$router->get("/", fn(Request $req, Response $res) =>
$res->send("<h1>Welcome to 🍀 Clover PHP!</h1>"));

$router->post("/", fn(Request $req, Response $res) =>
    $res->json(['name' => 'Clover PHP!'])
);

$app->run(3000, true);

📂 Project Structure

my-app/
├── app/
│   ├── Controllers/
│   ├── Models/
│   └── Views/
├── public/
│   └── index.php
├── vendor/
├── composer.json
└── README.md

🔑 Example Middleware

$app->use(function (Request $req, Response $res, callable $next) {
    $res->setHeader("X-Powered-By", "Clover PHP");
    $next($req, $res);
});

🛡️ License

Clover PHP is open-sourced software licensed under the Packagist License

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-26