Download the PHP package eppo/php-sdk without Composer

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

Eppo PHP SDK

Run Tests

Eppo is a modular flagging and experimentation analysis tool. Eppo's PHP SDK is built to make assignments in multi-user server side contexts, compatible with PHP 7.3 and above. Before proceeding you'll need an Eppo account.

Features

Installation

Quick start

Begin by initializing a singleton instance of Eppo's client. Once initialized, the client can be used to make assignments anywhere in your app.

Initialize once

Assign anywhere

Select a Bandit Action

This SDK supports Multi-armed Contextual Bandits.

Assignment functions

Every Eppo flag has a return type that is set once on creation in the dashboard. Once a flag is created, assignments in code should be made using the corresponding typed function:

Each function has the same signature, but returns the type in the function name. For booleans use getBooleanAssignment, which has the following signature:

Initialization options

The init function accepts the following optional configuration arguments.

Option Type Description Default
cache Instance of PSD-16 SimpleInterface Cache used to store flag configuration. If not passed, FileSystem cache will be used null
assignmentLogger AssignmentLogger/IBanditLogger Logs assignment events back to data warehoouse null
httpClient ClientInterface For making HTTP requests. If not passed, Discovery will attempt to autoload an applicable pacakge null
requestFactory RequestFactoryInterface Instance of PSR-17 Factory. If not passed, Discovery will be used to find a suitable implementation null

Assignment logger

To use the Eppo SDK for experiments that require analysis, pass in an implementation of the LoggerInterface to the init function on SDK initialization. The SDK invokes the callback to capture assignment data whenever a variation is assigned. The assignment data is needed in the warehouse to perform analysis.

The code below illustrates an example implementation of a logging callback using Segment, but you can use any system you'd like. The only requirement is that the SDK receives a logAssignment callback function. Here we define an implementation of the Eppo AssignmentLogger interface containing a single function named logAssignment:

Bandit Action Logging

When using Bandits, a different logging method is called. Your logging class must implement IBanditLogger instead of LoggerInterface.

Background Polling

To make the experience of using the library faster, there is an option to start a background polling for randomization params. This background job will start calling the Eppo API, updating the config in the cache.

For this, create a file, e.g. eppo-poller.php with the contents:

after this, run this script by:

This will start an indefinite process of polling the Eppo-api.

Troubleshooting

HTTP

This package uses the php-http/discovery package to automatically locate implementations of the various HTTP related PSR interfaces (ex: ClientInterface, RequstFactory, etc.). If your project does not depend on any library which can fulfill this need, you may see an exception such as follows.

Fatal error: Uncaught Http\Discovery\Exception\DiscoveryFailedException: Could not find resource using any discovery strategy.

To solve this, simply require a suitable package, such as guzzle

composer require guzzlehttp/guzzle:^7.0

Philosophy

Eppo's SDKs are built for simplicity, speed and reliability. Flag configurations are compressed and distributed over a global CDN (Fastly), typically reaching your servers in under 15ms. Server SDKs continue polling Eppo’s API at 30-second intervals. Configurations are then cached locally, ensuring that each assignment is made instantly. Evaluation logic within each SDK consists of a few lines of simple numeric and string comparisons. The typed functions listed above are all developers need to understand, abstracting away the complexity of the Eppo's underlying (and expanding) feature set.


All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
psr/simple-cache Version 3.*
shrikeh/teapot Version ^2.3
composer/semver Version ^3.4
php-http/discovery Version ^1.17
webclient/ext-redirect Version ^2.0
symfony/cache Version ^6.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 eppo/php-sdk contains the following files

Loading the files please wait ....