From b1fddc051af66a0a41a709862dd84d06139e2325 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 9 Oct 2006 21:29:07 +0000 Subject: --- system/application/config/database.php | 2 +- system/application/config/mimes.php | 2 +- system/libraries/Loader.php | 16 +++++++++++++--- system/libraries/User_agent.php | 15 ++++++++++----- user_guide/installation/upgrade_150.html | 15 ++++++++------- user_guide/libraries/calendar.html | 2 ++ user_guide/libraries/encryption.html | 2 ++ user_guide/libraries/parser.html | 2 ++ user_guide/libraries/sessions.html | 1 + user_guide/libraries/table.html | 2 ++ user_guide/libraries/trackback.html | 1 + user_guide/libraries/unit_testing.html | 1 + user_guide/libraries/zip.html | 2 ++ 13 files changed, 46 insertions(+), 17 deletions(-) diff --git a/system/application/config/database.php b/system/application/config/database.php index de781646c..c594ba896 100644 --- a/system/application/config/database.php +++ b/system/application/config/database.php @@ -40,7 +40,7 @@ $db['default']['dbprefix'] = ""; $db['default']['active_r'] = TRUE; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; -$db['default']['cache_on'] = TRUE; +$db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = APPPATH.'db_cache/'; diff --git a/system/application/config/mimes.php b/system/application/config/mimes.php index de0a91752..8b5036f23 100644 --- a/system/application/config/mimes.php +++ b/system/application/config/mimes.php @@ -4,7 +4,7 @@ | MIME TYPES | ------------------------------------------------------------------- | This file contains an array of mime types. It is used by the -| Upload class to help identyfiy allowed file types. +| Upload class to help identify allowed file types. | */ diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 452e39dfa..dc588bb0c 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -30,12 +30,13 @@ class CI_Loader { var $CI; var $ob_level; + var $view_path = ''; var $cached_vars = array(); var $models = array(); var $helpers = array(); var $plugins = array(); var $scripts = array(); - var $view_path = ''; + var $varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); /** * Constructor @@ -665,6 +666,7 @@ class CI_Loader { function _ci_init_class($class, $prefix = '', $varname = NULL) { // Is there an associated config file for this class? + $config = NULL; if (file_exists(APPPATH.'config/'.$class.EXT)) { include_once(APPPATH.'config/'.$class.EXT); @@ -678,9 +680,17 @@ class CI_Loader { { $name = $prefix.$class; } - - $classvar = ( ! is_null($varname)) ? $varname : strtolower($class); + // Set the variable name we will assign the class to + if ( ! is_null($varname)) + { + $classvar = $varname; + } + else + { + $class = strtolower($class); + $classvar = ( ! isset($this->varmap[$class])) ? $class : $this->varmap[$class]; + } // Instantiate the class if ($config !== NULL) diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 39e12327f..11c2baa68 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -37,12 +37,16 @@ class CI_User_agent { var $languages = array(); var $charsets = array(); + var $platforms = array(); + var $browsers = array(); + var $mobiles = array(); + var $robots = array(); + var $platform = ''; var $browser = ''; var $version = ''; var $moble = ''; var $robot = ''; - /** * Constructor @@ -66,8 +70,9 @@ class CI_User_agent { $this->_compile_data(); } } + + log_message('debug', "Table Class Initialized"); } - // -------------------------------------------------------------------- @@ -79,7 +84,7 @@ class CI_User_agent { */ function _load_agent_file() { - if ( ! @include(APPPATH.'config/user_agent'.EXT)) + if ( ! @include(APPPATH.'config/user_agents'.EXT)) { return FALSE; } @@ -102,7 +107,7 @@ class CI_User_agent { if (isset($mobiles)) { - $this->browsers = $mobiles; + $this->mobiles = $mobiles; unset($mobiles); $return = TRUE; } @@ -344,7 +349,7 @@ class CI_User_agent { * @access public * @return string */ - function agent() + function agent_string() { return $this->agent; } diff --git a/user_guide/installation/upgrade_150.html b/user_guide/installation/upgrade_150.html index 55ebaa747..b532073fd 100644 --- a/user_guide/installation/upgrade_150.html +++ b/user_guide/installation/upgrade_150.html @@ -71,16 +71,17 @@ have not upgraded to that version please do so first.

Step 1: Update your Code Igniter files

-

Replace these directories in your "system" folder with the new versions: +

Replace these files and directories in your "system" folder with the new versions:

Note: If you have any custom developed files in these folders please make copies of them first.

diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index cd3e66441..9d2a01e1b 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -75,6 +75,8 @@ template, allowing 100% control over every aspect of its design. In addition, yo $this->load->library('calendar');

Once loaded, the Calendar object will be available using: $this->calendar

+

You can also set your own class variable name. Please see the Loader Class for more info.

+

Displaying a Calendar

diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 9be32cf4f..92d128cd8 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -110,6 +110,8 @@ for example, can only hold 4K of information.

$this->load->library('encrypt');

Once loaded, the Encrypt library object will be available using: $this->encrypt

+

You can also set your own class variable name. Please see the Loader Class for more info.

+

$this->encrypt->encode()

diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index bf7b13518..2f93baf0b 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -103,6 +103,8 @@ full-blown template parsing solution. We've kept it very lean on purpose in orde $this->load->library('parser');

Once loaded, the Parser library object will be available using: $this->parser

+

You can also set your own class variable name. Please see the Loader Class for more info.

+

The following functions are available in this library:

diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 5a1216f6e..7a894faed 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -87,6 +87,7 @@ will cause it to read, create, and update sessions.

$this->load->library('session');

Once loaded, the Sessions library object will be available using: $this->session

+

You can also set your own class variable name. Please see the Loader Class for more info.

How do Sessions work?

diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 61b5ce82f..c2e323993 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -72,6 +72,8 @@ HTML Table Class $this->load->library('table');

Once loaded, the Table library object will be available using: $this->table

+

You can also set your own class variable name. Please see the Loader Class for more info.

+

Examples

diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 0621d4e75..87f6f3a0b 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -74,6 +74,7 @@ Trackback Class $this->load->library('trackback');

Once loaded, the Trackback library object will be available using: $this->trackback

+

You can also set your own class variable name. Please see the Loader Class for more info.

Sending Trackbacks

diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index 11a8fc26c..aa7475870 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -78,6 +78,7 @@ to determine if it is producing the correct data type and result. $this->load->library('unit');

Once loaded, the Unit Test object will be available using: $this->unit

+

You can also set your own class variable name. Please see the Loader Class for more info.

Running Tests

diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 6171ed1c8..32ef3bedd 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -71,6 +71,8 @@ desktop or saved to a directory.

$this->load->library('zip');

Once loaded, the Zip library object will be available using: $this->zip

+

You can also set your own class variable name. Please see the Loader Class for more info.

+

Usage Example

-- cgit v1.2.3-24-g4f1b