formal-bears/formal-bears

0.3.1 2019-12-21 13:35 UTC

This package is auto-updated.

Last update: 2024-03-21 23:28:40 UTC


README

Meta framwork for BEAR.Sunday applications

formal-bears/formal-bears

  • @iteman (KUBO Atuhiro) さんによるメタフレームワーク FormalBears をコピー、改変して作りました(著者の承諾を得て公開しています)。
  • オリジナル版(本家のリポジトリ)は限定公開です。著者による紹介のスライドが こちら で公開されています。

Requires

PHP7.2以上

Install

composer require formal-bears/formal-bears:^0.3

機能

  • 設定ファイルによる設定( YAML )とグラマー定義を通したコンパイル機能( symfony/config 統合)
  • 設定のマージ(デフォルト値の設定、development / production といった環境毎のオーバーライド)
  • 環境変数統合
  • マルチバインディング (ref. Multibindings · google/guice )

Application Directories

アプリケーションパッケージはルートレベルのディレクトリとして下記ディレクトリを必要とします。

Subject it MUST be named:
configuration files etc/config/

config ディレクトリは下記のサブディレクトリを必要とします。

[config]
   |
   +--- [contexts] コンテキストグローバルの設定 
   +--- [modules] 各モジュールの設定

たとえば下記のように使います。

[config]
   |
   +--- [contexts] コンテキストグローバル設定 
            |
            +--- app.yml
            +--- api.yml
            +--- cli.yml
            +--- prod.yml
            
   +--- [modules] 各モジュールの設定
            |
            [my_project_foo] MyProjectFooModule に対応する設定ルートディレクトリ
                |
                +--- [app]
                        |
                        +--- my_project_foo.yaml
                +--- [prod]
                        |
                        +--- my_project_foo.yaml

上記のように設定すれば、prod の環境では app の設定に prod のオーバーライド設定をマージさせることができます。

Links

TODO

  • 環境変数統合のサンプルアプリケーション追加
  • テスト
  • CI
  • CS

Copyright

Copyright (c) 2019 Atsuhiro Kubo, Nana Yamane, All rights reserved.

License

The BSD 2-Clause License