From 7efad20597ef7e06f8cf837a9f40918d2d3f2727 Mon Sep 17 00:00:00 2001 From: Jamie Rumbelow Date: Sun, 19 Feb 2012 12:37:00 +0000 Subject: Renaming Active Record to Query Builder across the system --- system/core/Loader.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'system/core') diff --git a/system/core/Loader.php b/system/core/Loader.php index 12daaa928..750e8cdd6 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -315,16 +315,16 @@ class CI_Loader { * * @param string the DB credentials * @param bool whether to return the DB object - * @param bool whether to enable active record (this allows us to override the config setting) + * @param bool whether to enable query builder (this allows us to override the config setting) * @return object */ - public function database($params = '', $return = FALSE, $active_record = NULL) + public function database($params = '', $return = FALSE, $query_builder = NULL) { // Grab the super object $CI =& get_instance(); // Do we even need to load the database class? - if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db)) + if (class_exists('CI_DB') AND $return == FALSE AND $query_builder == NULL AND isset($CI->db) AND is_object($CI->db)) { return FALSE; } @@ -333,7 +333,7 @@ class CI_Loader { if ($return === TRUE) { - return DB($params, $active_record); + return DB($params, $query_builder); } // Initialize the db variable. Needed to prevent @@ -341,7 +341,7 @@ class CI_Loader { $CI->db = ''; // Load the DB class - $CI->db =& DB($params, $active_record); + $CI->db =& DB($params, $query_builder); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 3684d349d1f5239ad9703c07f14ae77389818daf Mon Sep 17 00:00:00 2001 From: Korri Date: Tue, 17 Apr 2012 00:35:08 -0400 Subject: Adding a package adds configuration folder to the end of the list. --- system/core/Loader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core') diff --git a/system/core/Loader.php b/system/core/Loader.php index 027ed20e5..a4039c6f0 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -673,7 +673,7 @@ class CI_Loader { // Add config file path $config =& $this->_ci_get_component('config'); - array_unshift($config->_config_paths, $path); + array_push($config->_config_paths, $path); } // -------------------------------------------------------------------- @@ -713,7 +713,7 @@ class CI_Loader { array_shift($this->_ci_model_paths); array_shift($this->_ci_helper_paths); array_shift($this->_ci_view_paths); - array_shift($config->_config_paths); + array_pop($config->_config_paths); } else { -- cgit v1.2.3-24-g4f1b From ab3cab5a8f2afdd45ec8c6c365e43722781e54e6 Mon Sep 17 00:00:00 2001 From: dixy Date: Sat, 21 Apr 2012 00:58:00 +0200 Subject: Use parameter 'get_as_float' of microtime() --- system/core/Benchmark.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'system/core') diff --git a/system/core/Benchmark.php b/system/core/Benchmark.php index f6b634deb..39027e809 100755 --- a/system/core/Benchmark.php +++ b/system/core/Benchmark.php @@ -61,7 +61,7 @@ class CI_Benchmark { */ public function mark($name) { - $this->marker[$name] = microtime(); + $this->marker[$name] = microtime(TRUE); } // -------------------------------------------------------------------- @@ -93,13 +93,10 @@ class CI_Benchmark { if ( ! isset($this->marker[$point2])) { - $this->marker[$point2] = microtime(); + $this->marker[$point2] = microtime(TRUE); } - list($sm, $ss) = explode(' ', $this->marker[$point1]); - list($em, $es) = explode(' ', $this->marker[$point2]); - - return number_format(($em + $es) - ($sm + $ss), $decimals); + return number_format($this->marker[$point2] - $this->marker[$point1], $decimals); } // -------------------------------------------------------------------- @@ -122,4 +119,4 @@ class CI_Benchmark { } /* End of file Benchmark.php */ -/* Location: ./system/core/Benchmark.php */ +/* Location: ./system/core/Benchmark.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From b3f774bbbb81293326136e3e13297c3b8d49dfa4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 23 Apr 2012 12:57:57 +0300 Subject: Fix issue #1265 --- system/core/CodeIgniter.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'system/core') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 4885f310c..92187fa16 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -275,12 +275,12 @@ { $x = explode('/', $RTR->routes['404_override'], 2); $class = $x[0]; - $method = (isset($x[1]) ? $x[1] : 'index'); + $method = isset($x[1]) ? $x[1] : 'index'; if ( ! class_exists($class)) { if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) { - show_404("{$class}/{$method}"); + show_404($class.'/'.$method); } include_once(APPPATH.'controllers/'.$class.'.php'); @@ -288,7 +288,7 @@ } else { - show_404("{$class}/{$method}"); + show_404($class.'/'.$method); } } @@ -337,12 +337,12 @@ { $x = explode('/', $RTR->routes['404_override'], 2); $class = $x[0]; - $method = (isset($x[1]) ? $x[1] : 'index'); + $method = isset($x[1]) ? $x[1] : 'index'; if ( ! class_exists($class)) { if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')) { - show_404("{$class}/{$method}"); + show_404($class.'/'.$method); } include_once(APPPATH.'controllers/'.$class.'.php'); @@ -352,7 +352,7 @@ } else { - show_404("{$class}/{$method}"); + show_404($class.'/'.$method); } } @@ -393,10 +393,10 @@ * Close the DB connection if one exists * ------------------------------------------------------ */ - if (class_exists('CI_DB') && isset($CI->db)) + if (class_exists('CI_DB') && isset($CI->db) && ! $CI->db->pconnect) { $CI->db->close(); } /* End of file CodeIgniter.php */ -/* Location: ./system/core/CodeIgniter.php */ +/* Location: ./system/core/CodeIgniter.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 31d30bcf206ed2e9168b93f74511708d6bc4b505 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 23 Apr 2012 08:58:42 -0400 Subject: Merge upstream --- system/core/CodeIgniter.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'system/core') diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 9714d095c..7deccd048 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * System Initialization File * @@ -406,4 +404,4 @@ } /* End of file CodeIgniter.php */ -/* Location: ./system/core/CodeIgniter.php */ +/* Location: ./system/core/CodeIgniter.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 48a7fbbeb53e82e9298036d40c42ec2564699ed0 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 23 Apr 2012 11:58:16 -0400 Subject: Use tabs to separate class properties --- system/core/Benchmark.php | 4 ++-- system/core/CodeIgniter.php | 2 +- system/core/Common.php | 1 - system/core/Config.php | 6 +++--- system/core/Controller.php | 2 +- system/core/Exceptions.php | 4 ++-- system/core/Hooks.php | 6 +++--- system/core/Input.php | 14 +++++++------- system/core/Lang.php | 4 ++-- system/core/Loader.php | 22 +++++++++++----------- system/core/Output.php | 14 +++++++------- system/core/Router.php | 10 +++++----- system/core/Security.php | 14 +++++++------- system/core/URI.php | 6 +++--- 14 files changed, 54 insertions(+), 55 deletions(-) (limited to 'system/core') diff --git a/system/core/Benchmark.php b/system/core/Benchmark.php index 39027e809..c17e95a19 100755 --- a/system/core/Benchmark.php +++ b/system/core/Benchmark.php @@ -46,7 +46,7 @@ class CI_Benchmark { * * @var array */ - public $marker = array(); + public $marker = array(); // -------------------------------------------------------------------- @@ -119,4 +119,4 @@ class CI_Benchmark { } /* End of file Benchmark.php */ -/* Location: ./system/core/Benchmark.php */ \ No newline at end of file +/* Location: ./system/core/Benchmark.php */ diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 293582243..793c4687e 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -40,7 +40,7 @@ /** * CodeIgniter Version * - * @var string + * @var string * */ define('CI_VERSION', '3.0-dev'); diff --git a/system/core/Common.php b/system/core/Common.php index 075b221bd..78aa6e874 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -39,7 +39,6 @@ // ------------------------------------------------------------------------ - if ( ! function_exists('is_php')) { /** diff --git a/system/core/Config.php b/system/core/Config.php index fc6183444..1eab08b82 100755 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -45,14 +45,14 @@ class CI_Config { * * @var array */ - public $config = array(); + public $config = array(); /** * List of all loaded config files * * @var array */ - public $is_loaded = array(); + public $is_loaded = array(); /** * List of paths to search when trying to load a config file. @@ -60,7 +60,7 @@ class CI_Config { * * @var array */ - public $_config_paths = array(APPPATH); + public $_config_paths = array(APPPATH); /** * Constructor diff --git a/system/core/Controller.php b/system/core/Controller.php index 0c6c47183..1f69146d0 100644 --- a/system/core/Controller.php +++ b/system/core/Controller.php @@ -42,7 +42,7 @@ class CI_Controller { /** * Reference to the global CI instance * - * @var object + * @var object */ private static $instance; diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php index f55f9fcba..2e9f0c766 100755 --- a/system/core/Exceptions.php +++ b/system/core/Exceptions.php @@ -39,14 +39,14 @@ class CI_Exceptions { /** * Nesting level of the output buffering mechanism * - * @var int + * @var int */ public $ob_level; /** * List if available error levels * - * @var array + * @var array */ public $levels = array( E_ERROR => 'Error', diff --git a/system/core/Hooks.php b/system/core/Hooks.php index 672fe29dd..b42ecbe20 100755 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -43,21 +43,21 @@ class CI_Hooks { * * @var bool */ - public $enabled = FALSE; + public $enabled = FALSE; /** * List of all hooks set in config/hooks.php * * @var array */ - public $hooks = array(); + public $hooks = array(); /** * Determines wether hook is in progress, used to prevent infinte loops * * @var bool */ - public $in_progress = FALSE; + public $in_progress = FALSE; /** * Initialize the Hooks Preferences diff --git a/system/core/Input.php b/system/core/Input.php index 7ee8f3685..fc2a550bc 100755 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -43,28 +43,28 @@ class CI_Input { * * @var string */ - public $ip_address = FALSE; + public $ip_address = FALSE; /** * user agent (web browser) being used by the current user * * @var string */ - public $user_agent = FALSE; + public $user_agent = FALSE; /** * If FALSE, then $_GET will be set to an empty array * * @var bool */ - protected $_allow_get_array = TRUE; + protected $_allow_get_array = TRUE; /** * If TRUE, then newlines are standardized * * @var bool */ - protected $_standardize_newlines = TRUE; + protected $_standardize_newlines = TRUE; /** * Determines whether the XSS filter is always active when GET, POST or COOKIE data is encountered @@ -72,7 +72,7 @@ class CI_Input { * * @var bool */ - protected $_enable_xss = FALSE; + protected $_enable_xss = FALSE; /** * Enables a CSRF cookie token to be set. @@ -80,14 +80,14 @@ class CI_Input { * * @var bool */ - protected $_enable_csrf = FALSE; + protected $_enable_csrf = FALSE; /** * List of all HTTP request headers * * @var array */ - protected $headers = array(); + protected $headers = array(); /** * Constructor diff --git a/system/core/Lang.php b/system/core/Lang.php index 7abdc6102..2963012fc 100755 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -41,14 +41,14 @@ class CI_Lang { * * @var array */ - public $language = array(); + public $language = array(); /** * List of loaded language files * * @var array */ - public $is_loaded = array(); + public $is_loaded = array(); /** * Initialize language class diff --git a/system/core/Loader.php b/system/core/Loader.php index b99ce6964..7fb3eab41 100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -51,77 +51,77 @@ class CI_Loader { * * @var array */ - protected $_ci_view_paths = array(); + protected $_ci_view_paths = array(); /** * List of paths to load libraries from * * @var array */ - protected $_ci_library_paths = array(); + protected $_ci_library_paths = array(); /** * List of paths to load models from * * @var array */ - protected $_ci_model_paths = array(); + protected $_ci_model_paths = array(); /** * List of paths to load helpers from * * @var array */ - protected $_ci_helper_paths = array(); + protected $_ci_helper_paths = array(); /** * List of loaded base classes * * @var array */ - protected $_base_classes = array(); // Set by the controller class + protected $_base_classes = array(); // Set by the controller class /** * List of cached variables * * @var array */ - protected $_ci_cached_vars = array(); + protected $_ci_cached_vars = array(); /** * List of loaded classes * * @var array */ - protected $_ci_classes = array(); + protected $_ci_classes = array(); /** * List of loaded files * * @var array */ - protected $_ci_loaded_files = array(); + protected $_ci_loaded_files = array(); /** * List of loaded models * * @var array */ - protected $_ci_models = array(); + protected $_ci_models = array(); /** * List of loaded helpers * * @var array */ - protected $_ci_helpers = array(); + protected $_ci_helpers = array(); /** * List of class name mappings * * @var array */ - protected $_ci_varmap = array( + protected $_ci_varmap = array( 'unit_test' => 'unit', 'user_agent' => 'agent' ); diff --git a/system/core/Output.php b/system/core/Output.php index 0683539c9..513c657a6 100755 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -50,49 +50,49 @@ class CI_Output { * * @var int */ - public $cache_expiration = 0; + public $cache_expiration = 0; /** * List of server headers * * @var array */ - public $headers = array(); + public $headers = array(); /** * List of mime types * * @var array */ - public $mime_types = array(); + public $mime_types = array(); /** * Determines wether profiler is enabled * * @var book */ - public $enable_profiler = FALSE; + public $enable_profiler = FALSE; /** * Determines if output compression is enabled * * @var bool */ - protected $_zlib_oc = FALSE; + protected $_zlib_oc = FALSE; /** * List of profiler sections * * @var array */ - protected $_profiler_sections = array(); + protected $_profiler_sections = array(); /** * Whether or not to parse variables like {elapsed_time} and {memory_usage} * * @var bool */ - public $parse_exec_vars = TRUE; + public $parse_exec_vars = TRUE; /** * Set up Output class diff --git a/system/core/Router.php b/system/core/Router.php index b5c200214..9314052fe 100755 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -50,35 +50,35 @@ class CI_Router { * * @var array */ - public $routes = array(); + public $routes = array(); /** * List of error routes * * @var array */ - public $error_routes = array(); + public $error_routes = array(); /** * Current class name * * @var string */ - public $class = ''; + public $class = ''; /** * Current method name * * @var string */ - public $method = 'index'; + public $method = 'index'; /** * Sub-directory that contains the requested controller class * * @var string */ - public $directory = ''; + public $directory = ''; /** * Default controller (and method if specific) diff --git a/system/core/Security.php b/system/core/Security.php index 139511661..974e2e428 100755 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -41,14 +41,14 @@ class CI_Security { * * @var string */ - protected $_xss_hash = ''; + protected $_xss_hash = ''; /** * Random Hash for Cross Site Request Forgery Protection Cookie * * @var string */ - protected $_csrf_hash = ''; + protected $_csrf_hash = ''; /** * Expiration time for Cross Site Request Forgery Protection Cookie @@ -56,28 +56,28 @@ class CI_Security { * * @var int */ - protected $_csrf_expire = 7200; + protected $_csrf_expire = 7200; /** * Token name for Cross Site Request Forgery Protection Cookie * * @var string */ - protected $_csrf_token_name = 'ci_csrf_token'; + protected $_csrf_token_name = 'ci_csrf_token'; /** * Cookie name for Cross Site Request Forgery Protection Cookie * * @var string */ - protected $_csrf_cookie_name = 'ci_csrf_token'; + protected $_csrf_cookie_name = 'ci_csrf_token'; /** * List of never allowed strings * * @var array */ - protected $_never_allowed_str = array( + protected $_never_allowed_str = array( 'document.cookie' => '[removed]', 'document.write' => '[removed]', '.parentNode' => '[removed]', @@ -95,7 +95,7 @@ class CI_Security { * * @var array */ - protected $_never_allowed_regex = array( + protected $_never_allowed_regex = array( 'javascript\s*:', 'expression\s*(\(|&\#40;)', // CSS and IE 'vbscript\s*:', // IE, surprise! diff --git a/system/core/URI.php b/system/core/URI.php index 140295338..ff2c458b8 100755 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -42,7 +42,7 @@ class CI_URI { * * @var array */ - public $keyval = array(); + public $keyval = array(); /** * Current uri string @@ -56,7 +56,7 @@ class CI_URI { * * @var array */ - public $segments = array(); + public $segments = array(); /** * Re-indexed list of uri segments @@ -64,7 +64,7 @@ class CI_URI { * * @var array */ - public $rsegments = array(); + public $rsegments = array(); /** * Constructor -- cgit v1.2.3-24-g4f1b From cdfbd5281e4dec7278a07943832c2590c1141eb3 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Thu, 26 Apr 2012 22:13:31 +0100 Subject: Fixed issue #122 - ruri_string() in subdirs. --- system/core/Router.php | 5 ++++- system/core/URI.php | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'system/core') diff --git a/system/core/Router.php b/system/core/Router.php index 5477fed5d..fa88cb3dc 100755 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -237,9 +237,12 @@ class CI_Router { $segments[1] = 'index'; } + // This is being routed to a file in a sub directory + $this->directory and array_unshift($segments, trim($this->directory, '/')); + // Update our "routed" segment array to contain the segments. // Note: If there is no custom routing, this array will be - // identical to $this->uri->segments + // identical to $this->uri->segments $this->uri->rsegments = $segments; } diff --git a/system/core/URI.php b/system/core/URI.php index 48bb7ae3c..17300df07 100755 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -641,10 +641,10 @@ class CI_URI { */ public function ruri_string() { - return '/'.implode('/', $this->rsegment_array()); + return implode('/', $this->rsegment_array()); } } /* End of file URI.php */ -/* Location: ./system/core/URI.php */ +/* Location: ./system/core/URI.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b