承接 thgs/amphp-bootstrap 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-20