anonymous-php/longlife-pdo
Composer 安装命令:
composer require anonymous-php/longlife-pdo
包简介
Longlife connections for looped applications
README 文档
README
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.
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-20