Foundation package for the Pomm database framework.
PHP
Latest commit 9c17fd2 Feb 7, 2017 @lunika lunika committed with chanmix51 add citext type to string converter. Fix #84
Permalink
Failed to load latest commit information.
documentation [doc] change overload to extend for classes Aug 28, 2015
sources
.bootstrap.atoum.php Added tests for Listener. Oct 23, 2014
.gitignore Split Connection & Configurator. Oct 18, 2014
.travis.yml Add phpcs in travis build Nov 16, 2016
CHANGELOG VERSION 2.0.0 Oct 4, 2015
LICENSE php doc in Pomm service class. Sep 22, 2014
README.md tell README we are experimental Dec 8, 2015
VERSION switch to 2.1 dev branch Dec 4, 2015
composer.json
composer.lock composer update Nov 16, 2016

README.md

Foundation

Latest Stable Version Scrutinizer Code Quality Build Status Monthly Downloads License

This is the experimental branch of the foundation component of Pomm Project.

What is Foundation ?

Foundation is the main block of Pomm database framework. It makes clients able to communicate either with the database or with each others through a session. One of these clients -- the query manager -- can make Foundation to be used as DBAL replacement. If you are looking for a library to use PostgreSQL in your web development, you might want to look at Pomm’s model manager. If you want to create a custom database access layer or just perform SQL queries, Foundation is the right tool.

Foundation provides out of the box:

  • Converters (all built-in Postgresql types are supported + arrays, HStore etc.) see this SO comment.
  • Prepared Queries.
  • Parametrized queries.
  • Seekable iterators on results.
  • LISTEN / NOTIFY asynchronous messages support.
  • Service manager for easy integration with dependency injection containers.

See more with code examples on this blog post.

Requirements

  • PHP 5.4.4
    • mod-pgsql (not PDO)
  • Postgresql 9.1

Installation

Pomm components are available on packagist using composer. To install and use Pomm's foundation, add a require line to "pomm-project/foundation" in your composer.json file.

Documentation

Foundation’s documentation is available either online or directly in the documentation folder of the project.

Tests

This package uses Atoum as unit test framework. The tests are located in sources/tests. The test suite needs to access the database to ensure that read and write operations are made in a consistent manner. You need to set up a database for that and fill the sources/tests/config.php file with the according DSN. For convenience, Foundation provides two classes that extend Atoum with a Session:

  • PommProject\Foundation\Tester\VanillaSessionAtoum
  • PommProject\Foundation\Tester\FoundationSessionAtoum

Making your test class to extend one of these will grant them with a buildSession method that returns a newly created session. Clients of these classes must implement a initializeSession(Session $session) method (even a blank one). It is often a good idea to provide a fixture class as a session client, this method is the right place to register it.