ycheukf/debug

a debug and db profiler Module for zf2

dev-developing 2013-07-27 07:16 UTC

This package is not auto-updated.

Last update: 2024-05-06 13:30:29 UTC


README

Version 0.0.1 Created by ycheukf@gmail.com

Introduction

YcheukfDebug is a debug module for zend framework 2. This module will dump vars and SQL to a cache file instead of printing out directly.

Features / Goals

  • dump vars as var_dump
  • dump db profiler (support multiple db adapter)
  • the debug info will not be rewrote when request a ajax

Requirements

Installation

Install via git

Clone this repo git clone https://github.com/ycheukf/debug.git

Install via Composer

Add this to your composer.json under "require": "ycheukf/debug": "dev-master"

Run command: php composer.phar update

Usage

1: add module 'YcheukfDebug' to your application.config.php

return array(
    'modules' => array(
        'YcheukfDebug',
        'Application',
    ),
);

2: use the below code as var_dump

	\YcheukfDebug\Model\Debug::dump($var, 'memo');

3: check the output at http://yourzf2project/public/index.php/ycfdebug

Advanced Usage

If a project has multiple db adapter and master-slaver adapter, you need to attach a new event 'YcheukfDebugSetProfiler' into your code. just like the code in 'setAttach' function at vendor/ycheukf/debug/Module.php