Skip to content

dperrymorrow/CodeIgniter-Tracer-Helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tracer Helper Spark

if you are using CI 2.0.2 you need to read this article before using my, or any other sparks for that matter. 2.0.2 has a bug with the loader class that breaks the sparks MY_Loader extension thereof. http://codefury.net/2011/05/getsparks-org-beta-released-big-changes/

This is a very simple yet useful helper for tracing out data while you are working. Will trace out strings and arrays recursively.

Features Overview

  • You choose to exit PHP after the trace or not
  • Trace all queries called and benchmark of each one
  • Can trace entire set of vars passed to the view via Loader class
  • Can trace out all benchmarks set
  • File name and line number included as a backtrace from where the trace was called
  • Easily setup environment switching to keep traces off your staging and production boxes
  • Easily style the traces with the externalized styles and view template in the views folder

Table Torch

Example Usage: ( x.x indicates the version you have installed on your build )

// from a controller 

function index(){
	$this->load->spark( 'tracer/x.x' );
	// keep on rendering page if false ( default )
	trace( $_SERVER, FALSE );
	// exit php and rendering if true
	trace( $_SERVER, TRUE );
}

To Trace Out All View Vars

You can also trace out everything that was passed to your view. This must be called after you load view and pass data via $this->load->view( 'viewname', $data ); See http://codeigniter.com/user_guide/libraries/loader.html for more information on views and data.

trace_viewdata( TRUE ); // will exit if true, no if false

Thats it!!

About

Simple Tracer for CodeIgniter

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages