定制 fast-forward/container 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fast-forward/container

最新稳定版本:v1.5.1

Composer 安装命令:

composer require fast-forward/container

包简介

Fast Forward PSR-11 Container utility classes

README 文档

README

A PSR-11 compliant aggregate container for PHP, designed to unify and resolve services across multiple container implementations. Built to work seamlessly with php-di, configuration objects, and custom container stacks.

✨ Features

  • Aggregates multiple containers
  • Caches resolved entries
  • Integrates with php-di
  • First-class support for configuration containers
  • PSR-11 compliant

🚀 Installation

composer require fast-forward/container

🛠️ Usage

use FastForward\Container\ContainerInterface;
use FastForward\Container\container;
use FastForward\Config\ArrayConfig;

$config = new ArrayConfig([
    ContainerInterface::class => [
        SomeServiceProvider::class, // strings will be initialized with a new call
        SomePsr11Container::class, // strings should be initializable with a simple new call
        new OtherServiceProvider('withArgument'), // objects that implement Interop\Container\ServiceProviderInterface
        new ServiceManager($dependencies), // objects that implement Psr\Container\ContainerInterface
    ],
]);

$container = container($config);

// or using the container function directly with a configuration variadic
// $container = container(
//     SomeServiceProvider::class,
//     SomePsr11Container::class,
//     new ApplicationConfig(), // that implements ConfigInterface with the ContainerInterface key
//     new OtherServiceProvider('withArgument'),
//     new ServiceManager($dependencies),
// );

// Retrieve service
$service = $container->get(SomeService::class);

📄 License

This package is licensed under the MIT License. See the LICENSE file for more details.

🔗 Links

统计信息

  • 总下载量: 227
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-19