minetro/service-autoloader

This package is abandoned and no longer maintained. The author suggests using the contributte/di package instead.

Service autoloader for Nette Framework

dev-master 2016-12-09 15:51 UTC

This package is not auto-updated.

Last update: 2019-02-20 18:59:08 UTC


README

Automatic autoload service by interface or annotation.

Build Status Code coverage Downloads total Latest stable HHVM Status

Discussion / Help

Join the chat

Contributte

This package is no longer developed here. In favor of contributte/di.

Install

composer require minetro/service-autoloader

Usage

extensions:
    autoload: Minetro\Autoloader\DI\ServiceAutoloadExtension

By default

This configuration is enabled by default.

autoload:
    dirs:
        - %appDir%

    annotations:
        - @Service
        
    interfaces:
        - Minetro\Autoloader\AutoloadService

    decorator:
        inject: off

Custom

You can override all configuration settings you want to.

autoload:
    dirs:
        - %appDir%
        - %libsDir%
        - %fooDir%

    annotations:
        - @Service
        - @MyCustomService
        
    interfaces:
        - Minetro\Autoloader\AutoloadService
        - App\Model\MyAutoloadServiceInterface

    decorator:
        inject: on / off

Performance

Service loading is triggered only once at dependency injection container compile-time. You should be pretty fast, almost as official registering presenter as services.

Thanks for testing, reporting and contributing.