2017 © Pedro Peláez
 

library databroker

data broker

image

hergot/databroker

data broker

  • Monday, May 13, 2013
  • by hergot
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

databroker

Purpose

Databroker helps application to be more elastic e.g. you can easily turn on/off caching for various data fetch (database queries, rest and soap calls, file fetch, ...). It implements plugin architecture so it is easy to extend databroker with additional functionality (cache, monitor, ...)., (*1)

Use Cases

  • If you want monitor all database queries, rest calls, ...
  • If you want easily turn on cache for select queries, calls, ...
  • If you want easily switch calls (e.g. instead of database query use rest call) without changing application code
  • If you want non reliably remote call do reliably call (i.e. use fail strategy)

Installation

Clone repository

$ git clone git://github.com/hergot/databroker.git && cd databroker, (*2)

Get composer

$ curl -s https://getcomposer.org/installer | php, (*3)

Run composer

$ ./composer.phar install --dev, (*4)

$ ln -nfs ./vendor/phpunit/phpunit/composer/bin/phpunit ./phpunit, (*5)

Run unit tests

Build Status, (*6)

$ ./phpunit -c ., (*7)

Run code coverage with unit tests

$ ./phpunit --coverage-html <folder path e.g. /tmp/coverage> -c ., (*8)

Notes

APC

You have to enable apc for cli - apc.enable_cli=1 in php.ini file or run phpunit with --exclude-group apc, (*9)

$ ./phpunit --exclude-group apc -c ., (*10)

Plugins

Cache plugin

This plugin cache data fetch into cache backends (APC, file, ...). This plugin have to be configured via setup method - this method expects name or mask of data fetch call. Mask can contain asterix * as wild character., (*11)

Configuration example

$cachePlugin->setup('*') ->setCacheable(true) ->setLifeTime(60) ->setRefreshTime(10) ->setBackend($cacheBackend);, (*12)

This means to cache all (* - mask) data fetch for 60 seconds. Every 10 seconds refresh content in cache backend. Use $cacheBackend as cache backend., (*13)

The Versions

13/05 2013

dev-master

9999999-dev

data broker

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires