2010-04-21 3 views

답변

5

에 $ _POST을 변경하고이 코드를 붙여 넣기 :

<?php if(!defined('BASEPATH')) exit('No direct script access allowed'); 
    class MY_Profiler extends CI_Profiler { 
    /** 
    * Adds session data to the profiler 
    * Adds a table row for each item of session data with the key and value 
    * Shows both CI session data and custom session data 
    */ 
    function _compile_session() {  
     $output = "\n\n"; 
     $output .= '<fieldset style="border:1px solid #009999;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">'; 
     $output .= "\n"; 
     $output .= '<legend style="color:#009999;">&nbsp;&nbsp;'.'SESSION DATA'.'&nbsp;&nbsp;</legend>'; 
     $output .= "\n"; 

     if (!is_object($this->CI->session)) { 
      $output .= "<div style='color:#009999;font-weight:normal;padding:4px 0 4px 0'>".'No SESSION data exists'."</div>"; 
     } else { 
      $output .= "\n\n<table cellpadding='4' cellspacing='1' border='0' width='100%'>\n"; 

      $sess = get_object_vars($this->CI->session); 

      foreach ($sess['userdata'] as $key => $val) { 
       if (! is_numeric($key)) { 
        $key = "'".$key."'"; 
       } 

       $output .= "<tr><td width='50%' style='color:#000;background-color:#ddd;'>&#36;_SESSION[".$key."]&nbsp;&nbsp; </td><td width='50%' style='color:#009999;font-weight:normal;background-color:#ddd;'>"; 
       if (is_array($val)) { 
        $output .= "<pre>" . htmlspecialchars(stripslashes(print_r($val, true))) . "</pre>"; 
       } else { 
        $output .= htmlspecialchars(stripslashes($val)); 
       } 
       $output .= "</td></tr>\n"; 
      } 

      $output .= "</table>\n"; 
     } 
     $output .= "</fieldset>"; 

     return $output;  
    } 

    function run() { 
     $output = "<div id='codeigniter_profiler' style='clear:both;background-color:#fff;padding:10px;'>"; 

     $output .= $this->_compile_uri_string(); 
     $output .= $this->_compile_controller_info(); 
     $output .= $this->_compile_memory_usage(); 
     $output .= $this->_compile_benchmarks(); 
     $output .= $this->_compile_get(); 
     $output .= $this->_compile_post(); 
     $output .= $this->_compile_queries(); 
     $output .= $this->_compile_session(); 

     $output .= '</div>'; 

     return $output; 
    } 
} 
0

당신은 단지 MY_profiler을 만들고 두 가지 방법을 추가 할 수 있습니다 실행()와 _compile_session()를 실행() 부모가 단지 코드 &가 마지막에 _compile_session를 추가 복사 _compile_session가 가질 수와 동일 _compile_post와 같은 코드, 그냥 당신에 대한 adding sessions to the profiler은 기본적으로는 MY_Profiler.php 파일을 만들어 작동이 게시물에 관심을 복사 할 수 $ _SESSION

관련 문제