2017 © Pedro Peláez
 

library dependency-injection

image

doraemons/dependency-injection

  • Monday, August 1, 2016
  • by parkshinhye
  • Repository
  • 2 Watchers
  • 0 Stars
  • 30 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

DependencyInjection

目录

-简介 -安装 -使用 -ServiceProvider -Facade, (*1)

简介

本插件来自 Laravel 5.2, 能够实现 ServiceProvider,Facade !, (*2)

关于 phpunit 这个问题,我想说代码 98% 甚至 99% 都是复制 ,所以感觉没必要!!, (*3)

安装

composer require doraemons/dependency-injection@dev-master

使用

Config

<?php 


$config = [
   'providers' => [
         ...
   ],
   'facades' => [
        'Doraemons' => Illuminate\Support\Facades\App::class,
        'DoraemonsConfig' => Illuminate\Support\Facades\Config::class,
        ....
   ]

]

  1. 初始化
<?php
require_once __DIR__.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php';

use Doraemons\DependencyInjection\Container;

$app = new Container($config);

  1. 添加 ServiceProvider

更多用法参见 laravel-ServiceProvider, (*4)

  1. 添加 Facade

更多用法参见 laravel-Facade, (*5)

The Versions

01/08 2016

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar parkshinhye