awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
PHP-DI avatar

PHP-DI/PHP-DI

0
View on GitHub↗
2,773 星标·322 分支·PHP·MIT·1 次浏览php-di.org↗

PHP DI

PHP-DI is an inversion of control container designed to manage object lifecycles and dependency resolution within PHP applications. It functions as a centralized registry that automates the wiring of components, allowing for the decoupling of services from their concrete implementations.

The library distinguishes itself by utilizing reflection to inspect class constructor signatures, enabling automatic dependency injection without requiring manual configuration for standard scenarios. It supports recursive resolution of dependency graphs and provides mechanisms for lazy object instantiation, which defers the creation of heavy services until they are accessed.

The framework facilitates modular application architecture through configuration composition, allowing developers to merge and override service definitions across multiple files. It also supports native code configuration, which ensures that service mappings remain compatible with standard static analysis tools, editor auto-completion, and refactoring workflows. Additionally, the container provides capabilities for dynamic function execution, where dependencies are automatically resolved and injected into callables at runtime.

Features

  • Dependency Injection Containers - Manages object instantiation and dependency resolution by inspecting type hints and configuration files in applications.
  • Reflection-Based Dependency Resolution - Inspects class constructor signatures at runtime to automatically identify and instantiate required dependencies without explicit configuration.
  • Dependency Injection Frameworks - Manages object lifecycles and class dependencies in applications by automatically resolving constructor parameters and service requirements at runtime.
  • Automatic Constructor Injection - Performs automatic dependency injection by resolving class constructor parameters through type-hint inspection.
  • Inversion-of-Control Containers - Automates the lifecycle and wiring of application objects to simplify complex dependency graphs.
  • Configuration Builders - Offers a chainable interface for defining service mappings that allows developers to override or extend definitions through modular configuration.
  • Lazy Loading - Defers the instantiation of heavy objects by injecting lightweight placeholders that trigger actual creation only upon first access.
  • Dynamic Method Invokers - Invokes callables and methods by automatically injecting required dependencies from a central registry to simplify complex logic.
  • Custom Object Instantiation - Provides lazy object instantiation using a factory pattern that resolves missing constructor dependencies only when they are needed.
  • Callable Wiring - Provides mechanisms for binding container providers directly to functions or methods to enable automatic dependency injection at runtime.
  • Modular Configuration Composition - Supports merging multiple configuration files and overriding existing definitions to extend or replace service registrations within complex architectures.
  • Native Code Configurations - Allows defining dependency mappings using standard language syntax to gain access to editor features like auto-completion and static analysis.
  • Recursive Dependency Resolution - Traverses the dependency graph by resolving nested requirements until all objects in the chain are fully instantiated.
  • Service Locators - Provides a registry for centralized access to application services and objects to decouple components from their concrete implementations.
  • Modular Application Architectures - Facilitates modular application architecture by composing multiple configuration files to override or extend service definitions across modules.

Star 历史

php-di/php-di 的 Star 历史图表php-di/php-di 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

包含 PHP DI 的精选搜索

收录 PHP DI 的精选合集。
  • PHP Dependency Injection Libraries

PHP DI 的开源替代方案

相似的开源项目,按与 PHP DI 的功能重合度排序。
  • ets-labs/python-dependency-injectorets-labs 的头像

    ets-labs/python-dependency-injector

    4,805在 GitHub 上查看↗

    This is a dependency injection framework and inversion of control container for Python. It decouples object creation from business logic by managing how services and their dependencies are assembled, delivered, and linked within an application. The framework is distinguished by its ability to perform automated component wiring, using import hooks and decorators to inject dependencies into functions and classes across different modules. It supports non-blocking flows through an asynchronous dependency resolver and manages the initialization and shutdown sequences of shared external resources a

    Pythonaiohttpasynciodependency-injection
    在 GitHub 上查看↗4,805
  • uber-go/fxuber-go 的头像

    uber-go/fx

    7,354在 GitHub 上查看↗

    Fx is a dependency injection framework and application lifecycle manager for Go. It functions as a component model container that automates the instantiation and connection of components by analyzing constructor parameters and return values to resolve complex dependency graphs. The framework distinguishes itself through module-based component bundling, which encapsulates related constructors into reusable units to manage visibility and logic. It provides advanced resolution capabilities, including mapping concrete types to interfaces for decoupling, resolving dependency ambiguities via unique

    Goapp-frameworkdependency-injectionframework
    在 GitHub 上查看↗7,354
  • microsoft/tsyringemicrosoft 的头像

    microsoft/tsyringe

    5,960在 GitHub 上查看↗

    tsyringe is a TypeScript dependency injection container and inversion of control framework. It decouples class implementations from object creation by managing dependencies and object lifecycles using decorators and metadata. The framework features a hierarchical container system where child containers can maintain independent registration scopes and fall back to parent containers for dependency resolution. It provides a provider system that controls object longevity through singleton and transient instantiation rules. The system supports recursive constructor injection and handles circular

    TypeScriptcontainerdecoratorsdependency
    在 GitHub 上查看↗5,960
  • jeffijoe/awilixjeffijoe 的头像

    jeffijoe/awilix

    4,088在 GitHub 上查看↗

    Awilix is a JavaScript dependency injection framework and inversion of control container. It provides a centralized system for registering and resolving services, decoupling application components by automating how dependencies are created and passed to the functions or classes that require them. The framework features an automatic module loader that scans the filesystem using glob patterns to register dependencies based on filenames and exports. It supports parameter-name-based injection and proxy-based resolution to manage how dependencies are delivered to constructors and functions. The s

    TypeScriptawilixdependency-injectionioc
    在 GitHub 上查看↗4,088
查看 PHP DI 的所有 30 个替代方案→

常见问题解答

php-di/php-di 是做什么的?

PHP-DI is an inversion of control container designed to manage object lifecycles and dependency resolution within PHP applications. It functions as a centralized registry that automates the wiring of components, allowing for the decoupling of services from their concrete implementations.

php-di/php-di 的主要功能有哪些?

php-di/php-di 的主要功能包括:Dependency Injection Containers, Reflection-Based Dependency Resolution, Dependency Injection Frameworks, Automatic Constructor Injection, Inversion-of-Control Containers, Configuration Builders, Lazy Loading, Dynamic Method Invokers。

php-di/php-di 有哪些开源替代品?

php-di/php-di 的开源替代品包括: ets-labs/python-dependency-injector — This is a dependency injection framework and inversion of control container for Python. It decouples object creation… uber-go/fx — Fx is a dependency injection framework and application lifecycle manager for Go. It functions as a component model… microsoft/tsyringe — tsyringe is a TypeScript dependency injection container and inversion of control framework. It decouples class… jeffijoe/awilix — Awilix is a JavaScript dependency injection framework and inversion of control container. It provides a centralized… typestack/typedi — TypeDI is a TypeScript dependency injection container and inversion of control tool. It functions as a centralized… fuzhengwei/small-spring — Small-Spring is a simplified Java implementation of the Spring framework designed to study the internal architecture…