2017 © Pedro Peláez
 

library sixpack-php

Sixpack A/B testing framework client

image

jippi/sixpack-php

Sixpack A/B testing framework client

  • Tuesday, January 14, 2014
  • by jippi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 328 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 14 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Latest Stable Version, (*1)

Sixpack

PHP client library for SeatGeak's Sixpack ab testing framework., (*2)

Installation

Simply clone the project and include sixpack.php to your PHP Project, (*3)

Usage

ALL THIS IS OUT OF DATE, (*4)

Basic example:, (*5)

The PHP client stores a unique client id in the current user's cookie by default., (*6)

$sp = new \Seatgeek\Sixpack\Session;
$alt = $sp->participate('test', array('blue', 'red'))->getAlternative();
if ($alt == 'blue') {
    /* do something blue */
} else {
    /* do somethign red */
}

Each session has a client_id associated with it that must be preserved across requests. The PHP client handles this automatically. If you'd wish to change that behavoir, you can do so like this:, (*7)

$sp = new \Seatgeek\Sixpack\Session;
$resp = $sp->participate("new-test", array("alternative-1", "alternative-2"));
store_in_database("sixpack-id", $resp->getClientId());

For future requests, create the Session using the client_id stored in the cookie:, (*8)

$client_id = get_from_database("sixpack-id")
$sp = new \Seatgeek\Sixpack\Session(array('clientId' => $client_id));

$sp->convert('new-test');

Other possible options for the Session constructor are: * baseUrl - Sixpack Server's location on the web * cookiePrefix - you can set a different prefix for the cookie if you like. Default is sixpack, (*9)

If you'd like to force the Sixpack server to return a specific alternative for development or testing, you can do so by passing a query parameter named sixpack-force to that page being tested., (*10)

http://example.com/?sixpack-force-<experiment name>=<alternative name>, (*11)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

The Versions

14/01 2014

dev-master

9999999-dev

Sixpack A/B testing framework client

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.5.0

 

by Zack Kitzmiller

api sixpack

14/01 2014

dev-develop

dev-develop

Sixpack A/B testing framework client

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.5.0

 

by Zack Kitzmiller

api sixpack

14/01 2014

v1.0.2

1.0.2.0

Sixpack A/B testing framework client

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.5.0

 

by Zack Kitzmiller

api sixpack

14/01 2014

v1.0.1

1.0.1.0

Sixpack A/B testing framework client

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.5.0

 

by Zack Kitzmiller

api sixpack