What are Extensions?
ForkBB features a flexible extension system that allows you to customize and extend your forum without modifying the core codebase. Extensions can add new features, modify existing behavior, hook into events, and integrate with templates.Extension Directory Structure
Extensions are stored in theext/ directory at the root of your ForkBB installation:
How Extensions Work
Extensions are managed through theExtensions model, which:
- Scans the
ext/directory forcomposer.jsonfiles - Validates extension metadata and configuration
- Manages installation, enabling, disabling, and updates
- Generates configuration files in
app/config/ext/
Extension States
Extensions can be in one of several states:| State | Code | Description |
|---|---|---|
NOT_INSTALLED | 0 | Extension is present but not installed |
DISABLED | 4 | Extension is installed but disabled |
DISABLED_DOWN | 5 | Extension is disabled and file version is older |
DISABLED_UP | 6 | Extension is disabled and file version is newer |
ENABLED | 8 | Extension is active and running |
ENABLED_DOWN | 9 | Extension is enabled but file version is older |
ENABLED_UP | 10 | Extension is enabled but file version is newer |
CRASH | 12 | Extension files are missing or corrupted |
Extension model:
Configuration Files
When extensions are enabled, ForkBB generates several configuration files inapp/config/ext/:
common.php- Combined data from all extensionspre.php- Template pre-processing dataauto.php- PSR-4 autoloader mappingsconfig.php- Extension configuration valuesevents.php- Event listener mappings
Extension Capabilities
Extensions can:- Listen to events to hook into application lifecycle
- Modify templates by injecting content before rendering
- Add routes and controllers for new pages
- Create symlinks to serve static assets from
public/ - Register autoloaders for custom PHP classes
- Add configuration values to the forum
- Run installation hooks for setup and teardown
Extension Management
TheExtensions manager provides methods to control extension lifecycle:
Next Steps
Creating Extensions
Learn how to create your own extension
Event System
Understand how to use events in extensions