Download the PHP package heyday/symfony-autoinject without Composer

On this page you can find all versions of the php package heyday/symfony-autoinject. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package symfony-autoinject

Symfony AutoInject

Build Status

Symfony AutoInject provides opt-in service auto-injection for Symfony Dependency Injection.

Installation (with composer)

$ composer require heyday/symfony-autoinject

Usage

Opting into auto-injection is achieved via two service tags "autoinject" and "autoinject.provides"

The tags are used as follows:

"autoinject"

Example: { name: autoinject }

Example: { name: autoinject, arguments: true, setter: true, adder: true }

When "all" is set to true or when no extra arguments are provided, the below settings all apply

When "arguments" is set to true the compiler pass will attempt to find services for the arguments, and provides if they are found and error if not. Parameters that can't be auto-injected need to be provided manually.

Both "setter", "arguments" and "adder" are optional

When "setter" is set to true, the compiler pass will attempt to find provided services that match the argument of setters found on the class

When "adder" is set to true the compiler pass will attempt to find services that match the argument of adder methods found of the class, and it will add a method call to the adder for each service found

"autoinject.provides"

Example: { name: autoinject.provides }

Example: { name: autoinject.provides, interfaces: true, classes: true }

When "all" is set to true or when no extra arguments are provided, the below settings all apply

Both "interfaces" and "class" are optional

When "interfaces" is set to true, the compiler pass will register the service as providing an instance of all interfaces that the class implemented, so when interfaces are encountered in arguments, setters and adders; the provided service will be supplied

When "classes" is set to true, the compiler pass will register the service as providing an instance of that class and parent classes, so when a class of the same type is encountered in a arguments, setter or add; the provided service will be supplied

Putting it all together

Constructor injection

The classes

The configuration

In this example, my_service provides itself as a service instance of the class Service and my_service2 requests auto-injection.

These tags result in the compiler pass seeing that my_service2 is requesting auto-injection, that it has a constructor that expects an instance of Service and that there is a instance of Service provided by my_service. The auto-injection is resolvable and the container is configured to provide my_service to my_service2 via constructor injection.

Unit testing

$ composer install --dev
$ vendor/bin/phpunit

All versions of symfony-autoinject with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
symfony/dependency-injection Version ~2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package heyday/symfony-autoinject contains the following files

Loading the files please wait ....