PHPackages                             raphaelz/lametric-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. [API Development](/categories/api)
4. /
5. raphaelz/lametric-php

ActiveLibrary[API Development](/categories/api)

raphaelz/lametric-php
=====================

A PHP wrapper for accessing the LaMetric API.

62391[1 issues](https://github.com/raphaelz/lametric-php/issues)PHP

Since Jan 8Pushed 9y ago3 watchersCompare

[ Source](https://github.com/raphaelz/lametric-php)[ Packagist](https://packagist.org/packages/raphaelz/lametric-php)[ RSS](/packages/raphaelz-lametric-php/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

LaMetric PHP
============

[](#lametric-php)

A PHP wrapper for creating push and poll applications with the LaMetric API.

Requirements
------------

[](#requirements)

- PHP 5.3 or higher
- cURL
- Registered LaMetric developer account

Get started
-----------

[](#get-started)

To use the LaMetric API you must create a developer account and associate your device. From there, you will need to create an [Indicator App](https://developer.lametric.com/applications/createdisplay).

---

### Installation

[](#installation)

```
$ composer require raphaelz/lametric-php

```

### Initialize the class with configuration (push application)

[](#initialize-the-class-with-configuration-push-application)

```
use Lametric\Lametric;

$lametric = new Lametric(array(
    'pushURL' => 'YOUR_PUSH_URL',
    'token' => 'YOUR_TOKEN',
));
```

### Initialize the class without configuration (poll application)

[](#initialize-the-class-without-configuration-poll-application)

```
use Lametric\Lametric;

$lametric = new Lametric();
```

Available methods
-----------------

[](#available-methods)

### Change Icon

[](#change-icon)

Set the default icon before pushing a message. This only applies to pushes without an icon # set.

```
// Setting icon number to 95 will show a lightning icon
$lametric->setIcon(95);
```

*The icon number can be found in the icon gallery.*

*You can also create your own icon, but make a note of the number when it is inserted in the public gallery.*

### Send Push Notification

[](#send-push-notification)

The push method allows you to send push notification to Lametric using a simple message, a message with the icon # specified, and an array (frames).

```
// Send a simple push notification. Icon must be set using the setIcon method, otherwise it will default to null.
$lametric->push("Hello World!");

// Send a push notification with specific icon number.
$lametric->push("Hello World!", 95);

// Send a push notification with an array (frames) as parameter. Must use key, value pairs: text, icon.
// Note: The frames are not stored after the notification as been sent.
$lametric->push(array(array('text'=>'Frame 1', 'icon'=>51), array('text'=>'Frame 2', 'icon'=>62)));
```

### Add Frames

[](#add-frames)

With the addFrame and addFrames method, frames can be added for either a push or poll application.

```
// Add frame to notification.
$lametric->addFrame('Notification', 98);

// Add frames for use later
$lametric->addFrames(array(array('text'=>'Frame 1', 'icon'=>51), array('text'=>'Frame 2', 'icon'=>62)));
```

### Generate Data

[](#generate-data)

When creating a poll application, use the generateData method in conjunction with the addFrame or addFrames methods to generate the necessary JSON data for the Lametric to retrieve.

```
// Return frames as an array
$lametric->generateData();

// Return frame array as JSON data (poll method)
$lametric->generateData(true);
```

### Clear Frames

[](#clear-frames)

```
// Clear frames array for object
$lametric->clearFrames();
```

TODO
----

[](#todo)

This is an early release of the wrapper, which is in need of some additional features:

- `Support other types of Indicator apps (e.g. Metric, Goal, Sparkline)`

Credits
-------

[](#credits)

Copyright (c) 2017 - Programmed by Raphael Z.

License
-------

[](#license)

Copyright (c) 2017 Raphael Z.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/36ff10c845b1877313bc49f4cd7f8f442a331132df35e3e679078a571caa1b13?d=identicon)[raphaelz](/maintainers/raphaelz)

---

Top Contributors

[![raphaelz](https://avatars.githubusercontent.com/u/330184?v=4)](https://github.com/raphaelz "raphaelz (3 commits)")

### Embed Badge

![Health badge](/badges/raphaelz-lametric-php/health.svg)

```
[![Health](https://phpackages.com/badges/raphaelz-lametric-php/health.svg)](https://phpackages.com/packages/raphaelz-lametric-php)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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