cekurte/silex-manager-provider

A silex service provider that adds Manager to loader other service providers

v0.0.5 2015-12-07 11:57 UTC

This package is auto-updated.

Last update: 2022-11-15 23:14:31 UTC


README

Build Status Code Climate Coverage Status Latest Stable Version License SensioLabsInsight

  • A simple silex service provider (covered by php unit tests) that adds a Manager to register other Service Providers to increase the power of your application, contribute with this project!

Installation

The package is available on Packagist. The source files is PSR-2 compatible. Autoloading is PSR-4 compatible.

composer require cekurte/silex-manager-provider

Documentation

To use this library you need register the Cekurte\Silex\Manager\Provider\ManagerServiceProvider. See also the library Environment cekurte/environment.

<?php

use Cekurte\Environment\Environment;
use Cekurte\Silex\Manager\Provider\ManagerServiceProvider;

// ...
$app['cekurte.manager.providers'] = [
    // ...
    'Silex\Provider\SessionServiceProvider' => [
        'register' => true,
    ],
    'Silex\Provider\SwiftmailerServiceProvider' => [
        'register' => true,
        'type'     => 'array',
        'src'      => [
            'swiftmailer.use_spool' => Environment::get('SWIFTMAILER_USE_SPOOL'),
            'swiftmailer.options'   => [
                'host'       => Environment::get('SMTP_HOST'),
                'port'       => Environment::get('SMTP_PORT'),
                'username'   => Environment::get('SMTP_USERNAME'),
                'password'   => Environment::get('SMTP_PASSWORD'),
                'encryption' => Environment::get('SMTP_ENCRYPTION'),
                'auth_mode'  => Environment::get('SMTP_AUTH_MODE'),
            ],
        ],
    ],
    // ...
];

$app->register(new ManagerServiceProvider());

// ...

If you liked of this library, give me a star =).

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Make your changes
  4. Run the tests, adding new ones for your own code if necessary (vendor/bin/phpunit)
  5. Commit your changes (git commit -am 'Added some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request