itkg/consumer-bundle

WS consumer bundle

v1.0.0 2015-05-15 08:53 UTC

This package is not auto-updated.

Last update: 2024-04-27 15:40:14 UTC


README

WS Consumer Bundle on top

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight

This bundle provide some utilities on top of itkg-consumer library

  • Consumer Service definition
  • Simple UI to configure Consumer services (proxy, authentication, action / desactivation, cache, etc.)

Installation

Installation by Composer

If you use composer, add ItkgConsumerBundle bundle as a dependency to the composer.json of your application

    "require": {
        "itkg/consumer-bundle": "dev-master"
    },
  • Add ItkgConsumerBundle to your application kernel.
// app/AppKernel.php
<?php
    // ...
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Itkg\ConsumerBundle\ItkgConsumerBundle(),
        );
    }
  • Activate bundle config in application's config.yml file by addng :
itkg_consumer: ~
  • Load routing in your routing.yml file
ItkgConsumerBundle:
    resource: "@ItkgConsumerBundle/Resources/config/routing.yml"
    prefix:   /admin

Usage

Service definition example

rest_client:
    class: %itkg_consumer.client.rest.class%
my_service:
    class: %itkg_consumer.service.class%
    arguments:
        - @event_dispatcher
        - @rest_client
        - { identifier: my_service_identifier }
    tags: 
        - { name: itkg_consumer.service }

With specific "itkg_consumer.service" tag, service will be automatically loaded in service list UI

Getting service from container

$myService = $container
    ->get('itkg_consumer.manager.service')
    ->find('my_service_identifier');

## Todo

  • Add tests
  • Debug utilities
  • WS profiling
  • Improve doc
  • Add more tests