Download the PHP package dose/laravelfeature without Composer

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

LaravelFeature

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Rampup and AB testing library inspired by Etsy\Feature for Laravel.

How to use

After you have added this package to your composer file you will need to register it's Service Provider.

You also want to publish configuration so you can define your features.

To gain access to the API you need to resolve an instance out of the Service Container.

Of course, dependency injection can also be used.

Get Variant

This will return a selected variant. It may also return NULL if the feature does not exist or if none of the variants were selected (features with incomplete coverage).

Set Context

This is not something commonly used but it lets you change the context in which a variant is selected. By default, user's session id is used. This means that the variant will be the same for the span of the session.

Sometimes you might want to rotate variants based on different criteria. For example, if you want all posts by a certain author to have a set of features consistent for all users. You can do that by setting the context.

AB Testing

It is a common use case to run multiple AB tests with multiple variants at the same time. In order to get valuable test results, only one test can be active at once. In order to achieve this, you need to define a wrapper feature. The variants will represent each test.

This allows us to check if a particular test is active and then retrieve it's variant.

Config

There are two configuration files that you can use to control the behavior.

config.php

In this file, you can specify if you want users to be able to override the variant selection with a specific URL parameter.

This is disabled by default. You may control who can use the URL override by defining your own logic.

features.php

All your features are defined here.

There is a ton of flexibility in defining features. We will start with the most verbose and then work down.

Each feature can have any number of variants with each variant defining it's own odds.

In the above example, each variant has the specified chance of being selected. Variants with odds below 0 are normalized to 0. The variants are processed top to bottom. If the sum of odds exceeds 100 the feature is saturated and any variants above that threshold have no chance of being selected.

The above feature will always return variant_a.

You can omit the odds and just specify the variants. In this case, the variants are evenly spread out.

In this case, both variants have 50% chance of being selected.

These approaches can be mixed. It is important to note that variants with specified odds will be processed first and then any remaining odds are distributed among the auto-scaled variants.

The first variant has 50% chance of coming up while the other two have 25% chance each.

To specify a simple ON/OFF feature we just include a single variant.

This feature is always on. We can adjust the odds to turn it off completely or achieve a ramp-up functionality.

It is also possible to shorten the above example by just defining the odds for the feature itself.

This feature will be on for 50% of the users.

URL override

If the URL override is enabled you can force a particular variant by specifying it in the URL


All versions of laravelfeature with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version 4.* || 5.*
illuminate/config Version 4.* || 5.*
illuminate/session Version 4.* || 5.*
illuminate/http Version 4.* || 5.*
dose/feature 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 dose/laravelfeature contains the following files

Loading the files please wait ....