Permalink
Browse files

Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into …

…develop
  • Loading branch information...
2 parents a9a1d25 + f2b19fe commit 3ccc386be4e0e1e4b3d47f1785e11d4b8613ef72 @jdfm jdfm committed Oct 31, 2012
Showing with 1,399 additions and 1,104 deletions.
  1. +6 −5 application/config/config.php
  2. +2 −2 application/config/routes.php
  3. +18 −14 system/core/Benchmark.php
  4. +5 −3 system/core/CodeIgniter.php
  5. +34 −46 system/core/Config.php
  6. +6 −5 system/core/Controller.php
  7. +25 −23 system/core/Exceptions.php
  8. +24 −44 system/core/Hooks.php
  9. +121 −108 system/core/Input.php
  10. +15 −13 system/core/Lang.php
  11. +152 −134 system/core/Loader.php
  12. +6 −4 system/core/Model.php
  13. +85 −72 system/core/Output.php
  14. +36 −33 system/core/Router.php
  15. +100 −77 system/core/Security.php
  16. +195 −125 system/core/URI.php
  17. +14 −13 system/core/Utf8.php
  18. +3 −1 system/database/DB_query_builder.php
  19. +1 −1 system/database/drivers/oci8/oci8_result.php
  20. +11 −4 system/database/drivers/odbc/odbc_driver.php
  21. +9 −2 system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php
  22. +9 −2 system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php
  23. +9 −2 system/database/drivers/postgre/postgre_driver.php
  24. +7 −10 system/helpers/date_helper.php
  25. +4 −6 system/helpers/file_helper.php
  26. +26 −50 system/helpers/form_helper.php
  27. +4 −6 system/helpers/security_helper.php
  28. +5 −2 system/helpers/string_helper.php
  29. +4 −7 system/helpers/text_helper.php
  30. +32 −26 system/libraries/Cache/Cache.php
  31. +5 −3 system/libraries/Calendar.php
  32. +23 −6 system/libraries/Cart.php
  33. +30 −28 system/libraries/Email.php
  34. +5 −5 system/libraries/Form_validation.php
  35. +3 −3 system/libraries/Session/Session.php
  36. +1 −4 system/libraries/Session/drivers/Session_cookie.php
  37. +1 −1 system/libraries/Session/drivers/Session_native.php
  38. +1 −2 system/libraries/javascript/Jquery.php
  39. +13 −5 tests/codeigniter/core/Common_test.php
  40. +2 −23 tests/codeigniter/core/Config_test.php
  41. +2 −2 tests/codeigniter/core/Loader_test.php
  42. +32 −7 tests/codeigniter/helpers/form_helper_test.php
  43. +39 −14 user_guide_src/source/changelog.rst
  44. +1 −0 user_guide_src/source/database/configuration.rst
  45. +2 −2 user_guide_src/source/database/query_builder.rst
  46. +25 −5 user_guide_src/source/general/routing.rst
  47. +23 −24 user_guide_src/source/helpers/form_helper.rst
  48. +3 −0 user_guide_src/source/helpers/string_helper.rst
  49. +67 −22 user_guide_src/source/installation/upgrade_300.rst
  50. +48 −9 user_guide_src/source/libraries/caching.rst
  51. +10 −4 user_guide_src/source/libraries/cart.rst
  52. +95 −95 user_guide_src/source/libraries/form_validation.rst
