oihana / php-nginx
The Oihana PHP Nginx library
0.0.1
2025-08-12 13:51 UTC
Requires
- php: >=8.4
- oihana/php-commands: dev-main
- oihana/php-core: dev-main
- oihana/php-files: dev-main
- oihana/php-schema: dev-main
- oihana/php-standards: dev-main
- oihana/php-system: dev-main
Requires (Dev)
- mikey179/vfsstream: ^1.6
- nunomaduro/collision: ^8.8
- phpdocumentor/shim: ^3.8
- phpunit/phpunit: ^12
README
PHP toolkit to create, modify, and control NGINX configurations and commands programmatically.
Built on top of the Oihana PHP Commands Library.
๐ฆ Installation
Requires PHP 8.4+
Install via Composer:
composer require oihana/php-nginx
๐ Usage
Configuration Management
The library provides comprehensive tools for managing Nginx configurations:
- Path Management: Handle different Nginx configuration paths
- Signal Control: Send signals to Nginx processes
- Redirect Management: Create and manage redirect blocks
- Options Configuration: Configure Nginx options programmatically
Enums
NginxPath
: Defines standard Nginx configuration pathsNginxSignal
: Available Nginx process signalsRedirectDirection
: Redirect direction options
Helpers
redirectBlock()
: Generate redirect block configurations
Options
NginxOption
: Individual Nginx option managementNginxOptions
: Collection of Nginx options
๐งช Testing
To run all tests:
composer test
๐ Documentation
For detailed documentation, please refer to the source code and test files in the src/
and tests/
directories.
Project Structure
src/oihana/nginx/
โโโ enums/ # Nginx-related enumerations
โโโ helpers/ # Helper functions
โโโ options/ # Configuration options
โโโ traits/ # Reusable traits
๐ค Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
๐ License
This project is licensed under the Mozilla Public License 2.0 (MPL-2.0).
๐ Dependencies
This library is built on top of the Oihana PHP Framework and includes the following core dependencies:
Core Framework Dependencies
- oihana/php-core: Core framework functionality
- oihana/php-reflect: Reflection utilities
- oihana/php-enums: Enumeration support
- oihana/php-schema: Schema validation
- oihana/php-standards: Coding standards and utilities
- oihana/php-files: File system operations
- oihana/php-system: System-level operations
- oihana/php-commands: Command-line interface framework
Development Dependencies
- phpunit/phpunit: Unit testing framework
- nunomaduro/collision: Error reporting for console applications
- mikey179/vfsstream: Virtual file system for testing
- phpdocumentor/shim: Documentation generation support
All framework dependencies are currently using the dev-main
branch for development purposes (alpha version).