PHPackages                             sfm/ducksboard-bundle - 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. sfm/ducksboard-bundle

ActiveSymfony-bundle[API Development](/categories/api)

sfm/ducksboard-bundle
=====================

Symfony2 Bundle to integrate an app with Ducksboard.

v0.1(13y ago)74461[1 issues](https://github.com/mgallego/DucksboardBundle/issues)MITPHPPHP &gt;=5.3.0

Since Aug 13Pushed 13y ago1 watchersCompare

[ Source](https://github.com/mgallego/DucksboardBundle)[ Packagist](https://packagist.org/packages/sfm/ducksboard-bundle)[ RSS](/packages/sfm-ducksboard-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

DucksboardBundle for Symfony2
=============================

[](#ducksboardbundle-for-symfony2)

[![Build Status](https://camo.githubusercontent.com/e14d2cf6409a8a7e7d98bac3a797ad6020379f0c1b1afbbb22051669c4dd7da3/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6d67616c6c65676f2f4475636b73626f61726442756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/mgallego/DucksboardBundle)

This bundle integrates Symfony2 applications with the Ducksboard API.

Dependencies
------------

[](#dependencies)

PHP Curl library

Instalation
-----------

[](#instalation)

### With composer

[](#with-composer)

Add the project in the `composer.json` file:

```
...
"require": {
...
	"sfm/ducksboard-bundle": "dev-master"
...
}
```

and in the `AppKernel.php` file:

```
	$bundles = array(
        ...
	    new SFM\DucksboardBundle\SFMDucksboardBundle(),
	...
        );
```

Execute php composer.phar install

### With deps files

[](#with-deps-files)

Add the project in the `deps` file:

```
[DucksboardBundle]
    git=https://github.com/mgallego/DucksboardBundle.git
    target=/bundles/SFM/DucksboardBundle
```

and in the `autoload.php' file:

```
$loader->registerNamespaces(array(
    ...
    'SFM'         => __DIR__.'/../vendor/bundles',
    ...
```

and in the `AppKernel.php` file:

```
	$bundles = array(
        ...
	    new SFM\DucksboardBundle\SFMDucksboardBundle(),
	...
        );
```

Use like an own service
-----------------------

[](#use-like-an-own-service)

First you need to include the Ducksboard apiKey into the `parameters` file (ini/yml):

```
ducksboard_api    =  xxxxxxxxxxxxxxx
```

Second, create the service:

```
services:
...
...
    example.ducksboard:
        class: SFM\DucksboardBundle\Adapter\Widget
        arguments: [@sfm.ducksboard.connector]
        calls:
            - [setApiKey, [%ducksboard_api%]]
```

Now you can use your own service that set automatically the apikey

Use the bundle service
----------------------

[](#use-the-bundle-service)

The bundle has a service prepared to use. Example:

```
$widget = $this->container->get('sfm.ducksboard.widget');
$widget->setApiKey($this->container->getParameter('ducksboard_api'));
```

Examples of use
---------------

[](#examples-of-use)

### Push method

[](#push-method)

*Simple Widget*

```
        $widget = $this->container->get('screencast.ducksboard');
        $widget->setData(array($widgetID => array('value' => $val1)));
        $widget->push();
```

*Double Widget*

```
        $widget = $this->container->get('screencast.ducksboard');
        $dateData1 = array(
            array('timestamp' => time(), 'value' => '130'),
            array('timestamp' => time() - ((24*60*60)) , 'value' => '50'),
            array('timestamp' => time() - ((2*24*60*60)) , 'value' => '70'),
            array('timestamp' => time() - ((3*24*60*60)) , 'value' => '20'),
            array('timestamp' => time() - ((4*24*60*60)) , 'value' => '50'),
            array('timestamp' => time() - ((4*24*60*60)) , 'value' => '80'),
            array('timestamp' => time() - ((4*24*60*60)) , 'value' => '100'));

        $dateData2 = array(
            array('timestamp' => time(), 'value' => '80'),
            array('timestamp' => time() - ((24*60*60)) , 'value' => '20'),
            array('timestamp' => time() - ((2*24*60*60)) , 'value' => '70'),
            array('timestamp' => time() - ((3*24*60*60)) , 'value' => '80'),
            array('timestamp' => time() - ((4*24*60*60)) , 'value' => '50'),
            array('timestamp' => time() - ((4*24*60*60)) , 'value' => '90'),
            array('timestamp' => time() - ((4*24*60*60)) , 'value' => '30'));

        $widgetGraphData = array(
            $widgetId1=> $dateData1,
            $widgetId2 => $dateData2
            );

        $widget->setData($widgetGraphData);
        $widget->push();
```

*Delta Values*

```
        $widget	= $this->container->get('screencast.ducksboard');
	$widgetData = array($widgetId => array('delta' => 1 ));
	$widget->setData($widgetData);
	$widget->push();
```

### Pull method

[](#pull-method)

*Get the 3 last data of a widget*

```
   $widget->getLastValues($widgetId, 3);
   $widgetActualData = $widget->getArrayResponse();
   //or
   $widgetActualData = $widget->getRawResponse();
```

*Find data by seconds*

```
   $widget->findBySeconds($widgetId, $seconds);
   $widgetActualData = $widget->getArrayResponse();
   //or
   $widgetActualData = $widget->getRawResponse();
```

*Find data by timespan*

```
   $widget->findByTimespan($widgetId, 'monthly', $timezone);
   $widgetActualData = $widget->getArrayResponse();
   //or
   $widgetActualData = $widget->getRawResponse();
```

Other resources
---------------

[](#other-resources)

Oficial Ducskboard API documentation:

A Demo video with examples (spanish):

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

5023d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36686dcdb36a474e899d623e8cfed569f595b77fe931442fa5b79e632394c22c?d=identicon)[moisesgallego](/maintainers/moisesgallego)

---

Top Contributors

[![mgallego](https://avatars.githubusercontent.com/u/655174?v=4)](https://github.com/mgallego "mgallego (37 commits)")[![Osukaru](https://avatars.githubusercontent.com/u/249598?v=4)](https://github.com/Osukaru "Osukaru (1 commits)")

---

Tags

Symfony2ducksboard

### Embed Badge

![Health badge](/badges/sfm-ducksboard-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/sfm-ducksboard-bundle/health.svg)](https://phpackages.com/packages/sfm-ducksboard-bundle)
```

###  Alternatives

[nilportugues/jsonapi-bundle

Symfony 2 &amp; 3 JSON API Transformer Package

11446.0k](/packages/nilportugues-jsonapi-bundle)[mremi/url-shortener-bundle

Implementation of UrlShortener library for Symfony2/Symfony3

19135.0k](/packages/mremi-url-shortener-bundle)

PHPackages © 2026

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