Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Longlife Pdo Build Status

This library will be helpful in case you are working with connections in workers or under process managers like PHP-PM. It provides the easiest way to stop to think about connection life cycle in looped applications.

Longlife Pdo provides an extension to the Aura.Sql library along with a reconnection and prepared statements cache.

Installation

composer require anonymous-php/longlife-pdo

Usage

<?php

use \Anonymous\Longlife\LonglifePdo;

$pdo = new LonglifePdo('mysql:host=127.0.0.1;dbname=test', 'test', 'test');

// To check connection in 60 seconds after the last connection usage
$pdo->setCheckConnectionTimeout(60);

// To use prepared statements cache and limit it with 100 items
$pdo->setStatementsCacheLimit(100);

Dependencies

This packages is just an extension for the Aura.Sql so check it's requirements:

This package requires PHP 5.6 or later; it has also been tested on PHP 7 and HHVM. We recommend using the latest available version of PHP as a matter of principle.

About

Longlife connections for looped applications

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages