68publishers/application

基础扩展和组件。

v0.8.1 2017-10-10 11:55 UTC

This package is auto-updated.

Last update: 2024-08-29 04:19:56 UTC


README

Build Status Quality Score Coverage Status Total Downloads Latest Version on Packagist

此包帮助您处理具有不同语言、货币和国家的地区。即使是单一地区项目也可能有所帮助。

安装

安装 68publishers/application 的最佳方式是使用 Composer

composer require 68publishers/application

现在您可以使用 neon 配置启用环境扩展

extensions:
    environment: SixtyEightPublishers\Application\DI\EnvironmentExtension

使用方法

environment:
    profile:
        europe:
            language: [sk_SK, en_GB, de_DE, pl_PL]
            currency: [EUR, PLZ, GBP]
            country: [SK, GB, DE, PL]
        north_america:
            language: en_US
            currency: USD
            country: US
            domain: [www.example.com, example.com]
            # disable: yes
        default: # If the default profile doesn't exists, the first profile is taken as default
            language: cs_CZ
            currency: CZK
            country: CZ

Bar 面板

启用和禁用 Tracy 调试器面板,以获得更好的调试体验

environment:
    debugger: yes

与 Kdyby\Translation 集成

此功能根据扩展中的配置文件设置自动评估 Kdyby\Translation 的区域参数。如果将 translations.useDefault 设置为 TRUE,则可以使用默认配置文件的语言。如果此设置设置为 FALSE,则不会使用默认语言,并将调用其他解析器。此外,如果您通过方法 \SixtyEightPublishers\Application\Environment\ActiveProfile::changeLanguage() 更改语言,翻译器中的区域也会更改。

environment:
    translations:
        enable: yes
        useDefault: no

贡献规则

  • 每个功能一个 PR
  • 包含测试的 PR 更有可能被合并
  • 测试和编码标准必须通过
vendor/bin/tester ./tests -s
vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run