Download the PHP package alchemy/lazy-command-bundle without Composer

On this page you can find all versions of the php package alchemy/lazy-command-bundle. 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 lazy-command-bundle

lazy-command-bundle

Bundle for better dependency injection with Symfony commands

Installing

As simple as running a command in your terminal:

composer require alchemy/lazy-command-bundle.

Of course, you will also need to have Composer installed beforehand.

Usage

Just add the bundle to your kernel. For now, it's zero-config, hassle free proxy goodness.

Background

Using commands as services in Symfony can be quite a pain as soon as your dependencies start using connections to various resources (database, message queues, what not...), as all commands have to be instantiated in order for a Symfony Console application to run properly.

This bundle is an attempt to solve this by replacing all the service dependencies of your commands by lazy proxies (using the excellent ProxyManager library), ensuring that external resources are only acquired as needed.

Another approach could be to mark the dependencies of your commands as lazy using Symfony DI's built-in features, but this approach is not optimal when your dependencies are re-used in multiple contexts (ie, a service that is used both by a console application and a web application) and a proxy is not required (or worse, is a performance penalty) in all contexts.

How it works

The bundle adds a compiler pass to your service container's build process, replacing all service references by lazy proxies for services that are tagged with the console.command tag.

There is no performance penalty in HTTP contexts (unless you actually use your commands in your controllers, but you probably have bigger issues to worry about then).

There are no benchmarks for now, but proxifying your command dependencies is probably cheaper than actually acquiring external resources that won't be used.

Todo


All versions of lazy-command-bundle with dependencies

PHP Build Version
Package Version
Requires ocramius/proxy-manager Version ^1.0
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 alchemy/lazy-command-bundle contains the following files

Loading the files please wait ....