thgs/amphp-bootstrap
最新稳定版本:v0.5.0
Composer 安装命令:
composer require thgs/amphp-bootstrap
包简介
A package that guides the boot process of an Amphp HTTP server
README 文档
README
Note that this package is at an experimental/exploratory stage.
This is a convenience package that boots an Amphp HTTP server. It exports configuration objects that are used as input and loaders for the config for a few basic formats. It requires a container implementation to be adapted to an interface, however some basic adapters are already provided for some container packages.
Features
- With the container integration you can setup your routes and use DI.
Usage
You can boot it like this, example below is with Auryn Injector.
use Auryn\Injector; use thgs\Bootstrap\Bootstrap; use thgs\Bootstrap\Config\Loader\PhpFileLoader; use thgs\Bootstrap\DependencyInjection\AurynInjector; require \dirname(__DIR__) . '/vendor/autoload.php'; // Loader for config.php which contains the main configuration $loader = new PhpFileLoader(getcwd() . '/' . ($argv[1] ?? 'config.php')); // Pick an injector $injector = new AurynInjector(new Injector()); // Finally, boot everything new Bootstrap($loader->load(), $injector);
See
examples/
directory for a sample configuration. All configuration objects
contain the various options you could set up using Amphp directly as
arguments of the constructor.
Out of the box this package supports the below injectors/containers:
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-20