2017 © Pedro Peláez
 

library component-database

PHP database library.

image

eureka/component-database

PHP database library.

  • Friday, February 16, 2018
  • by velkuns
  • Repository
  • 1 Watchers
  • 0 Stars
  • 72 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

component-database

Current version Supported PHP version CI Quality Gate Status Coverage, (*1)

PHP PDO abstraction with factory to handle reconnection & connections to multiple databases., (*2)

Installation

If you wish to install it in your project, require it via composer:, (*3)

composer require eureka/component-database

You can install the component (for testing) with the following command:, (*4)

make install

Update

You can update the component (for testing) with the following command:, (*5)

make update

Usage

<?php

use Eureka\Component\Database\ConnectionFactory;

$factory = new ConnectionFactory(
    [
        'common' => [
            'dsn'      => 'mysql:dbname=my_database;host=localhost;charset=UTF8',
            'user'     => 'user',
            'password' => 'pass',
            'options'  => null,
        ],
    ]
);

$connection = $factory->getConnection('common');
$connection->query('SELECT * FROM my_table');

Testing & CI (Continuous Integration)

You can run tests on your side with following commands:, (*6)

make tests   # run tests with coverage
make testdox # run tests without coverage reports but with prettified output

You also can run code style check or code style fixes with following commands:, (*7)

make phpcs   # run checks on check style
make phpcbf  # run check style auto fix

To perform a static analyze of your code (with phpstan, lvl 9 at default), you can use the following command:, (*8)

make phpstan
make analyze # Same as phpstan but with CLI output as table

To ensure you code still compatible with current supported version and futures versions of php, you need to run the following commands (both are required for full support):, (*9)

make php74compatibility # run compatibility check on current minimal version of php we support
make php81compatibility # run compatibility check on last version of php we will support in future

And the last "helper" commands, you can run before commit and push is:, (*10)

make ci

This command clean the previous reports, install component if needed and run tests (with coverage report), check the code style and check the php compatibility check, as it would be done in our CI., (*11)

Contributing

See the CONTRIBUTING file., (*12)

License

This project is currently under The MIT License (MIT). See LICENCE file for more information., (*13)

The Versions

16/02 2018

dev-branch_2.x

dev-branch_2.x

PHP database library.

  Sources   Download

MIT

by Romain Cottard

16/02 2018

2.1.0

2.1.0.0

PHP database library.

  Sources   Download

MIT

by Romain Cottard

11/09 2017

2.0.0

2.0.0.0

PHP database library.

  Sources   Download

MIT

by Romain Cottard

09/10 2016

dev-master

9999999-dev

PHP database library.

  Sources   Download

MIT

by Romain Cottard

09/10 2016

1.0.1

1.0.1.0

PHP database library.

  Sources   Download

MIT

by Romain Cottard

08/10 2016

1.0.0

1.0.0.0

PHP database library.

  Sources   Download

MIT

by Romain Cottard