From 8310c9a33647804be22a92f1a0458d30d5cacd8a Mon Sep 17 00:00:00 2001 From: yterajima Date: Mon, 22 Aug 2011 07:26:54 +0900 Subject: Fixed #56 _compile_session_data() is 'protected' to be able to extend MY_Profiler. --- system/libraries/Profiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 082a5ee1d..330acce73 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -493,7 +493,7 @@ class CI_Profiler { * * @return string */ - private function _compile_session_data() + protected function _compile_session_data() { if ( ! isset($this->CI->session)) { @@ -555,4 +555,4 @@ class CI_Profiler { // END CI_Profiler class /* End of file Profiler.php */ -/* Location: ./system/libraries/Profiler.php */ \ No newline at end of file +/* Location: ./system/libraries/Profiler.php */ -- cgit v1.2.3-24-g4f1b From 7fe625aa1b294d135c860a79830da12658238c7e Mon Sep 17 00:00:00 2001 From: Pedro Junior Date: Mon, 5 Sep 2011 09:47:09 -0300 Subject: CI_Profiler => Accepting objects while profiling session data. --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 330acce73..ac58129a9 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -506,7 +506,7 @@ class CI_Profiler { foreach ($this->CI->session->all_userdata() as $key => $val) { - if (is_array($val)) + if (is_array($val) || is_object($val)) { $val = print_r($val, TRUE); } -- cgit v1.2.3-24-g4f1b From f4a4bd8fac188ebc9cda822ffc811c218fd92b45 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 20 Oct 2011 12:18:42 -0500 Subject: adding new license file (OSL 3.0) and updating readme to ReST added notice of license to all source files. OSL to all except the few files we ship inside of the application folder, those are AFL. Updated license in user guide. incrementing next dev version to 3.0 due to licensing change --- system/libraries/Profiler.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index ac58129a9..8a2568d8e 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -27,7 +39,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/general/profiling.html */ class CI_Profiler { -- cgit v1.2.3-24-g4f1b From 195d311796072477c5808ce99688abae1512b696 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 25 Dec 2011 03:59:13 +0200 Subject: Improve the Profiler library --- system/libraries/Profiler.php | 225 +++++++++++++++--------------------------- 1 file changed, 81 insertions(+), 144 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 8a2568d8e..9cbd69bb2 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -1,13 +1,13 @@ -CI->benchmark->marker[$match[1].'_end'], $this->CI->benchmark->marker[$match[1].'_start'])) { - if (isset($this->CI->benchmark->marker[$match[1].'_end']) AND isset($this->CI->benchmark->marker[$match[1].'_start'])) - { - $profile[$match[1]] = $this->CI->benchmark->elapsed_time($match[1].'_start', $key); - } + $profile[$match[1]] = $this->CI->benchmark->elapsed_time($match[1].'_start', $key); } } @@ -139,12 +137,11 @@ class CI_Profiler { // Note: At some point we should turn this into a template that can // be modified. We also might want to make this data available to be logged - $output = "\n\n"; - $output .= '
'; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_benchmarks').'  '; - $output .= "\n"; - $output .= "\n\n\n"; + $output = "\n\n" + . '
' + . "\n" + . '  '.$this->CI->lang->line('profiler_benchmarks').'  ' + . "\n\n\n
\n"; foreach ($profile as $key => $val) { @@ -152,10 +149,7 @@ class CI_Profiler { $output .= "\n"; } - $output .= "
".$key."  ".$val."
\n"; - $output .= "
"; - - return $output; + return $output."\n"; } // -------------------------------------------------------------------- @@ -178,19 +172,16 @@ class CI_Profiler { } } - if (count($dbs) == 0) + if (count($dbs) === 0) { - $output = "\n\n"; - $output .= '
'; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_queries').'  '; - $output .= "\n"; - $output .= "\n\n\n"; - $output .="\n"; - $output .= "
".$this->CI->lang->line('profiler_no_db')."
\n"; - $output .= "
"; - - return $output; + return "\n\n" + . '
' + . "\n" + . '  '.$this->CI->lang->line('profiler_queries').'  ' + . "\n\n\n\n" + . '\n
' + . $this->CI->lang->line('profiler_no_db') + . "
\n
"; } // Load the text helper so we can highlight the SQL @@ -205,8 +196,6 @@ class CI_Profiler { foreach ($dbs as $db) { - $count++; - $hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : ''; $show_hide_js = '('.$this->CI->lang->line('profiler_section_hide').')'; @@ -216,13 +205,12 @@ class CI_Profiler { $show_hide_js = '('.$this->CI->lang->line('profiler_section_show').')'; } - $output .= '
'; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'  '.$show_hide_js.''; - $output .= "\n"; - $output .= "\n\n\n"; + $output .= '
' + . "\n" + . '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'  '.$show_hide_js.'' + . "\n\n\n
\n"; - if (count($db->queries) == 0) + if (count($db->queries) === 0) { $output .= "\n"; } @@ -243,8 +231,7 @@ class CI_Profiler { } } - $output .= "
".$this->CI->lang->line('profiler_no_queries')."
\n"; - $output .= "
"; + $output .= "\n"; } @@ -261,13 +248,13 @@ class CI_Profiler { */ protected function _compile_get() { - $output = "\n\n"; - $output .= '
'; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_get_data').'  '; - $output .= "\n"; + $output = "\n\n" + . '
' + . "\n" + . '  '.$this->CI->lang->line('profiler_get_data').'  ' + . "\n"; - if (count($_GET) == 0) + if (count($_GET) === 0) { $output .= "
".$this->CI->lang->line('profiler_no_get')."
"; } @@ -282,23 +269,15 @@ class CI_Profiler { $key = "'".$key."'"; } - $output .= "$_GET[".$key."]   "; - if (is_array($val)) - { - $output .= "
" . htmlspecialchars(stripslashes(print_r($val, true))) . "
"; - } - else - { - $output .= htmlspecialchars(stripslashes($val)); - } - $output .= "\n"; + $output .= "$_GET[".$key."]   " + . (is_array($val) ? "
" . htmlspecialchars(stripslashes(print_r($val, true))) . "
" : htmlspecialchars(stripslashes($val))) + . "\n"; } $output .= "\n"; } - $output .= "
"; - return $output; + return $output.'
'; } // -------------------------------------------------------------------- @@ -310,11 +289,11 @@ class CI_Profiler { */ protected function _compile_post() { - $output = "\n\n"; - $output .= '
'; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_post_data').'  '; - $output .= "\n"; + $output = "\n\n" + . '
' + . "\n" + . '  '.$this->CI->lang->line('profiler_post_data').'  ' + . "\n"; if (count($_POST) == 0) { @@ -345,9 +324,8 @@ class CI_Profiler { $output .= "\n"; } - $output .= "
"; - return $output; + return $output.'
'; } // -------------------------------------------------------------------- @@ -359,24 +337,13 @@ class CI_Profiler { */ protected function _compile_uri_string() { - $output = "\n\n"; - $output .= '
'; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_uri_string').'  '; - $output .= "\n"; - - if ($this->CI->uri->uri_string == '') - { - $output .= "
".$this->CI->lang->line('profiler_no_uri')."
"; - } - else - { - $output .= "
".$this->CI->uri->uri_string."
"; - } - - $output .= "
"; - - return $output; + return "\n\n" + . '
' + . "\n" + . '  '.$this->CI->lang->line('profiler_uri_string').'  ' + . "\n
" + . ($this->CI->uri->uri_string == '' ? $this->CI->lang->line('profiler_no_uri') : $this->CI->uri->uri_string) + . '
'; } // -------------------------------------------------------------------- @@ -388,17 +355,12 @@ class CI_Profiler { */ protected function _compile_controller_info() { - $output = "\n\n"; - $output .= '
'; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_controller_info').'  '; - $output .= "\n"; - - $output .= "
".$this->CI->router->fetch_class()."/".$this->CI->router->fetch_method()."
"; - - $output .= "
"; - - return $output; + return "\n\n" + . '
' + . "\n" + . '  '.$this->CI->lang->line('profiler_controller_info').'  ' + . "\n
".$this->CI->router->fetch_class().'/'.$this->CI->router->fetch_method() + . '
'; } // -------------------------------------------------------------------- @@ -412,24 +374,13 @@ class CI_Profiler { */ protected function _compile_memory_usage() { - $output = "\n\n"; - $output .= '
'; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_memory_usage').'  '; - $output .= "\n"; - - if (function_exists('memory_get_usage') && ($usage = memory_get_usage()) != '') - { - $output .= "
".number_format($usage).' bytes
'; - } - else - { - $output .= "
".$this->CI->lang->line('profiler_no_memory')."
"; - } - - $output .= "
"; - - return $output; + return "\n\n" + . '
' + . "\n" + . '  '.$this->CI->lang->line('profiler_memory_usage').'  ' + . "\n
" + . ((function_exists('memory_get_usage') && ($usage = memory_get_usage()) != '') ? number_format($usage).' bytes' : $this->CI->lang->line('profiler_no_memory')) + . '
'; } // -------------------------------------------------------------------- @@ -443,13 +394,11 @@ class CI_Profiler { */ protected function _compile_http_headers() { - $output = "\n\n"; - $output .= '
'; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_headers').'  ('.$this->CI->lang->line('profiler_section_show').')'; - $output .= "\n"; - - $output .= "\n\n\n"; + $output = "\n\n" + . '
' + . "\n" + . '  '.$this->CI->lang->line('profiler_headers').'  ('.$this->CI->lang->line('profiler_section_show').')' + . "\n\n\n
\n"; foreach (array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header) { @@ -457,10 +406,7 @@ class CI_Profiler { $output .= "\n"; } - $output .= "\n"; - $output .= "
"; - - return $output; + return $output."\n"; } // -------------------------------------------------------------------- @@ -474,13 +420,11 @@ class CI_Profiler { */ protected function _compile_config() { - $output = "\n\n"; - $output .= '
'; - $output .= "\n"; - $output .= '  '.$this->CI->lang->line('profiler_config').'  ('.$this->CI->lang->line('profiler_section_show').')'; - $output .= "\n"; - - $output .= "\n\n\n"; + $output = "\n\n" + . '
' + . "\n" + . '  '.$this->CI->lang->line('profiler_config').'  ('.$this->CI->lang->line('profiler_section_show').')' + . "\n\n\n
\n"; foreach ($this->CI->config->config as $config=>$val) { @@ -492,10 +436,7 @@ class CI_Profiler { $output .= "\n"; } - $output .= "\n"; - $output .= "
"; - - return $output; + return $output."\n"; } // -------------------------------------------------------------------- @@ -512,9 +453,9 @@ class CI_Profiler { return; } - $output = '
'; - $output .= '  '.$this->CI->lang->line('profiler_session_data').'  ('.$this->CI->lang->line('profiler_section_show').')'; - $output .= ""; + $output = '
' + . '  '.$this->CI->lang->line('profiler_session_data').'  ('.$this->CI->lang->line('profiler_section_show').')' + . "
"; foreach ($this->CI->session->all_userdata() as $key => $val) { @@ -526,9 +467,7 @@ class CI_Profiler { $output .= "\n"; } - $output .= ''; - $output .= "
"; - return $output; + return $output."\n"; } // -------------------------------------------------------------------- @@ -553,14 +492,12 @@ class CI_Profiler { } } - if ($fields_displayed == 0) + if ($fields_displayed === 0) { $output .= '

