Download the PHP package sammaye/yii2-abtest without Composer

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

yii2-abtest

A simple extension for writing A/B Tests in Yii2.

This extension does not include the hooks for various programs, but does allow you to list() so you can quickly add it to your analytics code.

Installing

Simply include it from composer:

php ./composer.phar require sammaye/yii2-abtest:"@stable"

Adding it to your configuration

Easiest thing is to just show an example of my configuration:

'test' => [
    'class' => 'sammaye\abtest\Test',
    'filter' => [
        'rules' => [
            [
                'allow' => false,
                'roles' => ['staff']
            ]
        ]
    ],
    'tests' => [
        [
            'name' => 'Beta Search',
            'values' => ['old', 'new'],
            'default' => 'new'
        ]
    ]
],

The configuration breaks down into two parameters:- filter and tests.

Only tests is required.

filter allows you to use the AccessControl like you would on any controller and provide a set of rules whereby the tests should not take effect.

When an 'allow' => false filter is matched the test will return the default parameter from the test you are looking at and will not not record it in $_SESSION.

This way, when you come to list() at the end of the page to push onwards for analytics, these tests will not appear in that list.

Using it

Once it is fully configured you can just use it to detect which path a user takes:

Yii::$app->test->value('Beta Search')

This function will return either old or new depending on whether I am a staff member or lady random chooses me.

In order to add it to your analytics code you need to list all active tests and their values:

Yii::$app->test->list()

This will then print out a list of (for me):

[
    'Old Search' => [
        'name' => 'Old Search',
        'value' => 'old' // active
        // custom data could be housed 
        // here from the configuration like "goal"
    ]
]

So, the key is name of the test and the value is the configuration object but with values replaced with only the active value.


All versions of yii2-abtest with dependencies

PHP Build Version
Package Version
Requires php Version >=5.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 sammaye/yii2-abtest contains the following files

Loading the files please wait ....