CI_Profiler::__construct PHP Method

__construct() public method

--------------------------------------------------------------------
public __construct ( $config = [] )
    public function __construct($config = array())
    {
        $this->CI =& get_instance();
        $this->CI->load->language('profiler');
        // If the config file has a query_toggle_count,
        // use it, but remove it from the config array.
        if (isset($config['query_toggle_count'])) {
            $this->_query_toggle_count = (int) $config['query_toggle_count'];
            unset($config['query_toggle_count']);
        }
        // default all sections to display
        foreach ($this->_available_sections as $section) {
            if (!isset($config[$section])) {
                $this->_compile_[$section] = TRUE;
            }
        }
        // Make sure the Console is loaded.
        if (!class_exists('Console')) {
            $this->CI->load->library('Console');
        }
        $this->set_sections($config);
        // Strange hack to get access to the current
        // vars in the CI_Loader class.
        $this->_ci_cached_vars = $this->CI->load->_ci_cached_vars;
    }

Usage Example

コード例 #1
0
ファイル: MY_Profiler.php プロジェクト: kikoseijo/BootPress
 public function __construct($config = array())
 {
     unset($config['benchmarks'], $config['memory_usage']);
     // These two must always be displayed
     $this->_available_sections[] = 'console';
     $this->_available_sections[] = 'smarty';
     $this->_available_sections[] = 'files';
     $this->_profiler_view = 'profiler_custom';
     parent::__construct($config);
 }
All Usage Examples Of CI_Profiler::__construct