2017 © Pedro Peláez
 

library silex-pinba-provider

Provide PinbaBundle for Silex

image

bi0r0b0t/silex-pinba-provider

Provide PinbaBundle for Silex

  • Wednesday, June 20, 2018
  • by BI0R0B0T
  • Repository
  • 0 Watchers
  • 0 Stars
  • 190 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 60 % Grown

The README.md

silex-pinba-provider

Provide PinbaBundle functionality for Silex, (*1)

Scrutinizer Code Quality Build Status, (*2)

Installation

For Silex 2.0

    composer require bi0r0b0t/silex-pinba-provider

or Require the bundle in your composer.json file:, (*3)

{
    "require": {
        "bi0r0b0t/silex-pinba-provider": "~1.0",
    }
}

For Silex 1.0

Through Composer as bi0r0b0t/silex-pinba-provider ., (*4)

Require the bundle in your composer.json file:, (*5)

{
    "require": {
        "bi0r0b0t/silex-pinba-provider": "~0.1",
    }
}

Register

Important! Register the bundle in prod environment after TwigServiceProvider and DoctrineServiceProvider:, (*6)

/**
 * @var $app Silex\Application
 */
$app->register(new SilexPinbaProvider\SilexPinbaProvider()

Using with Doctrine ORM

Examples based on [dflydev/doctrine-orm-service-provider][2], (*7)

Collecting Filesystem metrics

/**
 * @var $app Silex\Application
 */
$app['orm.cache.factory.filesystem'] = $app->protect(function($cacheOptions) use ($app) {
    if (empty($cacheOptions['path'])) {
        throw new \RuntimeException('FilesystemCache path not defined');
    }
    $cache = new  SilexPinbaProvider\Cache\Filesystem($cacheOptions['path']);
    $cache->setStopwatch($app['intaro_pinba.stopwatch']);
    return $cache;
});

Collecting Memcache metrics

/**
 * @var $app Silex\Application
 */
$app['orm.cache.factory.backing_memcache'] = $app->protect(function() use ($app) {
   $cache = new Intaro\PinbaBundle\Cache\Memcache();
   $cache->setStopwatch($app['intaro_pinba.stopwatch']);
   return $cache;
});

Using with console

/**
 * @var $console Symfony\Component\Console\Application
 * @var $app     Silex\Application
 */
if (function_exists('pinba_script_name_set')) {
    pinba_script_name_set('console');
    $input = new Symfony\Component\Console\Input\ArgvInput();
    $timer = pinba_timer_start(array(
        'server'  => $app['intaro_pinba.server.name'],
        'group'   => 'console::run',
        'command' => $input->getFirstArgument(),
    ));
    $res = $console->run($input);
    pinba_timer_stop($timer);
    return $res;
} else {
    return $console->run();
}

The Versions

20/06 2018

dev-master

9999999-dev

Provide PinbaBundle for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

php silex pinba

20/06 2018

1.0.7

1.0.7.0

Provide PinbaBundle for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

php silex pinba

16/02 2018

1.0.6

1.0.6.0

Provide PinbaBundle for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

php silex pinba

07/02 2018

1.0.5

1.0.5.0

Provide PinbaBundle for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

php silex pinba

07/02 2018

1.0.4

1.0.4.0

Provide PinbaBundle for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

php silex pinba

28/12 2017
16/11 2017
15/11 2017
16/06 2017

0.1.4

0.1.4.0

Provide PinbaBundle for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

php silex pinba

16/06 2017

dev-Silex_1

dev-Silex_1

Provide PinbaBundle for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

php silex pinba

26/08 2016

v0.1.3

0.1.3.0

Provide PinbaBundle for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

php silex pinba

09/03 2016

v0.1.2

0.1.2.0

Provide PinbaBundle for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

php silex pinba

09/03 2016

v0.1.1

0.1.1.0

Provide PinbaBundle for Silex

  Sources   Download

MIT

The Requires

 

php silex pinba

09/03 2016

v0.1.0

0.1.0.0

Provide PinbaBundle for Silex

  Sources   Download

MIT

The Requires

 

php silex pinba