Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/00f100/fcphp-provider

Package do manage providers. This package manupulate inject dependency. Have cache and autoloading composer packages.
https://github.com/00f100/fcphp-provider

autoload autoloader autoloading cache fcphp fcphp-di php7 provider

Last synced: 5 days ago
JSON representation

Package do manage providers. This package manupulate inject dependency. Have cache and autoloading composer packages.

Awesome Lists containing this project

README

        

# FcPHP Provider

Package do manage providers. This package use [FcPhp Di](https://github.com/00f100/fcphp-di) to inject dependency.

[![Build Status](https://travis-ci.org/00F100/fcphp-provider.svg?branch=master)](https://travis-ci.org/00F100/fcphp-provider) [![codecov](https://codecov.io/gh/00F100/fcphp-provider/branch/master/graph/badge.svg)](https://codecov.io/gh/00F100/fcphp-provider) [![Total Downloads](https://poser.pugx.org/00F100/fcphp-provider/downloads)](https://packagist.org/packages/00F100/fcphp-provider)

## How to install

Composer:
```sh
$ composer require 00f100/fcphp-provider
```

or composer.json
```json
{
"require": {
"00f100/fcphp-provider": "*"
}
}
```

## How to use

#### Create class extends `IProviderClient` to inject dependencies of your application
```php
set('Class', '\Class', [], ['SetConfiguration', => ['item1', 'item2', 'item3']]);
$di->set('Class2', '\Class', ['instance' => $this->get('Class')]);
return $di;
}
}
}
```

#### Create new instance of IProvider to process providers
```php
addProviders(['Some\Example\ProviderClientExample']);

// Execute ...
$provider->make();

// Now instance of di have configuration ...
$di->make('Class2'); // Return new \Class(new \Class()) ....
```