2017 © Pedro Peláez
 

symfony-bundle di-annotations-bundle

A bundle that enables Dependency Injection by annotations into your Symfony2 projects.

image

loso/di-annotations-bundle

A bundle that enables Dependency Injection by annotations into your Symfony2 projects.

  • Thursday, December 20, 2012
  • by loicfrering
  • Repository
  • 0 Watchers
  • 14 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

LosoDiAnnotationsBundle

What is LosoDiAnnotationsBundle?

A bundle that enables Dependency Injection by annotations into your Symfony2 projects., (*1)

Build Status, (*2)

Requirements

LosoDiAnnotationsBundle requires PHP 5.3 or later. It has been tested with Symfony v2.0.4., (*3)

You will need at least the following libraries in your vendor directory:, (*4)

  • Doctrine\Common
  • Symfony

If you want to use the functionalities around entity repositories, you will also need:, (*5)

  • Doctrine\DBAL
  • Doctrine\ORM

License

The files in this archive are released under the MIT license. You can find a copy of this license in the LICENSE file., (*6)

Documentation

You can read the documentation in Resources/doc/index.rst, (*7)

Tests

LosoDiAnnotationsBundle is heavily tested! To run the tests, you'll need to set the path to the vendors libraries in Tests/bootstrap.php and run the following command from the project's root:, (*8)

phpunit --colors --bootstrap Tests/bootstrap.php Tests

Also LosoDiAnnotationsBundle uses Travis for continuous integration, see: Build Status, (*9)

Installation

1. Add LosoDiAnnotationsBundle to your vendor libraries:, (*10)

$ cp -r <path_to>/LosoDiAnnotationsBundle vendor/bundles/Loso/Bundle/DiAnnotationsBundle

Or via Git:, (*11)

$ git submodule add git://github.com/loicfrering/LosoDiAnnotationsBundle.git vendor/bundles/Loso/Bundle/DiAnnotationsBundle

2. Register Loso namespace with the autoloader in app/autoload.php:, (*12)

<?php
$loader->registerNamespaces(array(
    // ...
    'Symfony'          => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
    'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
    'Loso'             => __DIR__.'/../vendor/bundles',
    // ...
));

3. Register LosoDiAnnotationsBundle with your application's kernel in app/AppKernel.php:, (*13)

<?php
public function registerBundles()
{
    $bundles = array(
        // ...
        new Loso\Bundle\DiAnnotationsBundle\LosoDiAnnotationsBundle(),
        // ...
    );

    // ...

    return $bundles;
}

Configuration

You can configure LosoDiAnnotationsBundle in one of the following ways in app/config/config.yml:, (*14)

# app/config/config.yml
loso_di_annotations:
    service_scan:
        DemoBundle: ~
        MyBundle:
            base_namespace: [Prefix1, Prefix2\SubPrefix]
        arbitrary_key:
            dir:
                - dir1
                - dir2

The Versions

20/12 2012

dev-master

9999999-dev http://github.com/loicfrering/LosoDiAnnotationsBundle

A bundle that enables Dependency Injection by annotations into your Symfony2 projects.

  Sources   Download

MIT

The Requires

 

dependency injection annotations dependencyinjection