PHPackages                             dcrphp/container - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dcrphp/container

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dcrphp/container
================

容器类，提供开箱即用的组件。

1.0.1(4y ago)04371MITPHPPHP ^7.0

Since Sep 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/dcrphp/container)[ Packagist](https://packagist.org/packages/dcrphp/container)[ RSS](/packages/dcrphp-container/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (1)

[![Build Status](https://camo.githubusercontent.com/aba803a56ff67d6119b30ca8ac02bd191312963feeb4d6edb0e3a447746d8b9a/68747470733a2f2f7472617669732d63692e6f72672f6463727068702f636f6e7461696e65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dcrphp/container)[![Latest Stable Version](https://camo.githubusercontent.com/b9dcf11350ab835eaa1d48394af59e8530aae0d8cda0de7d417eddf8e11a3667/68747470733a2f2f706f7365722e707567782e6f72672f6463727068702f636f6e7461696e65722f762f737461626c652e706e67)](https://packagist.org/packages/dcrphp/container)[![Latest Unstable Version](https://camo.githubusercontent.com/554f2c708dfdbe52822d8ae4efbd17bb2ec3dea7e0a30fbabd456dc532fb6558/68747470733a2f2f706f7365722e707567782e6f72672f6463727068702f636f6e7461696e65722f762f756e737461626c652e706e67)](https://packagist.org/packages/dcrphp/container)

DcrPHP/Container容器类
===================

[](#dcrphpcontainer容器类)

1、安装
----

[](#1安装)

 composer install dcrphp/container

2、说明
----

[](#2说明)

 容器类可以通过简单配置，获取某个组件的支持。Container只是做成了组件的开箱即用，而没有实现或提供任何组件功能。

3、使用
----

[](#3使用)

 cd example
 php index.php

4、添加组件流程标准
----------

[](#4添加组件流程标准)

 第一步：组件的实现类，如果想用Config配置可以在\_\_construct()加一个参数：DcrPHP\\Config\\Config，如：public function \_\_construct(DcrPHP\\Config\\Config $clsConfig)
 第二步：组件打成composer包形式
 第三步：src/Component新建个类且参考Elasticsearch.php添加组件的相关说明
 第四步：如果实现类改动涉及到容器，请容器也修改

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~168 days

Total

3

Last Release

1792d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a3b371e27394bd968db9fe1df3d767971f67df3b9fc34aa18273da2792b7e3d?d=identicon)[dcrphp](/maintainers/dcrphp)

---

Top Contributors

[![dcrphp](https://avatars.githubusercontent.com/u/65381497?v=4)](https://github.com/dcrphp "dcrphp (19 commits)")[![junqing124](https://avatars.githubusercontent.com/u/6613893?v=4)](https://github.com/junqing124 "junqing124 (5 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dcrphp-container/health.svg)

```
[![Health](https://phpackages.com/badges/dcrphp-container/health.svg)](https://phpackages.com/packages/dcrphp-container)
```

###  Alternatives

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k455.6M9.6k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

706130.3M13.3k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31182.0M2.4k](/packages/illuminate-container)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k52](/packages/ecotone-ecotone)[symfony/type-info

Extracts PHP types information.

20069.8M270](/packages/symfony-type-info)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
