littlegiant/silverstripe-config-validator
Composer 安装命令:
composer require littlegiant/silverstripe-config-validator
包简介
Build time configuration validation for SilverStripe framework.
README 文档
README
A module for validating SilverStripe configuration at build time.
Installation
Require via composer and run /dev/build?flush=all. This is a zero-configuration installation.
composer require littlegiant/silverstripe-config-validator
Validating configuration
Configuration is validated by implementing the OwnConfigValidator or ClassConfigValidator interfaces.
If class MyClass validates configuration of itself, it should implement OwnConfigValidator.
If class MyClass validates configuration of one or more other classes (e.g. MyOtherClass), it should implement
ClassConfigValidator and its getConfigValidatedClasses() method should return an array containing MyOtherClass::class.
This is a good way to incrementally add validation to configuration for vendor-provided (e.g. core / module) classes without
having to submit changes to those packages.
The implementation of these interfaces is not exclusive (i.e. a class can implement both interfaces and it will validate itself and the other classes.)
Configuration is validated by adding any errors via ClassConfigValidationResult::addError(). If any config validation fails,
/dev/build will abort before database building, displaying all config validation errors to be corrected.
统计信息
- 总下载量: 128
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-07-30