koine/query-registry

Registry to keep track of queries

0.9.1 2014-08-12 19:19 UTC

This package is not auto-updated.

Last update: 2024-12-21 17:22:31 UTC


README

Simple query Registry for storing queries (and params) for logging/debbuging/late executing

Code information:

Build Status Coverage Status Code Climate Scrutinizer Code Quality

Package information:

Latest Stable Version Total Downloads Latest Unstable Version License Dependency Status

Usage

$registry = new \Koine\QueryRegistry;

$registry->register("SELECT foo FROM bar");

$registry->register("SELECT foo FROM bar WHERE baz=:baz", array(
    'baz' => 'somevalue'
));

$registry->getQueries()->last()->dump();


// or

foreach ($registry->getQueries() as $query) {
    $db->execute($query->getSql(), $query->getParams());
}

Installing

Via Composer

Append the lib to your requirements key in your composer.json.

{
    // composer.json
    // [..]
    require: {
        // append this line to your requirements
        "koine/query-registry": "dev-master"
    }
}

Alternative install

Issues/Features proposals

Here is the issue tracker.

Contributing

Only TDD code will be accepted. Please follow the PSR-2 code standard.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

How to run the tests:

phpunit --configuration tests/phpunit.xml

To check the code standard run:

phpcs --standard=PSR2 lib
phpcs --standard=PSR2 tests

Lincense

MIT

Authors