Beispiel #1
0
 function MY_Profiler()
 {
     parent::CI_Profiler();
     $this->CI->load->library('firephp');
 }
Beispiel #2
0
 protected function _compile_memory_usage()
 {
     return $this->get_file_size(parent::_compile_memory_usage());
 }
Beispiel #3
0
 function __construct()
 {
     parent::__construct();
 }
Beispiel #4
0
 public function run()
 {
     $output = parent::run();
     file_put_contents('/home/mohammad/profiler.html', $output);
 }
 public function run()
 {
     $output = '';
     $output .= '
     <style>
         #codeigniter_wrap_profiler {
             font-size: 12px;
             font-family: \'Source Sans Pro\',\'Helvetica Neue\',Helvetica,Arial,sans-serif;
             font-weight: 400;
             position: fixed;
             bottom : 0;
             left: 0;
             z-index: 1000;
             width: 100%;
             height: 230px;
             overflow: hidden;
             padding-top: 4px;
             background: #fff;
             border-top: 1px solid #ccc;
             box-sizing : border-box;
         }
         #codeigniter_profiler_debug_bar {
             height: 27px;
             border-top: 1px solid #ccc;
             border-bottom: 1px solid #ccc;
             background: #f0f0f0;
             color: #333;
             overflow-y: hidden;
             overflow-x: auto;
         }
         #codeigniter_profiler_debug_bar_tab {
             float: left;
             border-right: 1px solid #f0f0f0;
             text-align: center;
             text-transform: uppercase;
         }
         #codeigniter_profiler_logo {
             float: left;
             padding: 4px;
             background: red;
         }
         #codeigniter_profiler_logo img {
             width: 16px;
             height: 16px;
             margin-top: -4px;
         }
         #codeigniter_profiler_title {
             float: left;
             line-height: 1.5em;
             padding: 4px;
             font-size: 12px;
             background: #f0f0f0;
             cursor: default;
         }
         #codeigniter_profiler_title a {
             color: #666;
             padding: 4px;
             text-decoration: none;
             cursor: pointer;
         }
         #codeigniter_profiler_title a:hover {
             background-color: #cccccc;
             padding: 4px;
         }
         #codeigniter_profiler_close {
             float: right;
             padding-right: 3px;
             background: #fff;
             padding-left: 3px;
             border-radius: 50%;
             line-height: 16px;
             cursor: pointer;
             font-size: 18px;
             font-weight: bold;
             margin-top: 3px;
             border: 1px solid #ccc;
             margin-left: 5px;
         }
         #codeigniter_profiler_x2 {
             float: right;
             padding-right: 3px;
             padding-left: 3px;
             cursor: pointer;
             line-height: 16px;
             text-align: center;
             font-size: 12px;
             border: 1px solid #ccc;
             border-radius: 50%;
             background: #fff;
             margin-top: 3px;
         }
         #codeigniter_profiler {
             overflow: auto;
             height: 200px;
         }
         #codeigniter_profiler fieldset{
             font-size: 12px;
             margin: 0 0 6px !important;
             padding: 1px 4px !important;
         }
         #codeigniter_profiler code {
             word-break: break-all;
             word-break: break-word;
         }
         #codeigniter_profiler fieldset legend {
             border: none;
             font-weight: bold;
             padding: 0;
             width: auto;
         }
     </style>';
     $output .= '<div id="codeigniter_wrap_profiler">';
     $output .= $this->addDebugBar();
     $output .= parent::run();
     $output .= '</div>';
     //add script
     $output .= '
     <script>
     var cookie_fn = {
         set: function(name,value,days) {
             if (days) {
                 var date = new Date();
                 date.setTime(date.getTime()+(days*24*60*60*1000));
                 var expires = "; expires="+date.toGMTString();
             } else
                 var expires = "";
             document.cookie = name+"="+value+expires+"; path=/";
         },
         get: function(name) {
             /*
             var nameEQ = name + "=";
             var ca = document.cookie.split(\';\');
             for(var i=0;i < ca.length;i++) {
                 var c = ca[i];
                 while (c.charAt(0)==\' \') {
                     c = c.substring(1,c.length);
                 }
                 if (c.indexOf(nameEQ) == 0) {
                     return c.substring(nameEQ.length,c.length);
                 }
             }
             return null;
             */
             // one line code, awesome :)
             return(document.cookie.match(\'(^|; )\'+name+\'=([^;]*)\')||0)[2];
         },
         del: function(name) {
             this.set(name,"",-1);
         },
         check: function(name) {
             var isset = this.get(name);
             return (isset);
         },
     };
     var ci_profiler_wrap = document.getElementById("codeigniter_wrap_profiler");
     var ci_profiler = document.getElementById("codeigniter_profiler");
     var ci_profiler_bar = document.getElementById("codeigniter_profiler_debug_bar");
     var ci_profiler_height = ci_profiler_wrap.offsetHeight;
     var ci_profiler_fn = {
         defaultHeight: 230,
         triggerZoom: false,
         // triggerClose: false,
         triggerClose: Boolean(parseInt(cookie_fn.get(\'ci_profile_close\'))),
         minimalBar : function() {
             ci_profiler_wrap.style.height = this.triggerClose ? ci_profiler_height + "px" : "31px";
             this.triggerClose = !this.triggerClose;
             cookie_fn.set(\'ci_profile_close\', this.triggerClose ? 1:0,1);
             this.resizeBody();
         },
         zoomBar: function() {
             if(this.triggerClose) {
                 this.minimalBar();
                 return;
             }
             ci_profiler_height = this.triggerZoom ? ci_profiler_wrap.offsetHeight / 2 : ci_profiler_wrap.offsetHeight * 2;
             ci_profiler_wrap.style.height = ci_profiler_height  + "px";
             ci_profiler.style.height = (ci_profiler_height - ci_profiler_bar.offsetHeight - 25)  + "px";
             this.triggerZoom = !this.triggerZoom;
             this.resizeBody();
         },
         resizeBody: function() {
             document.body.style.marginBottom = ci_profiler_wrap.offsetHeight + "px";
         },
         restoreBody: function(section) {
             cookie_fn.set(\'ci_profile_section\', section, 1);
             if(this.triggerClose) {
                 this.zoomBar();
             }
             // this.scrollSection(section);
             this.showSection(section);
         },
         scrollSection: function(section) {
             // using scrollIntoView
             // document.getElementById(section).scrollIntoView(true);
             var ci_section = document.getElementById(section);
             if(ci_section) {
                 ci_section.scrollIntoView(true);
             }
         },
         showSection: function(section) {
             // using display mode
             this.hideSection(0);
             var ci_section = document.getElementById(section);
             if(ci_section) {
                 ci_section.style.display = "block";
             }
         },
         hideSection: function(startFrom) {
             var elements = document.getElementsByTagName("fieldset");
             for(var i=startFrom; i<elements.length; i++) {
                 elements[i].style.display = "none";
             }
         },
     };
     // ci_profiler_fn.hideSection(1);
     // ci_profiler_fn.resizeBody();
     // ci_profiler_fn.minimalBar();
     if(Boolean(parseInt(cookie_fn.get(\'ci_profile_close\')))) {
         ci_profiler_wrap.style.height = "31px";
     }
     var last_section = cookie_fn.get(\'ci_profile_section\') || \'ci_profiler_benchmarks\';
     ci_profiler_fn.showSection(last_section);
     </script>';
     return $output;
 }
 function __construct($config = array())
 {
     $this->_available_sections[] = 'session';
     parent::__construct($config);
 }
 function __contruct($config = array())
 {
     parent::__construct($config);
 }