Download the PHP package jgswift/delegatr without Composer

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

delegatr

PHP 5.5+ delegate system

Build Status Scrutinizer Code Quality Latest Stable Version License Coverage Status

Installation

Install via cli using composer:

Install via composer.json using composer:

Dependency

Usage

Built-in Lambda (with Serializable)

One of the cumbersome aspects of closures in php is the need to explicitly define the context variables with the "use" statement. Delegates can make that process less painful by allowing you to specify an associative array to dynamically define context.

returns a (non-referenced) list of variables defined in the same scope is called. Thus and are dynamically added the the closure's "use" statement and inserted into the closure scope at run-time.

Writing Custom Serializable Closures (using trait)

Delegatr doesn't just wrap closures in an object, it uses eval to enable the serialization of closures - something native php can not do.

The following class uses the Serializable delegate to accomplish this.

Using the above trait prevents delegatr from imposing on your domain but if that isn't a concern just instantiate or inherit the Lambda class as shown below.

Simple delegate (without serialization)

A simpler implementation is also available without \Serializable included

Eval Fallback & Vulnerability

The eval function is heavily relied on in this package.
If you are not comfortable with eval or do not understand the security risks, I do not suggest you use this package.

However, eval itself is not required for this package.
Delegatr uses adlawson/veval.php to compile scripts at run-time even in environments where eval is disabled. Bypassing eval in this way doesn't reduce the risk of code injection.


All versions of delegatr with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
jeremeamia/functionparser Version *
jgswift/qtil Version 0.1.*
adlawson/veval Version 1.*
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 jgswift/delegatr contains the following files

Loading the files please wait ....