'.$this->CI->lang->line('profiler_no_profiles').'

'; } - $output .= ''; - - return $output; + return $output.''; } } -- cgit v1.2.3-24-g4f1b From 0defe5d33ee2633f377a109519ca818becc60f64 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Sun, 1 Jan 2012 18:46:41 -0600 Subject: Updating copyright date to 2012 --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 9cbd69bb2..89c616543 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 963386ba6072d240840b58d6dbe54287edcb04ad Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 2 Mar 2012 01:52:01 +0200 Subject: Fix issue #803 (Profiler library didn't handle objects properly) --- system/libraries/Profiler.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 89c616543..04216be5d 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -270,7 +270,7 @@ class CI_Profiler { } $output .= "$_GET[".$key."]   " - . (is_array($val) ? "
" . htmlspecialchars(stripslashes(print_r($val, true))) . "
" : htmlspecialchars(stripslashes($val))) + . ((is_array($val) OR is_object($val)) ? "
" . htmlspecialchars(stripslashes(print_r($val, true))) . "
" : htmlspecialchars(stripslashes($val))) . "\n"; } @@ -311,7 +311,7 @@ class CI_Profiler { } $output .= "$_POST[".$key."]   "; - if (is_array($val)) + if (is_array($val) OR is_object($val)) { $output .= "
" . htmlspecialchars(stripslashes(print_r($val, TRUE))) . "
"; } @@ -426,9 +426,9 @@ class CI_Profiler { . '  '.$this->CI->lang->line('profiler_config').'  ('.$this->CI->lang->line('profiler_section_show').')' . "\n\n\n\n"; - foreach ($this->CI->config->config as $config=>$val) + foreach ($this->CI->config->config as $config => $val) { - if (is_array($val)) + if (is_array($val) OR is_object($val)) { $val = print_r($val, TRUE); } @@ -459,7 +459,7 @@ class CI_Profiler { foreach ($this->CI->session->all_userdata() as $key => $val) { - if (is_array($val) || is_object($val)) + if (is_array($val) OR is_object($val)) { $val = print_r($val, TRUE); } @@ -501,7 +501,5 @@ class CI_Profiler { } } -// END CI_Profiler class - /* End of file Profiler.php */ /* Location: ./system/libraries/Profiler.php */ -- cgit v1.2.3-24-g4f1b From 07c1ac830b4e98aa40f48baef3dd05fb68c0a836 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 9 Mar 2012 17:03:37 +0000 Subject: Bumped CodeIgniter's PHP requirement to 5.2.4. Yes I know PHP 5.4 just came out, and yes I know PHP 5.3 has lovely features, but there are plenty of corporate systems running on CodeIgniter and PHP 5.3 still is not widely supported enough. CodeIgniter is great for distributed applications, and this is the highest we can reasonably go without breaking support. PHP 5.3 will most likely happen in another year or so. Fingers crossed on that one anyway... --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 04216be5d..d84e5d3fc 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * -- cgit v1.2.3-24-g4f1b From 0d1c0a7ef45e7911255e0ad6c0fa7aec0bf3d134 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Apr 2012 16:59:54 +0300 Subject: Clean up the Profiler library --- system/libraries/Profiler.php | 196 ++++++++++++++++++++++-------------------- 1 file changed, 101 insertions(+), 95 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index d84e5d3fc..6320ab50d 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * CodeIgniter Profiler Class * @@ -45,24 +43,22 @@ class CI_Profiler { protected $_available_sections = array( - 'benchmarks', - 'get', - 'memory_usage', - 'post', - 'uri_string', - 'controller_info', - 'queries', - 'http_headers', - 'session_data', - 'config' - ); + 'benchmarks', + 'get', + 'memory_usage', + 'post', + 'uri_string', + 'controller_info', + 'queries', + 'http_headers', + 'session_data', + 'config' + ); protected $_query_toggle_count = 25; protected $CI; - // -------------------------------------------------------------------- - public function __construct($config = array()) { $this->CI =& get_instance(); @@ -102,7 +98,7 @@ class CI_Profiler { { if (in_array($method, $this->_available_sections)) { - $this->_compile_{$method} = ($enable !== FALSE) ? TRUE : FALSE; + $this->_compile_{$method} = ($enable !== FALSE); } } } @@ -127,7 +123,7 @@ class CI_Profiler { // We match the "end" marker so that the list ends // up in the order that it was defined if (preg_match('/(.+?)_end/i', $key, $match) - AND isset($this->CI->benchmark->marker[$match[1].'_end'], $this->CI->benchmark->marker[$match[1].'_start'])) + && isset($this->CI->benchmark->marker[$match[1].'_end'], $this->CI->benchmark->marker[$match[1].'_start'])) { $profile[$match[1]] = $this->CI->benchmark->elapsed_time($match[1].'_start', $key); } @@ -135,18 +131,20 @@ class CI_Profiler { // Build a table containing the profile data. // Note: At some point we should turn this into a template that can - // be modified. We also might want to make this data available to be logged + // be modified. We also might want to make this data available to be logged $output = "\n\n" - . '
' - . "\n" - . '  '.$this->CI->lang->line('profiler_benchmarks').'  ' - . "\n\n\n
\n"; + .'
' + ."\n" + .'  '.$this->CI->lang->line('profiler_benchmarks')."  " + ."\n\n\n
\n"; foreach ($profile as $key => $val) { $key = ucwords(str_replace(array('_', '-'), ' ', $key)); - $output .= "\n"; + $output .= '\n"; } return $output."
".$key."  ".$val."
' + .$key.'  ' + .$val."
\n"; @@ -166,7 +164,7 @@ class CI_Profiler { // Let's determine which databases are currently connected to foreach (get_object_vars($this->CI) as $CI_object) { - if (is_object($CI_object) && is_subclass_of(get_class($CI_object), 'CI_DB') ) + if (is_object($CI_object) && is_subclass_of(get_class($CI_object), 'CI_DB')) { $dbs[] = $CI_object; } @@ -175,13 +173,13 @@ class CI_Profiler { if (count($dbs) === 0) { return "\n\n" - . '
' - . "\n" - . '  '.$this->CI->lang->line('profiler_queries').'  ' - . "\n\n\n\n" - . '\n
' - . $this->CI->lang->line('profiler_no_db') - . "
\n
"; + .'
' + ."\n" + .'  '.$this->CI->lang->line('profiler_queries').'  ' + ."\n\n\n\n" + .'\n
' + .$this->CI->lang->line('profiler_no_db') + ."
\n
"; } // Load the text helper so we can highlight the SQL @@ -191,7 +189,6 @@ class CI_Profiler { $highlight = array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'AND', 'LEFT JOIN', 'ORDER BY', 'GROUP BY', 'LIMIT', 'INSERT', 'INTO', 'VALUES', 'UPDATE', 'OR ', 'HAVING', 'OFFSET', 'NOT IN', 'IN', 'LIKE', 'NOT LIKE', 'COUNT', 'MAX', 'MIN', 'ON', 'AS', 'AVG', 'SUM', '(', ')'); $output = "\n\n"; - $count = 0; foreach ($dbs as $db) @@ -205,21 +202,23 @@ class CI_Profiler { $show_hide_js = '('.$this->CI->lang->line('profiler_section_show').')'; } - $output .= '
' - . "\n" - . '  '.$this->CI->lang->line('profiler_database').':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries').': '.count($db->queries).'  '.$show_hide_js.'' - . "\n\n\n\n"; + $output .= '
' + ."\n" + .'  '.$this->CI->lang->line('profiler_database') + .':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries') + .': '.count($db->queries).'  '.$show_hide_js."\n\n\n" + .'
\n"; if (count($db->queries) === 0) { - $output .= "\n"; + $output .= '\n"; } else { foreach ($db->queries as $key => $val) { $time = number_format($db->query_times[$key], 4); - $val = highlight_code($val, ENT_QUOTES); foreach ($highlight as $bold) @@ -227,18 +226,18 @@ class CI_Profiler { $val = str_replace($bold, ''.$bold.'', $val); } - $output .= "\n"; + $output .= '\n"; } } $output .= "
".$this->CI->lang->line('profiler_no_queries')."
' + .$this->CI->lang->line('profiler_no_queries')."
".$time."  ".$val."
' + .$time.'  ' + .$val."
\n
"; - } return $output; } - // -------------------------------------------------------------------- /** @@ -248,19 +247,18 @@ class CI_Profiler { */ protected function _compile_get() { - $output = "\n\n" - . '
' - . "\n" - . '  '.$this->CI->lang->line('profiler_get_data').'  ' - . "\n"; + $output = "\n\n" + .'
' + ."\n" + .'  '.$this->CI->lang->line('profiler_get_data')."  \n"; if (count($_GET) === 0) { - $output .= "
".$this->CI->lang->line('profiler_no_get')."
"; + $output .= '
'.$this->CI->lang->line('profiler_no_get').'
'; } else { - $output .= "\n\n\n"; + $output .= "\n\n
\n"; foreach ($_GET as $key => $val) { @@ -269,9 +267,10 @@ class CI_Profiler { $key = "'".$key."'"; } - $output .= "\n"; + $output .= '\n"; } $output .= "
$_GET[".$key."]   " - . ((is_array($val) OR is_object($val)) ? "
" . htmlspecialchars(stripslashes(print_r($val, true))) . "
" : htmlspecialchars(stripslashes($val))) - . "
$_GET[' + .$key.']   ' + .((is_array($val) OR is_object($val)) ? '
'.htmlspecialchars(stripslashes(print_r($val, TRUE))).'
' : htmlspecialchars(stripslashes($val))) + ."
\n"; @@ -290,18 +289,17 @@ class CI_Profiler { protected function _compile_post() { $output = "\n\n" - . '
' - . "\n" - . '  '.$this->CI->lang->line('profiler_post_data').'  ' - . "\n"; + .'
' + ."\n" + .'  '.$this->CI->lang->line('profiler_post_data')."  \n"; if (count($_POST) == 0) { - $output .= "
".$this->CI->lang->line('profiler_no_post')."
"; + $output .= '
'.$this->CI->lang->line('profiler_no_post').'
'; } else { - $output .= "\n\n\n"; + $output .= "\n\n
\n"; foreach ($_POST as $key => $val) { @@ -310,15 +308,18 @@ class CI_Profiler { $key = "'".$key."'"; } - $output .= "\n"; } @@ -338,12 +339,12 @@ class CI_Profiler { protected function _compile_uri_string() { return "\n\n" - . '
' - . "\n" - . '  '.$this->CI->lang->line('profiler_uri_string').'  ' - . "\n
" - . ($this->CI->uri->uri_string == '' ? $this->CI->lang->line('profiler_no_uri') : $this->CI->uri->uri_string) - . '
'; + .'
' + ."\n" + .'  '.$this->CI->lang->line('profiler_uri_string')."  \n" + .'
' + .($this->CI->uri->uri_string == '' ? $this->CI->lang->line('profiler_no_uri') : $this->CI->uri->uri_string) + .'
'; } // -------------------------------------------------------------------- @@ -356,11 +357,11 @@ class CI_Profiler { protected function _compile_controller_info() { return "\n\n" - . '
' - . "\n" - . '  '.$this->CI->lang->line('profiler_controller_info').'  ' - . "\n
".$this->CI->router->fetch_class().'/'.$this->CI->router->fetch_method() - . '
'; + .'
' + ."\n" + .'  '.$this->CI->lang->line('profiler_controller_info')."  \n" + .'
'.$this->CI->router->fetch_class().'/'.$this->CI->router->fetch_method() + .'
'; } // -------------------------------------------------------------------- @@ -375,12 +376,12 @@ class CI_Profiler { protected function _compile_memory_usage() { return "\n\n" - . '
' - . "\n" - . '  '.$this->CI->lang->line('profiler_memory_usage').'  ' - . "\n
" - . ((function_exists('memory_get_usage') && ($usage = memory_get_usage()) != '') ? number_format($usage).' bytes' : $this->CI->lang->line('profiler_no_memory')) - . '
'; + .'
' + ."\n" + .'  '.$this->CI->lang->line('profiler_memory_usage')."  \n" + .'
' + .((function_exists('memory_get_usage') && ($usage = memory_get_usage()) != '') ? number_format($usage).' bytes' : $this->CI->lang->line('profiler_no_memory')) + .'
'; } // -------------------------------------------------------------------- @@ -395,15 +396,17 @@ class CI_Profiler { protected function _compile_http_headers() { $output = "\n\n" - . '
' - . "\n" - . '  '.$this->CI->lang->line('profiler_headers').'  ('.$this->CI->lang->line('profiler_section_show').')' - . "\n\n\n
$_POST[".$key."]   "; + $output .= '
$_POST[' + .$key.']   '; + if (is_array($val) OR is_object($val)) { - $output .= "
" . htmlspecialchars(stripslashes(print_r($val, TRUE))) . "
"; + $output .= '
'.htmlspecialchars(stripslashes(print_r($val, TRUE))).'
'; } else { $output .= htmlspecialchars(stripslashes($val)); } + $output .= "
\n"; + .'
' + ."\n" + .'  '.$this->CI->lang->line('profiler_headers') + .'  ('.$this->CI->lang->line('profiler_section_show').")\n\n\n" + .'
'."\n"; foreach (array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header) { - $val = (isset($_SERVER[$header])) ? $_SERVER[$header] : ''; - $output .= "\n"; + $val = isset($_SERVER[$header]) ? $_SERVER[$header] : ''; + $output .= '\n"; } return $output."\n
"; @@ -421,10 +424,10 @@ class CI_Profiler { protected function _compile_config() { $output = "\n\n" - . '
' - . "\n" - . '  '.$this->CI->lang->line('profiler_config').'  ('.$this->CI->lang->line('profiler_section_show').')' - . "\n\n\n\n"; + .'
' + ."\n" + .'  '.$this->CI->lang->line('profiler_config').'  ('.$this->CI->lang->line('profiler_section_show').")\n\n\n" + .'
'."\n"; foreach ($this->CI->config->config as $config => $val) { @@ -433,7 +436,8 @@ class CI_Profiler { $val = print_r($val, TRUE); } - $output .= "\n"; + $output .= '\n"; } return $output."\n
"; @@ -453,9 +457,9 @@ class CI_Profiler { return; } - $output = '
' - . '  '.$this->CI->lang->line('profiler_session_data').'  ('.$this->CI->lang->line('profiler_section_show').')' - . ""; + $output = '
' + .'  '.$this->CI->lang->line('profiler_session_data').'  ('.$this->CI->lang->line('profiler_section_show').')' + .'
'; foreach ($this->CI->session->all_userdata() as $key => $val) { @@ -464,7 +468,8 @@ class CI_Profiler { $val = print_r($val, TRUE); } - $output .= "\n"; + $output .= '\n"; } return $output."\n
"; @@ -479,14 +484,14 @@ class CI_Profiler { */ public function run() { - $output = "
"; + $output = '
'; $fields_displayed = 0; foreach ($this->_available_sections as $section) { if ($this->_compile_{$section} !== FALSE) { - $func = "_compile_{$section}"; + $func = '_compile_'.$section; $output .= $this->{$func}(); $fields_displayed++; } @@ -494,7 +499,8 @@ class CI_Profiler { if ($fields_displayed === 0) { - $output .= '

'.$this->CI->lang->line('profiler_no_profiles').'

'; + $output .= '

' + .$this->CI->lang->line('profiler_no_profiles').'

'; } return $output.'
'; @@ -502,4 +508,4 @@ class CI_Profiler { } /* End of file Profiler.php */ -/* Location: ./system/libraries/Profiler.php */ +/* Location: ./system/libraries/Profiler.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 0688ac9ad88a03f1c56cfcd9e3c475b83301344d Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 20 Apr 2012 10:25:04 -0400 Subject: Start comment cleanup of libraries --- system/libraries/Profiler.php | 44 ++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 6320ab50d..1e86f3c61 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -42,23 +42,45 @@ */ class CI_Profiler { + /** + * List of profiler sections available to show + * + * @var array + */ protected $_available_sections = array( - 'benchmarks', - 'get', - 'memory_usage', - 'post', - 'uri_string', - 'controller_info', - 'queries', - 'http_headers', - 'session_data', - 'config' - ); + 'benchmarks', + 'get', + 'memory_usage', + 'post', + 'uri_string', + 'controller_info', + 'queries', + 'http_headers', + 'session_data', + 'config' + ); + /** + * Number of queries to show before making the additional queries togglable + * + * @var int + */ protected $_query_toggle_count = 25; + /** + * Reference to the CodeIgniter singleton + * + * @var object + */ protected $CI; + /** + * Constructor + * + * Initialize Profiler + * + * @param array $config + */ public function __construct($config = array()) { $this->CI =& get_instance(); -- cgit v1.2.3-24-g4f1b From 5645479c622eb36cf9869797896dc0921568c4a9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 17 May 2012 14:32:19 +0300 Subject: Clean up the libraries --- system/libraries/Profiler.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 1e86f3c61..e219d20f2 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -527,6 +527,7 @@ class CI_Profiler { return $output.'
'; } + } /* End of file Profiler.php */ -- cgit v1.2.3-24-g4f1b From d261b1e89c3d4d5191036d5a5660ef6764e593a0 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:12:16 +0100 Subject: Replaced `==` with `===` and `!=` with `!==` in /system/libraries --- system/libraries/Profiler.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index e219d20f2..aaac0c518 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -219,7 +219,7 @@ class CI_Profiler { $show_hide_js = '('.$this->CI->lang->line('profiler_section_hide').')'; - if ($hide_queries != '') + if ($hide_queries !== '') { $show_hide_js = '('.$this->CI->lang->line('profiler_section_show').')'; } @@ -315,7 +315,7 @@ class CI_Profiler { ."\n" .'  '.$this->CI->lang->line('profiler_post_data')."  \n"; - if (count($_POST) == 0) + if (count($_POST) === 0) { $output .= '
'.$this->CI->lang->line('profiler_no_post').'
'; } @@ -365,7 +365,7 @@ class CI_Profiler { ."\n" .'  '.$this->CI->lang->line('profiler_uri_string')."  \n" .'
' - .($this->CI->uri->uri_string == '' ? $this->CI->lang->line('profiler_no_uri') : $this->CI->uri->uri_string) + .($this->CI->uri->uri_string === '' ? $this->CI->lang->line('profiler_no_uri') : $this->CI->uri->uri_string) .'
'; } @@ -402,7 +402,7 @@ class CI_Profiler { ."\n" .'  '.$this->CI->lang->line('profiler_memory_usage')."  \n" .'
' - .((function_exists('memory_get_usage') && ($usage = memory_get_usage()) != '') ? number_format($usage).' bytes' : $this->CI->lang->line('profiler_no_memory')) + .((function_exists('memory_get_usage') && ($usage = memory_get_usage()) !== '') ? number_format($usage).' bytes' : $this->CI->lang->line('profiler_no_memory')) .'
'; } -- cgit v1.2.3-24-g4f1b From c839d28f4230dce0c658338f267b821cc16490a2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 7 Jun 2012 14:35:27 +0300 Subject: Remove some unnecessary function_exists() checks and some minor improvements --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index aaac0c518..d96088c14 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -402,7 +402,7 @@ class CI_Profiler { ."\n" .'  '.$this->CI->lang->line('profiler_memory_usage')."  \n" .'
' - .((function_exists('memory_get_usage') && ($usage = memory_get_usage()) !== '') ? number_format($usage).' bytes' : $this->CI->lang->line('profiler_no_memory')) + .(($usage = memory_get_usage()) != '' ? number_format($usage).' bytes' : $this->CI->lang->line('profiler_no_memory')) .'
'; } -- cgit v1.2.3-24-g4f1b From 0140ddd510edffb901b98de6b80676ece183760c Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 16 Jun 2012 01:12:56 +0300 Subject: Fix issue #318 + added a default to the switch() in CI_Output::minify() --- system/libraries/Profiler.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index d96088c14..1e961f6df 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -116,6 +116,12 @@ class CI_Profiler { */ public function set_sections($config) { + if (isset($config['query_toggle_count'])) + { + $this->_query_toggle_count = (int) $config['query_toggle_count']; + unset($config['query_toggle_count']); + } + foreach ($config as $method => $enable) { if (in_array($method, $this->_available_sections)) -- cgit v1.2.3-24-g4f1b From c5536aac5752054f7f76e448d58b86407d8f574e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 1 Nov 2012 17:33:58 +0200 Subject: Manually apply PR #1594 (fixing phpdoc page-level generation/warnings) Also partially fixes issue #1295, fixes inconsistencies in some page-level docblocks and adds include checks in language files. --- system/libraries/Profiler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 1e961f6df..7d7069b95 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -1,4 +1,4 @@ - Date: Tue, 6 Nov 2012 13:31:21 +0200 Subject: Display DB object names in the Profiler and fix issue #1220 --- system/libraries/Profiler.php | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 7d7069b95..1c97e3481 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -75,12 +75,14 @@ class CI_Profiler { */ protected $CI; + // -------------------------------------------------------------------- + /** - * Constructor + * Class constructor * * Initialize Profiler * - * @param array $config + * @param array $config Parameters */ public function __construct($config = array()) { @@ -112,7 +114,7 @@ class CI_Profiler { * * Sets the private _compile_* properties to enable/disable Profiler sections * - * @param mixed + * @param mixed $config * @return void */ public function set_sections($config) @@ -191,11 +193,24 @@ class CI_Profiler { $dbs = array(); // Let's determine which databases are currently connected to - foreach (get_object_vars($this->CI) as $CI_object) + foreach (get_object_vars($this->CI) as $name => $cobject) { - if (is_object($CI_object) && is_subclass_of(get_class($CI_object), 'CI_DB')) + if (is_object($cobject)) { - $dbs[] = $CI_object; + if ($cobject instanceof CI_DB) + { + $dbs[get_class($this->CI).':$'.$name] = $cobject; + } + elseif ($cobject instanceof CI_Model) + { + foreach (get_object_vars($cobject) as $mname => $mobject) + { + if ($mobject instanceof CI_DB) + { + $dbs[get_class($cobject).':$'.$mname] = $mobject; + } + } + } } } @@ -220,7 +235,7 @@ class CI_Profiler { $output = "\n\n"; $count = 0; - foreach ($dbs as $db) + foreach ($dbs as $name => $db) { $hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : ''; @@ -234,7 +249,7 @@ class CI_Profiler { $output .= '
' ."\n" .'  '.$this->CI->lang->line('profiler_database') - .':  '.$db->database.'   '.$this->CI->lang->line('profiler_queries') + .':  '.$db->database.' ('.$name.')   '.$this->CI->lang->line('profiler_queries') .': '.count($db->queries).'  '.$show_hide_js."\n\n\n" .'\n"; -- cgit v1.2.3-24-g4f1b From 80500afbd188600212ca913a7bac073009feac73 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 1 Jan 2013 08:16:53 +0200 Subject: [ci skip] Happy new year --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 1c97e3481..e93239901 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 0b607252b1f3bcabfb8150120e683795ec3a0890 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 13 Feb 2013 10:34:16 +0200 Subject: Added small feature to profiler: total execution time count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit adds additional information to profiler like: DATABASE:  test   QUERIES: 3 (0.0016s)  (Hide) --- system/libraries/Profiler.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index e93239901..67922d51c 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -238,6 +238,8 @@ class CI_Profiler { foreach ($dbs as $name => $db) { $hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : ''; + + $total_time = number_format(array_sum($db->query_times), 4) . 's'; $show_hide_js = '('.$this->CI->lang->line('profiler_section_hide').')'; @@ -250,7 +252,7 @@ class CI_Profiler { ."\n" .'  '.$this->CI->lang->line('profiler_database') .':  '.$db->database.' ('.$name.')   '.$this->CI->lang->line('profiler_queries') - .': '.count($db->queries).'  '.$show_hide_js."\n\n\n" + .': '.count($db->queries).'('.$total_time.')'.'  '.$show_hide_js."\n\n\n" .'
\n"; if (count($db->queries) === 0) @@ -553,4 +555,4 @@ class CI_Profiler { } /* End of file Profiler.php */ -/* Location: ./system/libraries/Profiler.php */ \ No newline at end of file +/* Location: ./system/libraries/Profiler.php */ -- cgit v1.2.3-24-g4f1b From 554d5dc6c1b9c6880a2fba150018c21ded8675c6 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 13 Feb 2013 22:37:31 +0200 Subject: changes according to narfbg's request --- system/libraries/Profiler.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 67922d51c..a3fa61c7c 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -238,8 +238,8 @@ class CI_Profiler { foreach ($dbs as $name => $db) { $hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : ''; - - $total_time = number_format(array_sum($db->query_times), 4) . 's'; + + $total_time = number_format(array_sum($db->query_times), 4).$this->CI->lang->line('profiler_seconds'); $show_hide_js = '('.$this->CI->lang->line('profiler_section_hide').')'; @@ -555,4 +555,4 @@ class CI_Profiler { } /* End of file Profiler.php */ -/* Location: ./system/libraries/Profiler.php */ +/* Location: ./system/libraries/Profiler.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 3224f077c37a054ea1995c07fe54bbe8b00e058a Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 14 Feb 2013 09:26:24 +0200 Subject: changes according to narfbg's request --- system/libraries/Profiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index a3fa61c7c..ac8f6ba71 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -238,8 +238,8 @@ class CI_Profiler { foreach ($dbs as $name => $db) { $hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : ''; - - $total_time = number_format(array_sum($db->query_times), 4).$this->CI->lang->line('profiler_seconds'); + + $total_time = number_format(array_sum($db->query_times), 4).' '.$this->CI->lang->line('profiler_seconds'); $show_hide_js = '('.$this->CI->lang->line('profiler_section_hide').')'; -- cgit v1.2.3-24-g4f1b From 3567246091195e035ea4c8d3b2915eb6b45ad5e2 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Fri, 15 Feb 2013 01:36:04 +0100 Subject: Various cosmetic fixes --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index ac8f6ba71..36e0431b2 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -238,7 +238,7 @@ class CI_Profiler { foreach ($dbs as $name => $db) { $hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : ''; - + $total_time = number_format(array_sum($db->query_times), 4).' '.$this->CI->lang->line('profiler_seconds'); $show_hide_js = '('.$this->CI->lang->line('profiler_section_hide').')'; -- cgit v1.2.3-24-g4f1b From a107a0fd79d0ee5f6292138a76398ed390041710 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 15 Feb 2013 22:30:31 +0200 Subject: Fix some stuff from recent pull requests --- system/libraries/Profiler.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 36e0431b2..470688fdc 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -238,7 +238,6 @@ class CI_Profiler { foreach ($dbs as $name => $db) { $hide_queries = (count($db->queries) > $this->_query_toggle_count) ? ' display:none' : ''; - $total_time = number_format(array_sum($db->query_times), 4).' '.$this->CI->lang->line('profiler_seconds'); $show_hide_js = '('.$this->CI->lang->line('profiler_section_hide').')'; @@ -252,7 +251,7 @@ class CI_Profiler { ."\n" .'  '.$this->CI->lang->line('profiler_database') .':  '.$db->database.' ('.$name.')   '.$this->CI->lang->line('profiler_queries') - .': '.count($db->queries).'('.$total_time.')'.'  '.$show_hide_js."\n\n\n" + .': '.count($db->queries).' ('.$total_time.')  '.$show_hide_js."\n\n\n" .'
\n"; if (count($db->queries) === 0) -- cgit v1.2.3-24-g4f1b From 0e4237f8fb01320fb7cc87b1fb93a552630505d6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 4 Apr 2013 16:53:21 +0300 Subject: Fix #2380 and deprecate CI_Router::fetch_*() methods --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 470688fdc..3c7ce5406 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -405,7 +405,7 @@ class CI_Profiler { .'
' ."\n" .'  '.$this->CI->lang->line('profiler_controller_info')."  \n" - .'
'.$this->CI->router->fetch_class().'/'.$this->CI->router->fetch_method() + .'
'.$this->CI->router->class.'/'.$this->CI->router->method .'
'; } -- cgit v1.2.3-24-g4f1b From 164a1f28dd8f8093d260748e0d85fa714f232a57 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Sat, 18 May 2013 10:29:56 -0400 Subject: highlight_code() doesn't take an ENT_QUOTES arg Signed-off-by: Rasmus Lerdorf --- system/libraries/Profiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 3c7ce5406..7ce56931c 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -264,7 +264,7 @@ class CI_Profiler { foreach ($db->queries as $key => $val) { $time = number_format($db->query_times[$key], 4); - $val = highlight_code($val, ENT_QUOTES); + $val = highlight_code($val); foreach ($highlight as $bold) { @@ -554,4 +554,4 @@ class CI_Profiler { } /* End of file Profiler.php */ -/* Location: ./system/libraries/Profiler.php */ \ No newline at end of file +/* Location: ./system/libraries/Profiler.php */ -- cgit v1.2.3-24-g4f1b From 7c72cfc8fa363cdacf4c19d3d2534e73a54cac66 Mon Sep 17 00:00:00 2001 From: Iacami Date: Thu, 27 Jun 2013 12:20:48 -0300 Subject: Update Profiler.php to show HTTP_DNT status show do not track header status --- system/libraries/Profiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 3c7ce5406..62830fe22 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -447,7 +447,7 @@ class CI_Profiler { .'  ('.$this->CI->lang->line('profiler_section_show').")\n\n\n" .'
'."\n"; - foreach (array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR') as $header) + foreach (array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR', 'HTTP_DNT') as $header) { $val = isset($_SERVER[$header]) ? $_SERVER[$header] : ''; $output .= '\n"; } + foreach ($_FILES as $key => $val) + { + if ( ! is_numeric($key)) + { + $key = "'".$key."'"; + } + + $output .= '\n"; + } + $output .= "\n"; } + + return $output.'
'; } -- cgit v1.2.3-24-g4f1b From abcb67c76ccb384ea213f9c4f42a392b15b3e15e Mon Sep 17 00:00:00 2001 From: David Cox Jr Date: Wed, 16 Oct 2013 14:43:52 -0400 Subject: req. changes: cleaned up conditionals added changelog note regarding profiler updated as per styleguide --- system/libraries/Profiler.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 80130eb48..50ba1673f 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -307,10 +307,7 @@ class CI_Profiler { foreach ($_GET as $key => $val) { - if ( ! is_numeric($key)) - { - $key = "'".$key."'"; - } + is_int($key) OR $key = "'".$key."'"; $output .= '$_GET[' .$key.']   ' @@ -338,7 +335,7 @@ class CI_Profiler { ."\n" .'  '.$this->CI->lang->line('profiler_post_data')."  \n"; - if (count($_POST) === 0 AND count($_FILES) === 0) + if (count($_POST) === 0 && count($_FILES) === 0) { $output .= '
'.$this->CI->lang->line('profiler_no_post').'
'; } @@ -348,10 +345,7 @@ class CI_Profiler { foreach ($_POST as $key => $val) { - if ( ! is_numeric($key)) - { - $key = "'".$key."'"; - } + is_int($key) OR $key = "'".$key."'"; $output .= '$_POST[' .$key.']   '; @@ -370,10 +364,7 @@ class CI_Profiler { foreach ($_FILES as $key => $val) { - if ( ! is_numeric($key)) - { - $key = "'".$key."'"; - } + is_int($key) OR $key = "'".$key."'"; $output .= '$_FILES[' .$key.']   '; @@ -389,8 +380,6 @@ class CI_Profiler { $output .= "\n"; } - - return $output.''; } -- cgit v1.2.3-24-g4f1b From 0612e92461bb725835b4731a55d7f76588cd4cf9 Mon Sep 17 00:00:00 2001 From: Cristian Riffo Huez Date: Fri, 13 Dec 2013 22:09:44 -0300 Subject: Added post-increment for $count It has been added the missing post-increment for variable $count. --- system/libraries/Profiler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 50ba1673f..7c889dd96 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -278,6 +278,7 @@ class CI_Profiler { } $output .= "\n"; + $count++; } return $output; @@ -563,4 +564,4 @@ class CI_Profiler { } /* End of file Profiler.php */ -/* Location: ./system/libraries/Profiler.php */ \ No newline at end of file +/* Location: ./system/libraries/Profiler.php */ -- cgit v1.2.3-24-g4f1b From a6eae87d14efe3169156a12ad3706852ff70e2c4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 3 Jan 2014 18:25:20 +0200 Subject: [ci skip] Some spaces & docblock fixes --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 7c889dd96..4e556b23d 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -564,4 +564,4 @@ class CI_Profiler { } /* End of file Profiler.php */ -/* Location: ./system/libraries/Profiler.php */ +/* Location: ./system/libraries/Profiler.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From ecc260e0be0cdb55c4e4802b78ddd78b0d8b0ebc Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 24 Jan 2014 14:20:13 +0200 Subject: Righting a wrong in the Session library - Change userdata(), flashdata(), tempdata() to return all the respective data when no parameter is passed. - Revert the addition of all_flashdata(). - Deprecate all_userdata(). - Fix related changelog entries that were all inconsistent. --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 4e556b23d..4796e8416 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -516,7 +516,7 @@ class CI_Profiler { .'  '.$this->CI->lang->line('profiler_session_data').'  ('.$this->CI->lang->line('profiler_section_show').')' .''; - foreach ($this->CI->session->all_userdata() as $key => $val) + foreach ($this->CI->session->userdata() as $key => $val) { if (is_array($val) OR is_object($val)) { -- cgit v1.2.3-24-g4f1b From 871754af60251993d640981e107d2def5f2db396 Mon Sep 17 00:00:00 2001 From: darwinel Date: Tue, 11 Feb 2014 17:34:57 +0100 Subject: 2013 > 2014 Update copyright notices from 2013 to 2014. And update one calendar example in user_guide from year 2013/2014 to 2014/2015. --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 4796e8416..810a025a4 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -18,7 +18,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 -- cgit v1.2.3-24-g4f1b From 70a8626a4d9ddbf9467970acf1b329b1d484791f Mon Sep 17 00:00:00 2001 From: Richard Cunningham Date: Wed, 19 Mar 2014 13:11:14 -0400 Subject: Fix profiling of benchmarked names like 'something_endpoint_end' --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 810a025a4..197dab7d9 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -153,7 +153,7 @@ class CI_Profiler { { // We match the "end" marker so that the list ends // up in the order that it was defined - if (preg_match('/(.+?)_end/i', $key, $match) + if (preg_match('/(.+?)_end$/i', $key, $match) && isset($this->CI->benchmark->marker[$match[1].'_end'], $this->CI->benchmark->marker[$match[1].'_start'])) { $profile[$match[1]] = $this->CI->benchmark->elapsed_time($match[1].'_start', $key); -- cgit v1.2.3-24-g4f1b From bdb96ca1b1dbfc1791172fd169d7751cbc4d7d55 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 28 Oct 2014 00:13:31 +0200 Subject: [ci skip] Switch to MIT license; close #3293 --- system/libraries/Profiler.php | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 197dab7d9..fdc451b5c 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -4,24 +4,35 @@ * * An open source application development framework for PHP 5.2.4 or newer * - * NOTICE OF LICENSE + * This content is released under the MIT License (MIT) * - * Licensed under the Open Software License version 3.0 + * Copyright (c) 2014, British Columbia Institute of Technology * - * This source file is subject to the Open Software License (OSL 3.0) that is - * bundled with this package in the files license.txt / license.rst. It is - * also available through the world wide web at this URL: - * http://opensource.org/licenses/OSL-3.0 - * If you did not receive a copy of the license and are unable to obtain it - * through the world wide web, please send an email to - * licensing@ellislab.com so we can send you a copy immediately. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * - * @package CodeIgniter - * @author EllisLab Dev Team + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @package CodeIgniter + * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) - * @link http://codeigniter.com - * @since Version 1.0 + * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @license http://opensource.org/licenses/MIT MIT License + * @link http://codeigniter.com + * @since Version 1.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); -- cgit v1.2.3-24-g4f1b From fe9309d22c1b088f5363954d6dac013c8c955894 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 9 Jan 2015 17:48:58 +0200 Subject: Bulk (mostly documentation) update - Remove PHP version from license notices - Bump year number in copyright notices - Recommend PHP 5.4 or newer to be used - Tell Travis-CI to test on PHP 5.3.0 instead of the latest 5.3 version Related: #3450 --- system/libraries/Profiler.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index fdc451b5c..9a4e833cc 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -2,11 +2,11 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.2.4 or newer + * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014, British Columbia Institute of Technology + * Copyright (c) 2014 - 2015, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From 90726b8c769ea75aec34814ddfa91655d488e6c3 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Jan 2015 12:39:22 +0200 Subject: [ci skip] Change some log messages' level 'Class Loaded' type of messages flood log files when log_threshold is set to 2 (debug). They're now logged as 'info' level. This is manually applying PR #1528, which was created to do the same thing, but became outdated. --- system/libraries/Profiler.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 9a4e833cc..d3f5d8de2 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -116,6 +116,7 @@ class CI_Profiler { } $this->set_sections($config); + log_message('info', 'Profiler Class Initialized'); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 4cbe463b4c442e0e2dae2f43565e77f7ac5ecb86 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Wed, 21 Jan 2015 22:56:22 +0100 Subject: Remove closing blocks at end of PHP files --- system/libraries/Profiler.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index d3f5d8de2..f35d23faf 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -574,6 +574,3 @@ class CI_Profiler { } } - -/* End of file Profiler.php */ -/* Location: ./system/libraries/Profiler.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From fdf3073b23505e820cf8332612750e575e172a65 Mon Sep 17 00:00:00 2001 From: bjjay Date: Wed, 5 Aug 2015 17:58:36 +0800 Subject: Reduce once $config['query_toggle_count'] checking This checking can be done by calling set_sections method when initialize profiler . --- system/libraries/Profiler.php | 6 ------ 1 file changed, 6 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index f35d23faf..1e464d8b0 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -100,12 +100,6 @@ class CI_Profiler { $this->CI =& get_instance(); $this->CI->load->language('profiler'); - 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) { -- cgit v1.2.3-24-g4f1b From 125ef4751080a2118cb203357d77687699e3eb25 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:33:00 +0200 Subject: [ci skip] Bump year to 2016 --- system/libraries/Profiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 1e464d8b0..2f2848f35 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2015, British Columbia Institute of Technology + * Copyright (c) 2014 - 2016, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) - * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From bd202c91b0e9cf0a8c93bcaa71df9574f5909346 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:50:18 +0200 Subject: [ci skip] Update codeigniter.com links to https --- system/libraries/Profiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 2f2848f35..4ad33bbac 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License - * @link http://codeigniter.com + * @link https://codeigniter.com * @since Version 1.0.0 * @filesource */ @@ -50,7 +50,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @subpackage Libraries * @category Libraries * @author EllisLab Dev Team - * @link http://codeigniter.com/user_guide/general/profiling.html + * @link https://codeigniter.com/user_guide/general/profiling.html */ class CI_Profiler { -- cgit v1.2.3-24-g4f1b From 1924e879b165fb119847a49a7a5eab2f28295fa2 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 11 Jan 2016 12:55:34 +0200 Subject: [ci skip] Update ellislab.com links to https too --- system/libraries/Profiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 4ad33bbac..cc7641436 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -28,7 +28,7 @@ * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) + * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com -- cgit v1.2.3-24-g4f1b From e6a5f797de7381791537b736eb83b71c6fb28b39 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 7 Mar 2016 11:34:43 +0200 Subject: [ci skip] Fix Profiler not applying htmlspecialchars() to all inputs --- system/libraries/Profiler.php | 44 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index cc7641436..cf455d3da 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -314,12 +314,14 @@ class CI_Profiler { foreach ($_GET as $key => $val) { - is_int($key) OR $key = "'".$key."'"; + is_int($key) OR $key = "'".htmlspecialchars($key, ENT_QUOTES, config_item('charset'))."'"; + $val = (is_array($val) OR is_object($val)) + ? '
'.htmlspecialchars(print_r($val, TRUE), ENT_QUOTES, config_item('charset'))
+					: htmlspecialchars($val, ENT_QUOTES, config_item('charset'));
 
 				$output .= '
\n"; + .$val."\n"; } $output .= "\n"; @@ -352,36 +354,26 @@ class CI_Profiler { foreach ($_POST as $key => $val) { - is_int($key) OR $key = "'".$key."'"; + is_int($key) OR $key = "'".htmlspecialchars($key, ENT_QUOTES, config_item('charset'))."'"; + $val = (is_array($val) OR is_object($val)) + ? '
'.htmlspecialchars(print_r($val, TRUE), ENT_QUOTES, config_item('charset'))
+					: htmlspecialchars($val, ENT_QUOTES, config_item('charset'));
 
 				$output .= '$_POST['
-					.$key.']   ';
-
-				if (is_array($val) OR is_object($val))
-				{
-					$output .= '
'.htmlspecialchars(stripslashes(print_r($val, TRUE))).'
'; - } - else - { - $output .= htmlspecialchars(stripslashes($val)); - } - - $output .= "\n"; + .$key.']   ' + .$val."\n"; } foreach ($_FILES as $key => $val) { - is_int($key) OR $key = "'".$key."'"; + is_int($key) OR $key = "'".htmlspecialchars($key, ENT_QUOTES, config_item('charset'))."'"; + $val = (is_array($val) OR is_object($val)) + ? '
'.htmlspecialchars(print_r($val, TRUE), ENT_QUOTES, config_item('charset'))
+					: htmlspecialchars($val, ENT_QUOTES, config_item('charset'));
 
 				$output .= '$_FILES['
-					.$key.']   ';
-
-				if (is_array($val) OR is_object($val))
-				{
-					$output .= '
'.htmlspecialchars(stripslashes(print_r($val, TRUE))).'
'; - } - - $output .= "\n"; + .$key.']   ' + .$val."\n"; } $output .= "\n"; @@ -465,7 +457,7 @@ class CI_Profiler { foreach (array('HTTP_ACCEPT', 'HTTP_USER_AGENT', 'HTTP_CONNECTION', 'SERVER_PORT', 'SERVER_NAME', 'REMOTE_ADDR', 'SERVER_SOFTWARE', 'HTTP_ACCEPT_LANGUAGE', 'SCRIPT_NAME', 'REQUEST_METHOD',' HTTP_HOST', 'REMOTE_HOST', 'CONTENT_TYPE', 'SERVER_PROTOCOL', 'QUERY_STRING', 'HTTP_ACCEPT_ENCODING', 'HTTP_X_FORWARDED_FOR', 'HTTP_DNT') as $header) { - $val = isset($_SERVER[$header]) ? $_SERVER[$header] : ''; + $val = isset($_SERVER[$header]) ? htmlspecialchars($_SERVER[$header], ENT_QUOTES, config_item('charset')) : ''; $output .= '' .$header.'  '.$val."\n"; } -- cgit v1.2.3-24-g4f1b From da60e9bc66ec90970fbd2dfd08b0a6e66b9f5f5f Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Sat, 31 Dec 2016 08:46:18 -0800 Subject: Update copyright data to 2017 --- system/libraries/Profiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index cf455d3da..e9e03cfe0 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -6,7 +6,7 @@ * * This content is released under the MIT License (MIT) * - * Copyright (c) 2014 - 2016, British Columbia Institute of Technology + * Copyright (c) 2014 - 2017, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,7 +29,7 @@ * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) - * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) + * @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.0.0 -- cgit v1.2.3-24-g4f1b From cd8d52807854657cca365e40f6191c6ef2817341 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 23 Jan 2017 11:42:47 +0200 Subject: Merge pull request #4990 from tianhe1986/develop_profiler Two small changes with CI_Profiler --- system/libraries/Profiler.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'system/libraries/Profiler.php') diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index e9e03cfe0..9ea09a529 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -316,7 +316,7 @@ class CI_Profiler { { is_int($key) OR $key = "'".htmlspecialchars($key, ENT_QUOTES, config_item('charset'))."'"; $val = (is_array($val) OR is_object($val)) - ? '
'.htmlspecialchars(print_r($val, TRUE), ENT_QUOTES, config_item('charset'))
+					? '
'.htmlspecialchars(print_r($val, TRUE), ENT_QUOTES, config_item('charset')).'
' : htmlspecialchars($val, ENT_QUOTES, config_item('charset')); $output .= '$_GET[' @@ -356,7 +356,7 @@ class CI_Profiler { { is_int($key) OR $key = "'".htmlspecialchars($key, ENT_QUOTES, config_item('charset'))."'"; $val = (is_array($val) OR is_object($val)) - ? '
'.htmlspecialchars(print_r($val, TRUE), ENT_QUOTES, config_item('charset'))
+					? '
'.htmlspecialchars(print_r($val, TRUE), ENT_QUOTES, config_item('charset')).'
' : htmlspecialchars($val, ENT_QUOTES, config_item('charset')); $output .= '$_POST[' @@ -368,7 +368,7 @@ class CI_Profiler { { is_int($key) OR $key = "'".htmlspecialchars($key, ENT_QUOTES, config_item('charset'))."'"; $val = (is_array($val) OR is_object($val)) - ? '
'.htmlspecialchars(print_r($val, TRUE), ENT_QUOTES, config_item('charset'))
+					? '
'.htmlspecialchars(print_r($val, TRUE), ENT_QUOTES, config_item('charset')).'
' : htmlspecialchars($val, ENT_QUOTES, config_item('charset')); $output .= '$_FILES[' @@ -490,7 +490,7 @@ class CI_Profiler { } $output .= '' - .$config.'  '.htmlspecialchars($val)."\n"; + .$config.'  '.htmlspecialchars($val, ENT_QUOTES, config_item('charset'))."\n"; } return $output."\n"; @@ -522,7 +522,7 @@ class CI_Profiler { } $output .= '' - .$key.'  '.htmlspecialchars($val)."\n"; + .$key.'  '.htmlspecialchars($val, ENT_QUOTES, config_item('charset'))."\n"; } return $output."\n"; -- cgit v1.2.3-24-g4f1b