summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/config/config.php11
-rw-r--r--system/core/Loader.php2
-rw-r--r--system/core/Log.php7
-rw-r--r--system/core/URI.php2
-rw-r--r--system/language/english/profiler_lang.php1
-rw-r--r--system/libraries/Cart.php2
-rw-r--r--system/libraries/Form_validation.php2
-rw-r--r--system/libraries/Profiler.php4
-rw-r--r--system/libraries/Upload.php4
-rw-r--r--tests/codeigniter/core/URI_test.php2
-rw-r--r--user_guide_src/source/changelog.rst5
-rw-r--r--user_guide_src/source/database/call_function.rst2
-rw-r--r--user_guide_src/source/general/controllers.rst4
-rw-r--r--user_guide_src/source/general/routing.rst2
-rw-r--r--user_guide_src/source/installation/upgrade_300.rst4
15 files changed, 38 insertions, 16 deletions
diff --git a/application/config/config.php b/application/config/config.php
index 415474e06..6f597b1e2 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -226,6 +226,17 @@ $config['log_path'] = '';
/*
|--------------------------------------------------------------------------
+| Log File Extension
+|--------------------------------------------------------------------------
+|
+| Leave this BLANK unless you would like to set something other than the default
+| 'php'. For example you could change it to 'log'.
+|
+*/
+$config['log_file_extension'] = '';
+
+/*
+|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
diff --git a/system/core/Loader.php b/system/core/Loader.php
index 00ca35199..9306a09ef 100644
--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -988,7 +988,7 @@ class CI_Loader {
return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name);
}
- // Lets search for the requested library file and load it.
+ // Let's search for the requested library file and load it.
foreach ($this->_ci_library_paths as $path)
{
$filepath = $path.'libraries/'.$subdir.$class.'.php';
diff --git a/system/core/Log.php b/system/core/Log.php
index f5d091e14..0749de8ba 100644
--- a/system/core/Log.php
+++ b/system/core/Log.php
@@ -97,6 +97,8 @@ class CI_Log {
$this->_log_path = ($config['log_path'] !== '') ? $config['log_path'] : APPPATH.'logs/';
+ $this->_log_ext = ($config['log_file_extension'] !== '') ? ltrim($config['log_file_extension'], '.') : $this->_log_ext;
+
file_exists($this->_log_path) OR mkdir($this->_log_path, DIR_WRITE_MODE, TRUE);
if ( ! is_dir($this->_log_path) OR ! is_really_writable($this->_log_path))
@@ -153,7 +155,10 @@ class CI_Log {
if ( ! file_exists($filepath))
{
$newfile = TRUE;
- $message .= '<'."?php defined('BASEPATH') OR exit('No direct script access allowed'); ?".">\n\n";
+ if($this->_log_ext === 'php')
+ {
+ $message .= '<'."?php defined('BASEPATH') OR exit('No direct script access allowed'); ?".">\n\n";
+ }
}
if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE))
diff --git a/system/core/URI.php b/system/core/URI.php
index 9b31a646b..b2286f032 100644
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -126,7 +126,7 @@ class CI_URI {
return;
}
- // As a last ditch effort lets try using the $_GET array
+ // As a last ditch effort let's try using the $_GET array
if (is_array($_GET) && count($_GET) === 1 && trim(key($_GET), '/') !== '')
{
$this->_set_uri_string(key($_GET));
diff --git a/system/language/english/profiler_lang.php b/system/language/english/profiler_lang.php
index dfe034e79..0ed5f4cb0 100644
--- a/system/language/english/profiler_lang.php
+++ b/system/language/english/profiler_lang.php
@@ -46,6 +46,7 @@ $lang['profiler_no_memory'] = 'Memory Usage Unavailable';
$lang['profiler_no_profiles'] = 'No Profile data - all Profiler sections have been disabled.';
$lang['profiler_section_hide'] = 'Hide';
$lang['profiler_section_show'] = 'Show';
+$lang['profiler_seconds'] = 'seconds';
/* End of file profiler_lang.php */
/* Location: ./system/language/english/profiler_lang.php */ \ No newline at end of file
diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php
index d64f6f042..b7b0697fb 100644
--- a/system/libraries/Cart.php
+++ b/system/libraries/Cart.php
@@ -365,7 +365,7 @@ class CI_Cart {
*/
protected function _save_cart()
{
- // Lets add up the individual prices and set the cart sub-total
+ // Let's add up the individual prices and set the cart sub-total
$this->_cart_contents['total_items'] = $this->_cart_contents['cart_total'] = 0;
foreach ($this->_cart_contents as $key => $val)
{
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 4cf4ecae0..172e799f6 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -356,7 +356,7 @@ class CI_Form_validation {
*/
public function error_string($prefix = '', $suffix = '')
{
- // No errrors, validation passes!
+ // No errors, validation passes!
if (count($this->_error_array) === 0)
{
return '';
diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php
index e93239901..36e0431b2 100644
--- a/system/libraries/Profiler.php
+++ b/system/libraries/Profiler.php
@@ -239,6 +239,8 @@ class CI_Profiler {
{
$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 = '(<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_queries_db_'.$count.'\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_hide').'\'?\''.$this->CI->lang->line('profiler_section_show').'\':\''.$this->CI->lang->line('profiler_section_hide').'\';">'.$this->CI->lang->line('profiler_section_hide').'</span>)';
if ($hide_queries !== '')
@@ -250,7 +252,7 @@ class CI_Profiler {
."\n"
.'<legend style="color:#0000FF;">&nbsp;&nbsp;'.$this->CI->lang->line('profiler_database')
.':&nbsp; '.$db->database.' ('.$name.')&nbsp;&nbsp;&nbsp;'.$this->CI->lang->line('profiler_queries')
- .': '.count($db->queries).'&nbsp;&nbsp;'.$show_hide_js."</legend>\n\n\n"
+ .': '.count($db->queries).'('.$total_time.')'.'&nbsp;&nbsp;'.$show_hide_js."</legend>\n\n\n"
.'<table style="width:100%;'.$hide_queries.'" id="ci_profiler_queries_db_'.$count."\">\n";
if (count($db->queries) === 0)
diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php
index 814ea68a4..acd76b03b 100644
--- a/system/libraries/Upload.php
+++ b/system/libraries/Upload.php
@@ -430,7 +430,7 @@ class CI_Upload {
}
else
{
- // An extension was provided, lets have it!
+ // An extension was provided, let's have it!
$this->file_ext = $this->get_extension($this->_file_name_override);
}
@@ -1050,7 +1050,7 @@ class CI_Upload {
// <a, <body, <head, <html, <img, <plaintext, <pre, <script, <table, <title
// title is basically just in SVG, but we filter it anyhow
- // if its an image or no "triggers" detected in the first 256 bytes - we're good
+ // if it's an image or no "triggers" detected in the first 256 bytes - we're good
return ! preg_match('/<(a|body|head|html|img|plaintext|pre|script|table|title)[\s>]/i', $opening_bytes);
}
diff --git a/tests/codeigniter/core/URI_test.php b/tests/codeigniter/core/URI_test.php
index e2deabe51..7fa0e6265 100644
--- a/tests/codeigniter/core/URI_test.php
+++ b/tests/codeigniter/core/URI_test.php
@@ -91,7 +91,7 @@ class URI_test extends CI_TestCase {
public function test_explode_segments()
{
- // Lets test the function's ability to clean up this mess
+ // Let's test the function's ability to clean up this mess
$uris = array(
'test/uri' => array('test', 'uri'),
'/test2/uri2' => array('test2', 'uri2'),
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 893c3db61..140fda8e7 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -55,6 +55,7 @@ Release Date: Not Released
- Updated *ip_address* database field lengths from 16 to 45 for supporting IPv6 address on :doc:`Trackback Library <libraries/trackback>` and :doc:`Captcha Helper <helpers/captcha_helper>`.
- Removed *cheatsheets* and *quick_reference* PDFs from the documentation.
- Added availability checks where usage of dangerous functions like ``eval()`` and ``exec()`` is required.
+ - Added support for changing the file extension of CodeIgniter log files using $config['log_file_extension'].
- Helpers
@@ -271,7 +272,9 @@ Release Date: Not Released
- :doc:`Encryption Library <libraries/encryption>` changes include:
- Added support for hashing algorithms other than SHA1 and MD5.
- Removed previously deprecated ``sha1()`` method.
- - :doc:`Profiler Library <general/profiling>` now also displays database object names.
+ - :doc:`Profiler Library <general/profiling>` changes include:
+ - Database object names displayed.
+ - The sum of all queries running times in seconds displayed.
- :doc:`Migration Library <libraries/migration>` changes include:
- Added support for timestamp-based migrations (enabled by default).
- Added ``$config['migration_type']`` to allow switching between *sequential* and *timestamp* migrations.
diff --git a/user_guide_src/source/database/call_function.rst b/user_guide_src/source/database/call_function.rst
index 9890fc453..83fc870d0 100644
--- a/user_guide_src/source/database/call_function.rst
+++ b/user_guide_src/source/database/call_function.rst
@@ -7,7 +7,7 @@ $this->db->call_function();
This function enables you to call PHP database functions that are not
natively included in CodeIgniter, in a platform independent manner. For
-example, lets say you want to call the mysql_get_client_info()
+example, let's say you want to call the mysql_get_client_info()
function, which is **not** natively supported by CodeIgniter. You could
do so like this::
diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst
index 729b08417..8cfb012a0 100644
--- a/user_guide_src/source/general/controllers.rst
+++ b/user_guide_src/source/general/controllers.rst
@@ -108,7 +108,7 @@ Passing URI Segments to your methods
If your URI contains more then two segments they will be passed to your
method as parameters.
-For example, lets say you have a URI like this::
+For example, let's say you have a URI like this::
example.com/index.php/products/shoes/sandals/123
@@ -267,7 +267,7 @@ Simply create folders within your *application/controllers/* directory
and place your controller classes within them.
.. note:: When using this feature the first segment of your URI must
- specify the folder. For example, lets say you have a controller located
+ specify the folder. For example, let's say you have a controller located
here::
application/controllers/products/shoes.php
diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst
index ed21a6109..0c6dfe888 100644
--- a/user_guide_src/source/general/routing.rst
+++ b/user_guide_src/source/general/routing.rst
@@ -12,7 +12,7 @@ In some instances, however, you may want to remap this relationship so
that a different class/method can be called instead of the one
corresponding to the URL.
-For example, lets say you want your URLs to have this prototype::
+For example, let's say you want your URLs to have this prototype::
example.com/product/1/
example.com/product/2/
diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst
index 2d125a71a..a3ea01d02 100644
--- a/user_guide_src/source/installation/upgrade_300.rst
+++ b/user_guide_src/source/installation/upgrade_300.rst
@@ -129,9 +129,9 @@ The above files should respectively be renamed to the following:
application/libraries/MY_Email.php
application/core/MY_Log.php
-****************************************************************************
+*****************************************************************************
Step 10: Check the calls to Array Helper's element() and elements() functions
-****************************************************************************
+*****************************************************************************
The default return value of these functions, when the required elements
don't exist, has been changed from FALSE to NULL.