Download the PHP package simpleab/sdk-php without Composer

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

SimpleAB PHP SDK

This is the PHP SDK for SimpleAB, a powerful A/B testing platform by Captchify.

Installation

You can install the SimpleAB PHP SDK via Composer:

Usage

Here's a basic example of how to use the SimpleAB PHP SDK:

API Reference

SimpleABSDK

Constructor

getTreatment

Gets the treatment for a given experiment, stage, dimension, and allocation key.

trackMetric

Tracks a metric for an experiment. The $params array should include:

getSegment

Gets a segment for a user based on their IP address and user agent.

Returns a Segment object.

getTreatmentWithSegment

Gets the treatment for a given experiment, stage, segment, and allocation key.

trackMetricWithSegment

Tracks a metric for an experiment using a segment. The $params array should include:

flush

Flushes all tracked metrics to the SimpleAB API. Call this method before your script ends to ensure all metrics are sent.

Segment

The Segment class represents a user segment based on their location and device type.

File Structure

The SDK consists of the following files:

Development

To set up the project for development:

  1. Clone the repository.
  2. Run composer install to install dependencies.
  3. Make your changes in the src/SimpleABSDK.php file.
  4. Add or modify tests in the tests directory.

Running Tests

To run the unit tests for the SimpleAB PHP SDK, follow these steps:

  1. Ensure you have PHPUnit installed. It should be installed automatically when you run composer install.

  2. From the root directory of the project, run the following command:

    This will execute all the tests in the tests directory.

  3. To run a specific test file, you can specify the file name:

  4. For more detailed output, you can use the --verbose flag:

Make sure to run the tests after making any changes to the SDK to ensure that everything is working as expected.

License

This SDK is distributed under the MIT License. See the LICENSE file for more information.

Support

For support, please contact [email protected] or visit our documentation at https://captchify.com.


All versions of sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 simpleab/sdk-php contains the following files

Loading the files please wait ...