v2.6.0
Overview
This release focuses on improving configuration path management and introducing a new token for cleaner preset references.
Features
New {presets_dir} Token
Added a new configuration token {presets_dir} that allows you to reference the firewall presets directory in your configuration files.
Before:
configs:
- ../presets/wordpress.yml
- ../presets/malicious-urls.ymlAfter:
configs:
- "{presets_dir}/wordpress.yml"
- "{presets_dir}/malicious-urls.yml"This provides:
- More portable configurations that work regardless of where your config file is located
- Clearer intent when referencing built-in presets
- Consistency with the existing
{config_dir}token pattern
Improvements
Centralized Path Normalization
- Consolidated token normalization logic into
TokenSubstitute::normalizeInclude() - Removed duplicate normalization code from
ConfigLoader - Both
{config_dir}and{presets_dir}tokens now use a unified normalization approach - Improved maintainability by reducing code duplication
New Path Utility Method
Added Path::getPresetsDirectory() method to provide a centralized way to retrieve the presets directory path.
Technical Changes
Modified Files
src/Utility/TokenSubstitute.php- Centralized token substitution with support for{presets_dir}src/Utility/Path.php- AddedgetPresetsDirectory()methodsrc/Utility/ConfigLoader.php- Removed duplicate normalization logicexample/config.yml- Updated to demonstrate new{presets_dir}token usage
Commits
850143e- Centralized the normalization and added new token for the presets directory59f380c- Removed and made happen in the Normalization
Upgrade Notes
The {presets_dir} token is optional. Existing configurations using relative paths (e.g., ../presets/wordpress.yml) will continue to work. However, using {presets_dir} is recommended for better portability.
Full Changelog: v2.5.0...v2.6.0