Download the PHP package neuron-php/application without Composer
On this page you can find all versions of the php package neuron-php/application. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package application
Neuron-PHP Application
A comprehensive application framework component for PHP 8.4+ that provides base classes, configuration management, event handling, and lifecycle management for building robust applications with the Neuron framework.
Table of Contents
- Installation
- Quick Start
- Core Features
- Application Base Class
- Configuration Management
- Event System
- Initializers
- Command Line Applications
- Logging
- Error Handling
- Registry Pattern
- Testing
- Best Practices
- More Information
Installation
Requirements
- PHP 8.4 or higher
- Extensions: curl, json
- Composer
Install via Composer
Quick Start
Basic Application
Core Features
- Application Lifecycle Management: onStart, onRun, onStop, onFinish hooks
- Configuration System: Flexible settings from YAML, INI, ENV sources
- Event-Driven Architecture: Global event emitter with listener configuration
- Initializer System: Automatic loading and execution of initialization code
- Logging Integration: Built-in logging with multiple destinations
- Error Handling: Comprehensive error and fatal error handlers
- Registry Pattern: Global object storage and retrieval
- Command Line Support: Specialized base class for CLI applications
- Settings Fallback: Automatic fallback to environment variables
Application Base Class
The Base class provides core application functionality:
Lifecycle Methods
Running the Application
Configuration Management
Configuration Sources
The application supports multiple configuration sources through the ISettingSource interface:
Configuration Structure
Example neuron.yaml:
Accessing Settings
Settings with Fallback
Event System
Global Event Emitter
The application provides a global event emitter through the CrossCutting\Event class:
Event Configuration
Configure event listeners via YAML (event-listeners.yaml):
Initializers
Initializers are classes that run during application startup for bootstrapping:
Creating an Initializer
Create files in app/Initializers/:
Running Initializers
Initializers are automatically loaded and executed during onStart():
They are atomic instances of classes implementing IRunnable and enable modular startup logic.
Command Line Applications
The CommandLineBase class extends Base with CLI-specific features:
Logging
Built-in Logging
The application automatically initializes logging based on configuration:
Error Handling
Error Handlers
Crash Detection
Registry Pattern
Using the Registry
Registry Best Practices
Testing
Testing Applications
Mocking Applications
Best Practices
Application Structure
Advanced Features
Application Versioning
More Information
- Neuron Framework: neuronphp.com
- GitHub: github.com/neuron-php/application
- Packagist: packagist.org/packages/neuron-php/application
All versions of application with dependencies
ext-json Version *
neuron-php/patterns Version ^0.7.2
neuron-php/logging Version 0.9.*
neuron-php/util Version 0.6.*
neuron-php/events Version ^0.6.2
symfony/yaml Version ^6.4