만약 그렇다면 .... 어떤 생각? 물론SESSION 변수를 표시하기 위해 CI_Profiler 클래스를 확장 할 수 있습니까?
1
A
답변
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;"> '.'SESSION DATA'.' </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;'>$_SESSION[".$key."] </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
관련 문제
- 1. .NETCF 부분 클래스를 작성하여 System.Windows.Forms.UserControl을 확장 할 수 있습니까?
- 2. 어떻게하면 파이썬을 사용하여 쉽게 변수를 문자열로 확장 할 수 있습니까?
- 3. .net에서 String 클래스를 확장 할 수 있습니다.
- 4. 컴포넌트를 표시하기 위해 JSF에 ui : include를 사용할 수 있습니까?
- 5. Proxy 클래스의 하위 클래스를 확장 할 수 있습니까?
- 6. 언제 인터페이스를 구현하고 수퍼 클래스를 확장 할 수 있습니까?
- 7. 한 클래스에서 두 개의 클래스를 확장 할 수 있습니까?
- 8. 클래스가 두 개 이상의 클래스를 확장 할 수 있습니까?
- 9. Groovy 클로저가 추상 클래스를 확장 할 수 있습니까?
- 10. DataColumn.Expression을 확장 할 수 있습니까?
- 11. JMX를 사용하여 Session 객체의 변수를 볼 수 있습니까?
- 12. Java에서 일반 클래스 매개 변수를 확장 할 수 있습니까?
- 13. 클래스를 생성하기 전에 어떻게 변수를 정의 할 수 있습니까?
- 14. ASP.Net에서 Base 클래스의 Session 변수에 어떻게 액세스 할 수 있습니까?
- 15. 그냥 경고를 표시하기 위해 유효성 검사기를 사용할 수 있습니까?
- 16. 코드 변경 내용을 표시하기 위해 Eclipse를 설정할 수 있습니까?
- 17. System.Delegate를 확장 할 수 있습니까?
- 18. 변수를 사용하여 클래스를 동적으로로드하기
- 19. 다른 클래스를 확장 할 수있는 클래스 제한
- 20. 동시에 활동 클래스와 PreferenceActivity 클래스를 확장 할 수 있습니다.
- 21. 스레드를 확장 할 수없는 경우 (이미 다른 클래스를 확장 중이므로) 병렬로 명령문을 실행할 수 있습니까?
- 22. "Session"에서 "StatelessSession"으로 변경하고 클래스를 가져올 수 있습니다.
- 23. Java에서 변수를 오버로드 할 수 있습니까?
- 24. 자바 : 속성 값을 정의하기 위해 하위 클래스를 요구할 수 있습니까?
- 25. 텍스트를 표시하기 위해 호버 머리글
- 26. 이 확장 방법을 리팩토링 할 수 있습니까?
- 27. Stateless Session Bean을 통해 Stateful Session Bean을 호출 할 수 있습니까?
- 28. PHP 확장 안에 여러 클래스를 가질 수 있습니까?
- 29. 확장 메서드를 사용하여 정적 클래스를 확장
- 30. 마지막 키워드를 사용하지 않고 클래스를 확장 할 수 없게하려면 어떻게해야합니까?