Download the PHP package boatrace/core without Composer
On this page you can find all versions of the php package boatrace/core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download boatrace/core
More information about boatrace/core
Files in boatrace/core
Informations about the package core
🚤 Boatrace Core
Boatrace Core は、boatrace/* パッケージ群が共有する PHP-DI コンテナと、facade / dispatcher / response の3クラス構成を支える共通部品を提供する PHP ライブラリです。
boatrace/scraper や boatrace/scraper-boatcast が依存しているため、通常は個別にインストールする必要はありません。
📦 Requirements
- php: ^8.4
- boatrace/types: ^0.1
- php-di/php-di: ^7.0
- symfony/browser-kit: ^8.0
💾 Installation
⚡ Usage
CoreContainer
| メソッド | 説明 |
|---|---|
CoreContainer::getInstance($name) |
契約(interface)名から実装を取得します。同じ契約は同じインスタンスを返します |
CoreContainer::getContainer() |
PHP-DI の Container をそのまま取得します |
CoreContainer::addDefinitions(...$paths) |
定義ファイルを追加します。既存の定義を上書きでき、コンテナは再構築されます |
コンテナは boatrace/support / boatrace/scraper / boatrace/scraper-boatcast の各パッケージが持つ config/definitions.php を自動で集約します。インストールされていないパッケージは無視されます。
定義の上書き
利用側で定義ファイルを用意し、addDefinitions() で読み込むと、ライブラリ側の定義を差し替えられます。
例えば、呼び出し間隔を 2.0 秒に変えるには次のように書きます。
HTTP レスポンスの Server-Timing を監視するには、BrowserObserver 契約を実装して定義を差し替えます。
Concerns
facade / dispatcher / response の定型処理を trait として提供します。boatrace/* の各パッケージが利用しています。
| trait | 説明 |
|---|---|
RejectsUndefinedCalls |
未定義メソッドの呼び出しで BadMethodCallException を投げます |
ResolvesFacadeResponse |
facade の戻り値を Response 契約へ包み、型を検査します |
IteratesBatchTargets |
一括取得で「開催中の場 × 指定レース」を走査し、進捗を表示します |
📄 License
Boatrace Core は MIT license の元で公開されています。
All versions of core with dependencies
boatrace/types Version ^0.1.0
php-di/php-di Version ^7.0
symfony/browser-kit Version ^8.0