定制 samburns/dirty-needle 二次开发

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

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

samburns/dirty-needle

最新稳定版本:3.0.3

Composer 安装命令:

composer require samburns/dirty-needle

包简介

Dependency Injection container for PHP

README 文档

README

Build Status Coverage Status Scrutinizer Code Quality

dirty-needle

Introduction

Dependency Injection container for PHP

Set up a config file which returns a PHP array, like this:

<?php
return array(
    'dirty-needle' => array(
        '@dependency' => array(
            'class' => '\Dependency'
        ),
        '@class-with-dependency' => array(
            'class' => '\ClassWithDependency',
            'arguments' => array(
                '@dependency'
            )
        ),
    ),
);

Then get stuff out of your container, like this:

$diContainer = \DirtyNeedle\DiContainer()::getInstance();
$diContainer->addConfigFile('/path/to/config.php');
$classWithDependency = $diContainer->get('class-with-dependency');

You can also do inject mock objects:

$diContainer->set('service-id', $mockObject);

Reseting definitions and mocks:

$diContainer->reset();

Releases are available supporting PHP5.3-5.6, with the 5.6-compatible releases being significantly faster in their implementation.

Versioning

The project uses semantic versioning.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-15