PHPackages                             umich-its-tl/caliper-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. umich-its-tl/caliper-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

umich-its-tl/caliper-php
========================

Caliper PHP Library

1.0.1(10y ago)36.8k2proprietaryPHPPHP &gt;=5.4

Since Oct 20Pushed 10y ago8 watchersCompare

[ Source](https://github.com/tl-its-umich-edu/caliper-php-public)[ Packagist](https://packagist.org/packages/umich-its-tl/caliper-php)[ Docs](http://www.imsglobal.org)[ RSS](/packages/umich-its-tl-caliper-php/feed)WikiDiscussions public Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

caliper-php
===========

[](#caliper-php)

caliper-php is a PHP client for [Caliper](http://www.imsglobal.org) that provides an implementation of the Caliper SensorAPI™.

Getting Started
---------------

[](#getting-started)

### Pre-requisites for development

[](#pre-requisites-for-development)

- PHP 5.4 required (PHP 5.6 recommended)
- Install Composer (for dependency management): `curl -sS https://getcomposer.org/installer | php`
- Install dependencies: `php composer.phar install`
- Run tests using the Makefile: `make test-caliper`

    The tests require that the `caliper-common-fixtures-public` project be installed in the same parent directory as `caliper-php-public`. It is available at:

### Installing and Using the Library

[](#installing-and-using-the-library)

- Installing: There are two ways to install caliper-php. Either install by cloning the IMS Global public version of the caliper-php GitHub repository or use Composer to install from that same repository. The steps for each method are explained below:

    - Cloning caliper-php-public from GitHub

        - Clone the repository from GitHub into your application's directory

            ```
            git clone https://github.com/IMSGlobal/caliper-php-public.git
            ```
        - Add the following to your PHP program:

            ```
            require_once '/path/to/caliper-php/lib/Caliper/Sensor.php';
            ```
    - Use Composer to install caliper-php-public from GitHub

        - Update the `composer.json` file in the root directory of your project as follows:

            - The `require` section should include the following:

                ```
                {
                    "require": {
                        "php": ">=5.4",
                        "ims-global/caliper-php-public": "1.0.0"
                    }
                }
                ```
            - The `repositories` section should include the following:

                ```
                {
                    "repositories": [
                        {
                            "type": "vcs",
                            "url": "https://github.com/IMSGlobal/caliper-php-public.git"
                        }
                    ]
                }
                ```

            ***NOTE*** - These package and repository values will not work at this time with the IMS Global repositories. The `composer.json`file in caliper-php-public doesn't contain the correct entries. This should be corrected with an update in the near future. For U-M purposes, substitute the following values for the package and repository, respectively:

            ```
            "umich-its-tl/caliper-php": "1.0.1"
            ```

            ```
            "url": "https://github.com/tl-its-umich-edu/caliper-php-public"
            ```

            This version of caliper-php-public has been modified for U-M use. It includes a new `Options::setHttpHeaders()` feature.
        - Use Composer to install the package with the command:

            ```
            composer install
            ```

            Composer will create the `vendor` directory to hold the package and other related information.
        - Composer will create PHP classes to help you load Caliper (and any other packages it has loaded) into your application. In your PHP code, use it like:

            ```
            /*
             * If necessary, use set_include_path() to ensure the directory
             * containing the "vendor" directory is in the PHP include path.
             */
            require_once 'vendor/autoload.php';  // Composer loader for Caliper, etc.
            ```
- After installing Caliper using one of the methods decribed above, initialize it and send an event as follows:

    ```
    // Create Caliper sensor object
    $sensor = new Sensor('your_sensor_id');
    // Set sensor options
    $options = (new Options())
        ->setApiKey('your_authentication_key_for_the_datastore')
        ->setDebug(true)
        ->setHost('http://example.org/dataStoreURI');
    // Register a network transport for the sensor
    $sensor->registerClient('your_http_transport_id',
        new Client('your_client_id', $options));
    // TODO: Define $yourCaliperEventObject
    // Send a Caliper event object
    $sensor->send($sensor, $yourCaliperEventObject);
    ```

    Your PHP program needs to create a sensor object only once per request. The sensor object can be reused to send multiple events within the same request.

### Running an example

[](#running-an-example)

A simple example program can be found in `examples/SessionEventSampleApp.php`.

It will attempt to send an event to a data store listener on localhost:8000. If you have a data store on some other host or port, you can edit the program to use it instead. If you don't have a data store, you can run a simple listener program included in:

```
examples/tools/testListener.sh [optional_port]

```

That will start a simple PHP web server (on port 8000 by default) that listens for POST requests and dumps the raw contents to the terminal. If you run this in one terminal window and the example program in another terminal window, you will see the request received in the first window.

Documentation
-------------

[](#documentation)

Documentation is available at [http://www.imsglobal.org/caliper](https://www.imsglobal.org/caliper).

caliper-php-public includes as much documentation as possible in the form of PHPDoc comments. These may appear as pop-up help in many IDEs. phpDocumentor may be used to turn them into standalone documents.

Credits
-------

[](#credits)

A very special thank you to each of the developers that contributed to this project:

- Prashant Nayak, Intellify Learning
- balachandiran.v / Yoganand-htc
- Lance E Sloan (lsloan at umich dot edu), University of Michigan

©2015 IMS Global Learning Consortium, Inc. All Rights Reserved. Trademark Information -

For license information contact,  and read the LICENSE file contained in the repository.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~98 days

Total

2

Last Release

3806d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.3

1.0.1PHP &gt;=5.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20786?v=4)[Mr. Lance E Sloan «UMich»](/maintainers/lsloan)[@lsloan](https://github.com/lsloan)

---

Top Contributors

[![lsloan](https://avatars.githubusercontent.com/u/20786?v=4)](https://github.com/lsloan "lsloan (329 commits)")[![LMattson](https://avatars.githubusercontent.com/u/3170517?v=4)](https://github.com/LMattson "LMattson (8 commits)")[![arwhyte](https://avatars.githubusercontent.com/u/83268?v=4)](https://github.com/arwhyte "arwhyte (7 commits)")[![pnayak](https://avatars.githubusercontent.com/u/395233?v=4)](https://github.com/pnayak "pnayak (4 commits)")[![Yoganand-htc](https://avatars.githubusercontent.com/u/7734205?v=4)](https://github.com/Yoganand-htc "Yoganand-htc (4 commits)")

---

Tags

learning-analyticscaliper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/umich-its-tl-caliper-php/health.svg)

```
[![Health](https://phpackages.com/badges/umich-its-tl-caliper-php/health.svg)](https://phpackages.com/packages/umich-its-tl-caliper-php)
```

###  Alternatives

[dan-da/coinparams

provides crypto currency specific information such as version numbers, DNS seeds, etc, available in JSON format

3652.3k6](/packages/dan-da-coinparams)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
