Welcome Guest, Not a member yet? Register   Sign In
Poll: Would you find a globally enabled profiler helpful?
You do not have permission to vote in this poll.
Yes, I would like to see a global switch for enabling the profiler
57.14%
8 57.14%
No, it is fine as it is.
42.86%
6 42.86%
Total 14 vote(s) 100%
* You voted for this item. [Show Results]

Enable profiler globally
#15

(This post was last modified: 05-01-2015, 01:19 AM by InsiteFX.)

profiler.php - Create this file in application/config

PHP Code:
<?php
defined
('BASEPATH') OR 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// Elapsed time of Benchmark points and total execution time.
$config['config'] = TRUE// CodeIgniter Config variables.
$config['controller_info'] = TRUE// The Controller class and method requested.
$config['get'] = TRUE// Any GET data passed in the request.
$config['http_headers'] = TRUE// The HTTP headers for the current request.
$config['memory_usage'] = TRUE// Amount of memory consumed by the current request, in bytes.
$config['post'] = TRUE// Any POST data passed in the request.
$config['queries'] = TRUE// Listing of all database queries executed, including execution time.
$config['uri_string'] = TRUE// The URI of the current request.
$config['session_data'] = TRUE// Data stored in the current session.
$config['query_toggle_count'] = 25// The number of queries after which the query block will default to hidden.

/**
 * ------------------------------------------------------------------------
 * Filename: profiler.php
 * Location: ./application/config/profiler.php
 * ------------------------------------------------------------------------
 */ 
config.php - Add to the top of file
PHP Code:
/*
|--------------------------------------------------------------------------
| Use CodeIgniter Profiler
|--------------------------------------------------------------------------
|
/ TRUE / FALSE
|
*/
$config['profiler'] = FALSE

MY_Controller
PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * ------------------------------------------------------------------------
 * Editor  : phpDesigner 8.1.2
 * Date    : 10/17/2013
 * Time    : 9:07:10 AM
 * Authors : Raymond L King Sr.
 * ------------------------------------------------------------------------
 *
 * Class    MY_Controller
 *
 * ------------------------------------------------------------------------
 * To change this template use File | Settings | File Templates.
 * ------------------------------------------------------------------------
 */

class Base_Controller extends CI_Controller {

    
/**
     * --------------------------------------------------------------------
     * Class variables - public, private, protected and static.
     * --------------------------------------------------------------------
     */


     // --------------------------------------------------------------------

    /**
     *  __construct
     *
     * Class Constructor    PHP 5+
     *
     * @access    public
     * @return    void
     */
    
public function __construct()
    {
        
parent::__construct();

        
// check to see if we want to use the CI profiler.
        
$this->output->enable_profiler($this->config->item('profiler'));

    }

Quick and simple
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
Enable profiler globally - by PaulD - 04-29-2015, 02:56 AM
RE: Enable profiler globally - by mwhitney - 04-29-2015, 06:40 AM
RE: Enable profiler globally - by gadelat - 04-29-2015, 11:23 AM
RE: Enable profiler globally - by CroNiX - 04-29-2015, 01:46 PM
RE: Enable profiler globally - by gadelat - 04-29-2015, 01:50 PM
RE: Enable profiler globally - by PaulD - 04-29-2015, 01:58 PM
RE: Enable profiler globally - by ivantcholakov - 04-29-2015, 03:32 PM
RE: Enable profiler globally - by ivantcholakov - 04-29-2015, 03:36 PM
RE: Enable profiler globally - by ivantcholakov - 04-29-2015, 04:38 PM
RE: Enable profiler globally - by InsiteFX - 04-29-2015, 06:07 PM
RE: Enable profiler globally - by John_Betong - 04-29-2015, 07:22 PM
RE: Enable profiler globally - by PaulD - 04-30-2015, 05:17 AM
RE: Enable profiler globally - by PaulD - 04-30-2015, 05:15 AM
RE: Enable profiler globally - by ivantcholakov - 04-30-2015, 10:52 AM
RE: Enable profiler globally - by InsiteFX - 05-01-2015, 01:12 AM
RE: Enable profiler globally - by RWCH - 05-01-2015, 06:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB