highperapp / highper-php
High-performance asynchronous PHP micro framework targeting C10M concurrency with maximum simplicity and peak performance
Installs: 0
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:framework
Requires
- php: ^8.2
- amphp/amp: ^3.0
- amphp/http-server: ^3.0
- amphp/parallel: ^2.0
- filp/whoops: ^2.0
- highperapp/container: ^1.0
- highperapp/router: ^1.0
- psr/container: ^2.0
- psr/log: ^3.0
- revolt/event-loop: ^1.0
- vlucas/phpdotenv: ^5.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
- squizlabs/php_codesniffer: ^3.7
- symfony/var-dumper: ^6.0
Suggests
- highperapp/cache: High-performance caching with Redis/Memcached
- highperapp/crypto: High-performance cryptographic operations
- highperapp/database: Async database adapters for MySQL/PostgreSQL
- highperapp/grpc: gRPC server integration
- highperapp/monitoring: Performance monitoring and metrics
- highperapp/paseto: PASETO token authentication
- highperapp/realtime: Real-time communication protocols
- highperapp/security: Security enhancements and validation
- highperapp/validator: High-speed data validation
- highperapp/websockets: WebSocket streaming with backpressure
This package is auto-updated.
Last update: 2025-06-28 20:35:16 UTC
README
High-performance asynchronous PHP micro framework targeting C10M concurrency with maximum simplicity and peak performance.
🚀 Features
- C10M Concurrency: Handle 10 million concurrent connections efficiently
- Interface-Driven Architecture: Pure interface implementations, NO abstract classes, NO final keywords
- External Foundation Packages: Uses
highperapp/di-container
andhighperapp/router
as foundation dependencies - Rust FFI Integration: Optional high-performance Rust components for critical path operations
- Package Auto-Discovery: Automatic integration of HighPer ecosystem packages
- Async Everything: Built on AMPHP v3 and RevoltPHP for non-blocking operations
🏗️ Architecture
Core Design Principles
- Interface-Driven: All contracts defined as interfaces (NO abstract classes)
- External Dependencies: Foundation components as external packages
- Service Providers: Package integration via auto-discovery
- Extension-Friendly: Everything extendable (NO final keywords)
- Rust FFI Enhancement: Strategic performance boosts where needed
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/di-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
HighPer Framework supports 19+ standalone packages that can be used independently:
Foundation Packages (Required):
highperapp/di-container
: PSR-11 container optimized for C10Mhighperapp/router
: Ultra-fast router with O(1) lookups + Rust FFI
High-Performance Packages (Optional):
highperapp/crypto
: Cryptographic operations with Rust FFIhighperapp/paseto
: PASETO v4 tokens with Rust FFIhighperapp/validator
: Data validation with Rust FFIhighperapp/websockets
: WebSocket streaming with backpressurehighperapp/database
: Async database with EventSourcing/CQRShighperapp/cache
: Multi-driver async caching- And 10+ more specialized packages...
🦀 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
/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
Installation
composer require highperapp/highper-php
Basic Usage
<?php use HighPerApp\HighPer\Foundation\Application; // Create application with auto-discovery $app = new Application([ 'packages' => [ 'auto_discover' => true, # Automatically load installed packages 'websockets' => true, # Enable WebSocket support 'database' => true, # Enable async database 'cache' => true, # Enable high-performance caching ] ]); // Bootstrap and run $app->bootstrap(); $app->run();
With Rust FFI Performance
# Build Rust components for maximum performance cd packages/highper-router/rust && ./build.sh cd packages/highper-crypto/rust && ./build.sh cd packages/highper-paseto/rust && ./build.sh cd packages/highper-validator/rust && ./build.sh
🔧 Requirements
- PHP: 8.2+ (8.3+ recommended)
- Extensions: FFI (optional, for Rust components), OPcache, pcntl, posix
- Memory: 512MB+ recommended for high concurrency
- OS: Linux (recommended), macOS, Windows
📝 License
MIT License. See LICENSE file for details.
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
Built with ❤️ for C10M performance and maximum simplicity from Hyderabad, India.