This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Automatically load and tag services from their respective directories

v1.1.1 2018-11-09 08:03 UTC

This package is auto-updated.

Last update: 2021-07-09 13:57:20 UTC


Autoload services to nette container


Buri/nette-autoload-services requires PHP 7.0 or higher.


The best way to install Buri/nette-autoload-services is using Composer:

$ composer require buri/nette-autoload-services


You can enable the extension using your neon config.

	serviceAutoload: Buri\NAS\DI\Extension\AutoloadingExtension

You must place this extension BEFORE any other extension that will benefit from autoloading (ie. Kdyby/Console)


This extension creates new configuration section serviceAutoload and no minimal configuration is required. Out of the box it provides support for:

If you wish to register your own directory for service autoloading, example follows:

	consoleCommands:                  # Group name must be present, but can be any valid neon identifier
		directory: %appDir%/Console     # Directory to search in, recursively (string or string[])
		mask:                           # Filename mask, only matching files will be scanned for classes (string or string[])
			- *Command.php
		tag: kdyby.console.command      # Optional, can be used to tag services (string or string[])