easeappphp/highper-blueprint 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

easeappphp/highper-blueprint

Composer 安装命令:

composer create-project easeappphp/highper-blueprint

包简介

High-performance microservice application built with EaseAppPHP Highper framework

README 文档

README

Highper is a high-performance, asynchronous PHP framework specifically designed for microservices that can handle extreme concurrency (C10M - 10 million concurrent connections).

Features

  • Asynchronous Execution - Non-blocking I/O operations using RevoltPHP event loop
  • Extreme Concurrency - Support for C10M (10 million concurrent connections)
  • PSR Compliant - Follows PSR-3, PSR-4, PSR-7, PSR-11, PSR-15, PSR-18 standards
  • 12-Factor Methodology - Built according to the 12-factor app principles
  • High Performance - Faster than OpenSwoole, Workerman, and ActiveJ (Java)
  • Modern PHP - Built with PHP 8.2+ features, leveraging attributes, enums, and typed properties
  • Containerization - Designed for container environments like Docker and Kubernetes
  • Observability - Built-in support for logging, metrics, and distributed tracing
  • Security - Security-focused design with built-in protections
  • Scalability - Horizontal and vertical scaling support

Requirements

  • PHP 8.2 or higher
  • Composer 2.0 or higher
  • libuv extension (optional, for optimal performance)

Installation

Create a new project

composer create-project easeappphp/highper-blueprint my-microservice
cd my-microservice

Install as a dependency in an existing project

composer require easeappphp/highper

Quick Start

Create a simple API endpoint

<?php

use EaseAppPHP\HighPer\Framework\Core\Application;

// Create the application
$app = new Application(__DIR__);

// Define a route
$app->getRouter()->get('/api/hello', function ($request) {
    return [
        'message' => 'Hello, World!',
        'timestamp' => time(),
    ];
});

// Run the application
$app->run();

Run the application

php -S localhost:8080 public/index.php

Visit http://localhost:8080/api/hello in your browser or use curl:

curl http://localhost:8080/api/hello

Architecture

Highper follows a clean, modular architecture that separates concerns and promotes testability:

  • Core - Application bootstrap and service provider system
  • HTTP - Request/response handling, routing, and middleware
  • Container - Dependency injection container (Laravel Container)
  • Event Loop - Asynchronous event loop (RevoltPHP)
  • Concurrency - Async operations for file, database, and external services
  • WebSocket - Support for real-time communication
  • Logging - Async logging with structured data
  • Tracing - Distributed tracing with OpenTelemetry
  • Configuration - Environment-based configuration system
  • Security - Security middleware and utilities

Examples

Creating a RESTful API Controller

<?php

namespace App\Controllers\Api;

use Amp\Http\Server\Request;
use Amp\Http\Server\Response;
use EaseAppPHP\HighPer\Framework\API\ApiController;

class UserController extends ApiController
{
    public function index(Request $request): Response
    {
        $users = $this->container->get(UserRepository::class)->all();
        return $this->success($users);
    }
    
    public function show(Request $request): Response
    {
        $id = $this->getParam($request, 'id');
        $user = $this->container->get(UserRepository::class)->find($id);
        
        if (!$user) {
            return $this->notFound('User not found');
        }
        
        return $this->success($user);
    }
}

WebSocket Chat Server

<?php

namespace App\WebSocket;

use EaseAppPHP\HighPer\Framework\WebSocket\WebSocketConnection;
use EaseAppPHP\HighPer\Framework\WebSocket\WebSocketHandlerInterface;

class ChatHandler implements WebSocketHandlerInterface
{
    protected array $clients = [];
    
    public function onConnect(WebSocketConnection $connection): void
    {
        $this->clients[$connection->getId()] = $connection;
        $this->broadcast("User {$connection->getId()} joined the chat");
    }
    
    public function onMessage(WebSocketConnection $connection, $message): void
    {
        $this->broadcast("User {$connection->getId()}: {$message}");
    }
    
    public function onDisconnect(WebSocketConnection $connection): void
    {
        unset($this->clients[$connection->getId()]);
        $this->broadcast("User {$connection->getId()} left the chat");
    }
    
    protected function broadcast(string $message): void
    {
        foreach ($this->clients as $client) {
            if ($client->isOpen()) {
                $client->send($message);
            }
        }
    }
}

Documentation

For complete documentation, please visit docs.easeapp.org.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

Highper Framework is open-sourced software licensed under the MIT license.

easeappphp/highper-blueprint 适用场景与选型建议

easeappphp/highper-blueprint 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 05 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 easeappphp/highper-blueprint 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 easeappphp/highper-blueprint 我们能提供哪些服务?
定制开发 / 二次开发

基于 easeappphp/highper-blueprint 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-04