If Only I Knew That!

Webby things that could save you time

Archive for the ‘PHP’ Category

Codeigniter 2.0 configurable profiler + some jQuery magic to show/hide

without comments

The new CI 2.0 Profiler has configurable sections + 2 new additional sections (http_headers and config).

You’ll need to edit application/config/profiler.php

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Profiler Sections
| -------------------------------------------------------------------------
| This file lets you determine whether or not various sections of Profiler
| data are displayed when the Profiler is enabled.
| Please see the user guide for info:
|
|	http://codeigniter.com/user_guide/general/profiling.html
|
*/

$config['benchmarks'] 		= TRUE;
$config['get'] 				= TRUE;
$config['memory_usage'] 	= TRUE;
$config['post'] 			= TRUE;
$config['uri_string']		= TRUE;
$config['controller_info']	= TRUE;
$config['queries'] 			= TRUE;
$config['http_headers'] 	= TRUE;
$config['config'] 			= TRUE;

/* End of file profiler.php */
/* Location: ./application/config/profiler.php */

I previously used a modified version of MY_Profiler from dragffy.com. I modified it to add a button to the top of the page that would show or hide the profiler when needed and could also hide the profiler button totally.

Click to continue reading “Codeigniter 2.0 configurable profiler + some jQuery magic to show/hide”

Written by daveganley

May 4th, 2010 at 1:22 pm

Posted in Codeigniter,PHP

Quick and easy block commenting for testing

with 3 comments

To save time commenting and uncommenting during development we use a little trick with the comment block that allows us to add or remove a single character ‘\’ to comment/uncomment a block.

Uncommented

/* */
Block of code
/* */

Commented

/* *\/
Block of code
/* */

Quick and simple time saver

Written by daveganley

April 21st, 2010 at 4:25 pm

Posted in PHP

Powered by CDN Rewrites