2017 © Pedro Peláez
 

package fcphp-provider

Provider Manager for FcPHP

image

00f100/fcphp-provider

Provider Manager for FcPHP

  • Sunday, June 24, 2018
  • by 00F100
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

FcPHP Provider

Package do manage providers. This package use FcPhp Di to inject dependency., (*1)

Build Status codecov Total Downloads, (*2)

How to install

Composer:, (*3)

$ composer require 00f100/fcphp-provider

or composer.json, (*4)

{
    "require": {
        "00f100/fcphp-provider": "*"
    }
}

How to use

Create class extends IProviderClient to inject dependencies of your application

<?php

namespace Some\Example
{
    use FcPhp\Di\Interfaces\IDi;
    use FcPhp\Provider\Interfaces\IProviderClient;

    class ProviderClientExample implements IProviderClient
    {
        /**
         * Method to configure Di in providers
         *
         * @param FcPhp\Di\Interfaces\IDi $di Di Instance
         * @return void
         */
        public function getProviders(IDi $di) :IDi
        {
            $di->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

use FcPhp\Di\Facades\DiFacade;
use FcPhp\Provider\Facades\ProviderFacade;

$PathCache = 'tests/var/cache';
$pathToAutoload = 'tests/*/*/config';

$provider = ProviderFacade::getInstance($pathToAutoload, $PathCache);
$di = DiFacade::getInstance();

// Add new provider to process
$provider->addProviders(['Some\Example\ProviderClientExample']);

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

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

The Versions

24/06 2018

dev-master

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

Provider Manager for FcPHP

  Sources   Download

The Requires

 

The Development Requires

manager provider fcphp

24/06 2018
24/06 2018
13/06 2018

0.1.1

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

Provider Manager for FcPHP

  Sources   Download

The Requires

 

The Development Requires

manager provider fcphp

13/06 2018

0.1.0

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

Provider Manager for FcPHP

  Sources   Download

The Requires

 

The Development Requires

manager provider fcphp