Download the PHP package spiechu/lazy-pimple without Composer

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

Lazy Pimple

Lazy service definitions for Pimple DI container.

Travis build status: Build Status

Other fancy badges: Scrutinizer Code Quality Code Coverage

Intro

When using Pimple DIC, there is sometimes need to lazy load service and instantiate it only when needed. What's more, there is also possibility to lazy load event subscribers. (Now you'll see why \Symfony\Component\EventDispatcher\EventSubscriberInterface has static interface).

Under the hood this library uses Proxy Manager. Object's proxy is firstly generated. Until instance method call is needed, the proxy is being used. This means even static calls don't need object's instance and are called by proxy.

Installation

Simplest way is to add "spiechu/lazy-pimple": "~0.1" to your composer.json.

The minimal configuration for lazy loads to work is to add two definitions to your Pimple:

In order to use ProxyManager proxy cache, LazyLoadingValueHolderFactoryFactory->getFactory() accepts dir path to writable space where it can dump generated proxy class definitions. You can see how to do it in the full listing at the bottom of this page.

Usage

Lazy services

With use of this library, you can easy lazy load Pimple service definitions until they're needed.

Lazy event subscribers

We'll start with typical event subscriber definition.

Now by using \Pimple\ServiceProviderInterface service provider we can transform subscribers into lazy loaded.

This way only when event actually took place, subscriber is instantiated and event handle method called.

Example Pimple service definition (taken from my "tests").


All versions of lazy-pimple with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
ocramius/proxy-manager Version ~1.0|~2.0
pimple/pimple Version ~2.1|~3.0
symfony/event-dispatcher Version ~3.0|~4.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 spiechu/lazy-pimple contains the following files

Loading the files please wait ....