summaryrefslogtreecommitdiffstats
path: root/system/core/Config.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-07 21:34:38 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-07 21:34:38 +0200
commitfeec9db5e6514f242e17b4504536d746660fd02c (patch)
treecec0ce356bd58892b9b3af50d14c2eb70c9b5b48 /system/core/Config.php
parentbd738c80a623700b3b11e876abb764ca6d57769d (diff)
parent25c08390bd93ba27d89a8682b37c8c6184a53c07 (diff)
Merge upstream branch
Diffstat (limited to 'system/core/Config.php')
-rwxr-xr-xsystem/core/Config.php39
1 files changed, 19 insertions, 20 deletions
diff --git a/system/core/Config.php b/system/core/Config.php
index 9cebe6c86..3de1bcb96 100755
--- a/system/core/Config.php
+++ b/system/core/Config.php
@@ -25,8 +25,6 @@
* @filesource
*/
-// ------------------------------------------------------------------------
-
/**
* CodeIgniter Config Class
*
@@ -46,14 +44,14 @@ class CI_Config {
* @var array
*/
public $config = array();
-
+
/**
* List of all loaded config files
*
* @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.
@@ -77,9 +75,9 @@ class CI_Config {
{
if (isset($_SERVER['HTTP_HOST']))
{
- $base_url = ! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
- $base_url .= '://'. $_SERVER['HTTP_HOST']
- . str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
+ $base_url = ( ! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') ? 'https' : 'http';
+ $base_url .= '://'.$_SERVER['HTTP_HOST']
+ .str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
}
else
{
@@ -96,13 +94,13 @@ class CI_Config {
* Load Config File
*
* @param string the config file name
- * @param boolean if configuration values should be loaded into their own section
- * @param boolean true if errors should just return false, false if an error message should be displayed
- * @return boolean if the file was loaded correctly
+ * @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
*/
public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
{
- $file = ($file == '') ? 'config' : str_replace('.php', '', $file);
+ $file = ($file === '') ? 'config' : str_replace('.php', '', $file);
$found = $loaded = FALSE;
foreach ($this->_config_paths as $path)
@@ -213,7 +211,7 @@ class CI_Config {
{
return FALSE;
}
- elseif (trim($this->config[$item]) == '')
+ elseif (trim($this->config[$item]) === '')
{
return '';
}
@@ -232,14 +230,14 @@ class CI_Config {
*/
public function site_url($uri = '')
{
- if ($uri == '')
+ if ($uri === '')
{
return $this->slash_item('base_url').$this->item('index_page');
}
- if ($this->item('enable_query_strings') == FALSE)
+ if ($this->item('enable_query_strings') === FALSE)
{
- $suffix = ($this->item('url_suffix') == FALSE) ? '' : $this->item('url_suffix');
+ $suffix = ($this->item('url_suffix') === FALSE) ? '' : $this->item('url_suffix');
return $this->slash_item('base_url').$this->slash_item('index_page').$this->_uri_string($uri).$suffix;
}
else
@@ -254,8 +252,8 @@ class CI_Config {
* Base URL
* Returns base_url [. uri_string]
*
- * @param string $uri
- * @return string
+ * @param string $uri
+ * @return string
*/
public function base_url($uri = '')
{
@@ -267,12 +265,12 @@ class CI_Config {
/**
* Build URI string for use in Config::site_url() and Config::base_url()
*
- * @param mixed $uri
- * @return string
+ * @param mixed $uri
+ * @return string
*/
protected function _uri_string($uri)
{
- if ($this->item('enable_query_strings') == FALSE)
+ if ($this->item('enable_query_strings') === FALSE)
{
if (is_array($uri))
{
@@ -345,6 +343,7 @@ class CI_Config {
}
}
}
+
}
/* End of file Config.php */