@@ -62,11 +62,12 @@
| URI string. The default setting of 'AUTO' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
-| 'AUTO' Default - auto detects
-| 'PATH_INFO' Uses the PATH_INFO
-| 'QUERY_STRING' Uses the QUERY_STRING
-| 'REQUEST_URI' Uses the REQUEST_URI
-| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
+| 'AUTO' Default - auto detects
+| 'CLI' or 'argv' Uses $_SERVER['argv'] (for php-cli only)
+| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
+| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
+| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
+| 'ORIG_PATH_INFO' Uses $_SERVER['ORIG_PATH_INFO']
|
*/
$config['uri_protocol'] = 'AUTO';
@@ -59,8 +59,8 @@
|
| $route['404_override'] = 'errors/page_missing';
|
-| This route will tell the Router what URI segments to use if those provided
-| in the URL cannot be matched to a valid route.
+| This route will tell the Router which controller/method to use if those
+| provided in the URL cannot be matched to a valid route.
|
*/
@@ -26,7 +26,7 @@
*/
/**
- * CodeIgniter Benchmark Class
+ * Benchmark Class
*
* This class enables you to mark points and calculate the time difference
* between them. Memory consumption can also be displayed.
@@ -40,21 +40,19 @@
class CI_Benchmark {
/**
- * List of all benchmark markers and when they were added
+ * List of all benchmark markers
*
- * @var array
+ * @var array
*/
- public $marker = array();
-
- // --------------------------------------------------------------------
+ public $marker = array();
/**
* Set a benchmark marker
*
* Multiple calls to this function can be made so that several
- * execution points can be timed
+ * execution points can be timed.
*
- * @param string $name name of the marker
+ * @param string $name Marker name
* @return void
*/
public function mark($name)
@@ -65,17 +63,22 @@ public function mark($name)
// --------------------------------------------------------------------
/**
+ * Elapsed time
+ *
* Calculates the time difference between two marked points.
*
* If the first parameter is empty this function instead returns the
* {elapsed_time} pseudo-variable. This permits the full system
* execution time to be shown in a template. The output class will
* swap the real value for this variable.
*
- * @param string a particular marked point
- * @param string a particular marked point
- * @param integer the number of decimal places
- * @return mixed
+ * @param string $point1 A particular marked point
+ * @param string $point2 A particular marked point
+ * @param int $decimals Number of decimal places
+ *
+ * @return string Calculated elapsed time on success,
+ * an '{elapsed_string}' if $point1 is empty
+ * or an empty string if $point1 is not found.
*/
public function elapsed_time($point1 = '', $point2 = '', $decimals = 4)
{
@@ -102,12 +105,13 @@ public function elapsed_time($point1 = '', $point2 = '', $decimals = 4)
/**
* Memory Usage
*
- * This function returns the {memory_usage} pseudo-variable.
+ * Simply returns the {memory_usage} marker.
+ *
* This permits it to be put it anywhere in a template
* without the memory being calculated until the end.
* The output class will swap the real value for this variable.
*
- * @return string
+ * @return string '{memory_usage}'
*/
public function memory_usage()
{
@@ -130,9 +130,12 @@
$CFG =& load_class('Config', 'core');
// Do we have any manually set config items in the index.php file?
- if (isset($assign_to_config))
+ if (isset($assign_to_config) && is_array($assign_to_config))
{
- $CFG->_assign_to_config($assign_to_config);
+ foreach ($assign_to_config as $key => $value)
+ {
+ $CFG->set_item($key, $value);
+ }
}
/*
@@ -229,7 +232,6 @@ function &get_instance()
return CI_Controller::get_instance();
}
-
if (file_exists(APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php'))
{
require APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php';
@@ -26,7 +26,7 @@
*/
/**
- * CodeIgniter Config Class
+ * Config Class
*
* This class contains functions that enable config files to be managed
*
@@ -41,29 +41,31 @@ class CI_Config {
/**
* List of all loaded config values
*
- * @var array
+ * @var array
*/
public $config = array();
/**
* List of all loaded config files
*
- * @var array
+ * @var array
*/
public $is_loaded = array();
/**
* List of paths to search when trying to load a config file.
- * This must be public as it's used by the Loader class.
*
- * @var array
+ * @used-by CI_Loader
+ * @var array
*/
public $_config_paths = array(APPPATH);
/**
- * Constructor
+ * Class constructor
*
- * Sets the $config data from the primary config.php file as a class variable
+ * Sets the $config data from the primary config.php file as a class variable.
+ *
+ * @return void
*/
public function __construct()
{
@@ -93,10 +95,10 @@ public function __construct()
/**
* Load Config File
*
- * @param string the config file name
- * @param bool if configuration values should be loaded into their own section
- * @param bool true if errors should just return false, false if an error message should be displayed
- * @return bool if the file was loaded correctly
+ * @param string $file Configuration file name
+ * @param bool $use_sections Whether configuration values should be loaded into their own section
+ * @param bool $fail_gracefully Whether to just return FALSE or display an error message
+ * @return bool TRUE if the file was loaded correctly or FALSE on failure
*/
public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
{
@@ -183,9 +185,9 @@ public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE
/**
* Fetch a config file item
*
- * @param string the config item name
- * @param string the index name
- * @return string
+ * @param string $item Config item name
+ * @param string $index Index name
+ * @return string|bool The configuration item or FALSE on failure
*/
public function item($item, $index = '')
{
@@ -200,10 +202,10 @@ public function item($item, $index = '')
// --------------------------------------------------------------------
/**
- * Fetch a config file item - adds slash after item (if item is not empty)
+ * Fetch a config file item with slash appended (if not empty)
*
- * @param string the config item name
- * @return string
+ * @param string $item Config item name
+ * @return string|bool The configuration item or FALSE on failure
*/
public function slash_item($item)
{
@@ -223,9 +225,12 @@ public function slash_item($item)
/**
* Site URL
+ *
* Returns base_url . index_page [. uri_string]
*
- * @param mixed the URI string or an array of segments
+ * @uses CI_Config::_uri_string()
+ *
+ * @param string|string[] $uri URI string or an array of segments
* @return string
*/
public function site_url($uri = '')
@@ -264,9 +269,12 @@ public function site_url($uri = '')
/**
* Base URL
+ *
* Returns base_url [. uri_string]
*
- * @param string $uri
+ * @uses CI_Config::_uri_string()
+ *
+ * @param string|string[] $uri URI string or an array of segments
* @return string
*/
public function base_url($uri = '')
@@ -277,9 +285,12 @@ public function base_url($uri = '')
// -------------------------------------------------------------
/**
- * Build URI string for use in Config::site_url() and Config::base_url()
+ * Build URI string
+ *
+ * @used-by CI_Config::site_url()
+ * @used-by CI_Config::base_url()
*
- * @param mixed $uri
+ * @param string|string[] $uri URI string or an array of segments
* @return string
*/
protected function _uri_string($uri)
@@ -318,38 +329,15 @@ public function system_url()
/**
* Set a config file item
*
- * @param string the config item key
- * @param string the config item value
+ * @param string $item Config item key
+ * @param string $value Config item value
* @return void
*/
public function set_item($item, $value)
{
$this->config[$item] = $value;
}
- // --------------------------------------------------------------------
-
- /**
- * Assign to Config
- *
- * This function is called by the front controller (CodeIgniter.php)
- * after the Config class is instantiated. It permits config items
- * to be assigned or overriden by variables contained in the index.php file
- *
- * @param array
- * @return void
- */
- public function _assign_to_config($items = array())
- {
- if (is_array($items))
- {
- foreach ($items as $key => $val)
- {
- $this->set_item($key, $val);
- }
- }
- }
-
}
/* End of file Config.php */
@@ -26,7 +26,7 @@
*/
/**
- * CodeIgniter Application Controller Class
+ * Application Controller Class
*
* This class object is the super class that every library in
* CodeIgniter will be assigned to.
@@ -40,15 +40,14 @@
class CI_Controller {
/**
- * Reference to the global CI instance
+ * Reference to the CI singleton
*
- * @static
* @var object
*/
private static $instance;
/**
- * Set up controller properties and methods
+ * Class constructor
*
* @return void
*/
@@ -69,8 +68,10 @@ public function __construct()
log_message('debug', 'Controller Class Initialized');
}
+ // --------------------------------------------------------------------
+
/**
- * Return the CI object
+ * Get the CI singleton
*
* @static
* @return object
Oops, something went wrong. Retry.

0 comments on commit 3ccc386

Please sign in to comment.