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
#11

(This post was last modified: 04-29-2015, 07:27 PM by John_Betong. Edit Reason: spelling: not my fortay )

Try adding the following in your own ./config/config_personal.php
PHP Code:
<?php # config_personal.php

defined ?: define('LOCALHOST, 'localhost'=== $_SERVER['SERVER_NAME']);

if( LOCALHOST):
    define('
GOOGLE_ON', FALSE);
    $_SESSION['
jjj'] = array
    (
    '
angular'         =>  FALSE,   
    '
error_reporting' => -1,        #-1==LOCAL 
    '
display_errors'  =>  1,        # 1==LOCAL
    '
threshold'       =>  1,        # 1..4 agressive
    '
compress_result' =>  FALSE,    # 
    '
profiler'        =>  TRUE,     # DOES NOT ACCEPT 0 AS FALSE ?????
    '
MD5'             =>  1,        # 1 == show cached filename
    '
cache_minutes'   =>  0,        # minutes
    '
cache_path'      =>  CACHEPATH,# define('CACHEPATH', APPPATH  .'cache/current/');
    );
else: # Must be ONLINE
  define('
GOOGLE_ON', FALSE);
  $_SESSION['
jjj'] = array
  (
  '
angular'         =>  FALSE,   
  '
error_reporting' =>  -1,
  '
display_errors'  =>  FALSE,     # FALSE ONLINE
  '
threshold'       =>  1,         # 1 ONLINE - 1..4 agressive
  '
compress_result' =>  FALSE,     # Bl@@dy DISQUS DOES NOT WORK if COMPRESSED
  '
profiler'        =>  FALSE,     # DOES NOT ACCEPT 0 AS FALSE ?????
  '
cache_minutes'   =>  0,         # 1,440 = minutes per day
  '
cache_path'      =>  CACHEPATH, # define('CACHEPATH', APPPATH  .'cache/current/');
  );
endif; 
ini_set('
error_log', APPPATH .'php_error.php');
error_reporting( $_SESSION['
jjj']['error_reporting'] );
ini_set('
display_errors', $_SESSION['jjj']['display_errors'] ); 
and I also have a common MY_Library:
PHP Code:
//==================================================

class MY_Library extends CI_Controller 
{

function 
j_view(& $data=array(), $getLatestAndThumbs=TRUE)
{
 
 $this->output->enable_profiler$_SESSION['jjj']['profiler'] );
 
 // lots of other stuff

 
 $this->load->view$data['page_new'], $dataFALSE); # FALSE == ON SCREEN display
}//endfunc

}/// endclass 
This has worked for many old CI_VERSIONS without any problems.
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