dgfip-si1/application

为命令行应用程序提供容器。


README

Latest Stable Version Latest Unstable Version Packagist PHP Version Packagist Downloads

PHPCS   PHPStan   Tests status   Infection  

注入配置数据

默认配置:./config.yml

如果不存在,则没有配置数据 - 但可能由模式生成默认值。

选项 --config:替换默认配置文件

选项 --ad-config:添加配置文件。 (允许多个值)

查找配置文件

通过在 dgfip-si1/Application 内部配置中填充值。 .application-config.yml

dgfip-si1: 
  configuration:
    root_dir : /path/to/config    # default to application root dir
    path_patterns:                # default : []
      - [Cc]onfiguration
      - config-data
    name_patterns:                # default : ['config.yml']
      - '*.yml'
    sort_by_name:                 # default : false 
                                  # true: sort by filename instead of by full path
    recurse:                      # default false (true = recurse sub directories)

编程方式

使用 $app->config() 方法 add-file()add-array()findConfigFiles()set(),请参阅 dgfip-si1/config-helper