herrera-io/pdo-log 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

herrera-io/pdo-log

最新稳定版本:1.0.0

Composer 安装命令:

composer require herrera-io/pdo-log

包简介

A simple way to log PDO queries and execution times.

README 文档

README

Build Status

This library provides an alternative class to PDO. Its purpose is to log queries and their execution times. You can also set an observer that will be called whenever a new log entry is added.

$pdo = new Herrera\Pdo\Pdo('sqlite::memory');

$pdo->onLog(
    function (array $entry) {
        print_r($entry);
    }
);

$pdo->exec('CREATE TABLE test ()');

/*
Array
(
    [query] => CREATE TABLE test ()
    [time] => 0.00026607513427734
    [values] => Array
        (
        )
)
*/

// retrieves all logged queries
$entries = $pdo->getLog();

Installation

Use Composer:

$ composer require "herrera-io/pdo-log=~1.0"

Usage

The logging Pdo class is a subclass of the real PDO class, so the only thing that has been changed is adding the ability to log certain actions, and that query() and prepare() will return the logging version of the PDOStatement class. This version of the class is not a subclass of the original, but all property gets/sets and method calls are mirrored. You can still retrieve the real instance using PdoStatement->getPdoStatement().

统计信息

  • 总下载量: 180.87k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-08-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固