PHPackages                             highperapp/highper-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. highperapp/highper-php

ActiveLibrary[Framework](/categories/framework)

highperapp/highper-php
======================

High-performance asynchronous PHP micro framework targeting C10M concurrency with maximum simplicity and peak performance

1.0.4(9mo ago)121MITPHPPHP ^8.3|^8.4

Since Jul 11Pushed 7mo agoCompare

[ Source](https://github.com/highperapp/highper-php)[ Packagist](https://packagist.org/packages/highperapp/highper-php)[ Docs](https://github.com/highperapp/highper-php)[ RSS](/packages/highperapp-highper-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (18)Versions (6)Used By (1)

HighPer Framework
=================

[](#highper-framework)

[![PHP Version](https://camo.githubusercontent.com/89899a77bdce65fc4c3d3423dfacff9c6461066a0b5354dc18d7721c23ba596e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d626c75652e737667)](https://php.net)[![Performance](https://camo.githubusercontent.com/8a87225d0c23847b503570ab9687cacea995b2af7825869d5b0b4a194c8e252b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506572666f726d616e63652d36322e334b2532305250532d677265656e2e737667)](https://github.com/highperapp/highper-php)[![Concurrency](https://camo.githubusercontent.com/7914767209d3e605bd5a0381b4430f923f86652f4c25cf6e7630bf0dd6182819/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e63757272656e63792d4331304d2d6f72616e67652e737667)](https://github.com/highperapp/highper-php)[![Reliability](https://camo.githubusercontent.com/1542f657cf0e6bba8e56fb249c2fbdeca992a4bb02fa86cb0b8c38d136550f3b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52656c696162696c6974792d39392e3939392532352d627269676874677265656e2e737667)](https://github.com/highperapp/highper-php)[![Tests](https://camo.githubusercontent.com/faf863a61dac7c5dba54ca8d3a29c9e4df68e4d2038248225c436ee54ce0f33e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54657374732d39362e322532352d737563636573732e737667)](https://github.com/highperapp/highper-php)

**Enterprise PHP framework designed for high-scale production applications.**

🚀 Quick Start
-------------

[](#-quick-start)

```
# Basic server
bin/highper serve

# Production with all optimizations
bin/highper serve --workers=4 --c10m --rust=enabled --memory-limit=1G --zero-downtime

# Dedicated ports mode
bin/highper serve --mode=dedicated --http-port=8080 --ws-port=8081
```

🏗️ Hybrid Multi-Process + Async Architecture
--------------------------------------------

[](#️-hybrid-multi-process--async-architecture)

**Core Design**: Combines process isolation with async I/O efficiency

- **Multi-process worker spawning** using `pcntl_fork()`
- **RevoltPHP + UV hybrid event loop** per worker
- **Zero-downtime deployments** with blue-green/rolling strategies
- **C10M optimizations** for 10 million concurrent connections
- **Rust FFI integration** for performance-critical components

### Advanced CLI Features

[](#advanced-cli-features)

```
bin/highper help                    # Show all architecture options
bin/highper status                  # System capability check

# Architecture options
--workers=COUNT                     # Worker processes (auto-detect CPU cores)
--mode=single|dedicated             # Single port vs dedicated ports
--c10m                             # C10M optimizations
--rust=enabled                     # Rust FFI performance boost
--zero-downtime                    # Zero-downtime deployments
--deployment-strategy=blue_green    # Deployment strategy
--memory-limit=SIZE                # Worker memory limit
```

🏗️ Architecture
---------------

[](#️-architecture)

### Core Design Principles

[](#core-design-principles)

1. **Interface-Driven**: All contracts defined as interfaces (NO abstract classes)
2. **External Dependencies**: Foundation components as external packages
3. **Service Providers**: Package integration via auto-discovery
4. **Extension-Friendly**: Everything extendable (NO final keywords)
5. **Rust FFI Enhancement**: Strategic performance boosts where needed

### Foundation Components

[](#foundation-components)

```
Foundation Dependencies:
├── RevoltPHP/EventLoop           # Event loop foundation (C10M optimized)
├── AMPHP v3 ecosystem            # Async/parallel infrastructure
├── amphp/http-server             # HTTP server foundation (C10M ready)
├── amphp/parallel                # Multi-process support (scalability)
├── highperapp/container          # External PSR-11 container
├── highperapp/router             # External ultra-fast router (O(1) lookups)
├── vlucas/phpdotenv              # Environment configuration
└── filp/whoops                   # Error & exception handling

```

📦 Package Ecosystem
-------------------

[](#-package-ecosystem)

HighPer Framework supports 20+ standalone packages that can be used independently:

**Foundation Packages (Required)**:

- `highperapp/container`: PSR-11 container optimized for C10M
- `highperapp/router`: Ultra-fast router with O(1) lookups + Rust FFI
- `highperapp/zero-downtime`: Zero-downtime deployment system

**Optional Standalone Libraries**:

- `highperapp/cache`: Multi-driver async caching with Redis/Memcached
- `highperapp/cli`: Command-line interface framework
- `highperapp/crypto`: Cryptographic operations with Rust FFI
- `highperapp/database`: Async database with EventSourcing/CQRS
- `highperapp/grpc`: gRPC server integration
- `highperapp/monitoring`: Performance monitoring and metrics
- `highperapp/paseto`: PASETO v4 tokens with Rust FFI
- `highperapp/realtime`: Real-time communication protocols
- `highperapp/security`: Security enhancements and validation
- `highperapp/spreadsheet`: High-performance spreadsheet manipulation
- `highperapp/stream-processing`: Stream processing capabilities
- `highperapp/tcp`: TCP server and client implementations
- `highperapp/tracing`: Distributed tracing and observability
- `highperapp/validator`: Data validation with Rust FFI
- `highperapp/websockets`: WebSocket streaming with backpressure

🦀 Rust FFI Integration
----------------------

[](#-rust-ffi-integration)

Strategic Rust components provide massive performance gains:

- **Router**: 10-50x improvement (O(1) radix tree vs PHP regex)
- **Crypto**: 5-20x improvement (native operations vs PHP)
- **PASETO**: 3-10x improvement (vs PHP JWT libraries)
- **Validator**: 2-5x improvement (native regex + validation)

📁 Project Structure
-------------------

[](#-project-structure)

```
/home/user/highperapp/
├── src/
│   ├── Contracts/                    # Framework interfaces (no abstract classes)
│   │   ├── ApplicationInterface.php
│   │   ├── ContainerInterface.php
│   │   ├── RouterInterface.php
│   │   ├── ConfigManagerInterface.php
│   │   └── ...
│   ├── Foundation/                   # Core implementations
│   │   ├── Application.php           # implements ApplicationInterface
│   │   ├── ConfigManager.php         # implements ConfigManagerInterface
│   │   ├── AsyncLogger.php           # implements LoggerInterface
│   │   └── ...
│   ├── ServiceProvider/              # Service provider system
│   │   ├── PackageDiscovery.php      # Auto-discover packages
│   │   └── ...
│   └── ...
├── composer.json                    # Foundation dependencies
└── README.md

```

🚀 Quick Start
-------------

[](#-quick-start-1)

### Installation

[](#installation)

```
composer require highperapp/highper-php
```

### Basic Usage

[](#basic-usage)

```
