2017 © Pedro Peláez
 

library ltcommons-bundle

LtCommons bundle for Symfony 2

image

ubc/ltcommons-bundle

LtCommons bundle for Symfony 2

  • Friday, April 22, 2016
  • by compass
  • Repository
  • 10 Watchers
  • 0 Stars
  • 396 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

LtCommons Bundle for Symfony 2

Installation

composer require ubc/ltcommons-bundle

Usage

With Symfony 2

First, enable the Bundle, (*1)

// app/AppKernel.php

class AppKernel extends Kernel
{
    // ...

    public function registerBundles()
    {
        $bundles = array(
            // ...,
            new UBC\LtCommonsBundle\LtCommonsBundle(),
        );

        // ...
    }
}

Then, add configuration in Configuration section to your app/config_*.yml, (*2)

With DI container

require 'vendor/autoload.php';

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;

// Bootstrap the JMS custom annotations for Object to Json mapping
\Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace(
    'JMS\Serializer\Annotation',
    dirname(__FILE__).'/vendor/jms/serializer/src'
);

$container = new \Symfony\Component\DependencyInjection\ContainerBuilder();
$container->registerExtension(new \UBC\LtCommons\UBCLtCommonsExtension());

$loader = new YamlFileLoader($container, new FileLocator(__DIR__));
$loader->load('config.yml');

$container->compile();

$codes = $container->get('ubc_lt_commons.service.department_code')->getDepartmentCodes();

Configuration

ubc_lt_commons:
  providers:
    sis:
      base_url: http://sisapi.example.com
      auth:
        module: auth2
        rpc_path: /auth/rpc
        username: service_username 
        password: service_password 
        service_application: service_app
        service_url: https://www.auth.stg.id.ubc.ca
      http_client: Guzzle
      serializer: JMS
    xml:
      path: /path/to/data
      serializer: JMS

The Versions