summaryrefslogtreecommitdiffstats
path: root/system/core/Common.php
diff options
context:
space:
mode:
authorCory <ckdarby@gmail.com>2012-06-06 18:46:40 +0200
committerCory <ckdarby@gmail.com>2012-06-06 18:46:40 +0200
commit61fb9c1596ea220a0a8106160c5c68f9343ff9df (patch)
tree136126cc057bc58000f020990e32685c89adf399 /system/core/Common.php
parent037944e6c2083ce82ef5785947fddbf671362006 (diff)
parent47b673324f06236264ca64f8c3155aab51762609 (diff)
Merge branch 'develop' of https://github.com/EllisLab/CodeIgniter into issue_1374
Conflicts: user_guide_src/source/changelog.rst
Diffstat (limited to 'system/core/Common.php')
-rw-r--r--system/core/Common.php38
1 files changed, 32 insertions, 6 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index 8af7d6323..c08755c91 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -44,13 +44,13 @@ if ( ! function_exists('is_php'))
/**
* Determines if the current version of PHP is greater then the supplied value
*
- * Since there are a few places where we conditionally test for PHP > 5
+ * Since there are a few places where we conditionally test for PHP > 5.3
* we'll set a static variable.
*
* @param string
* @return bool TRUE if the current version is $version or higher
*/
- function is_php($version = '5.0.0')
+ function is_php($version = '5.3.0')
{
static $_is_php;
$version = (string) $version;
@@ -233,7 +233,7 @@ if ( ! function_exists('get_config'))
$file_path = APPPATH.'config/config.php';
$found = FALSE;
- if (file_exists($file_path))
+ if (file_exists($file_path))
{
$found = TRUE;
require($file_path);
@@ -242,9 +242,9 @@ if ( ! function_exists('get_config'))
// Is the config file in the environment folder?
if (defined(ENVIRONMENT) && file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
{
- require($file_path);
- }
- elseif ( ! $found)
+ require($file_path);
+ }
+ elseif ( ! $found)
{
set_status_header(503);
exit('The configuration file does not exist.');
@@ -304,6 +304,32 @@ if ( ! function_exists('config_item'))
// ------------------------------------------------------------------------
+if ( ! function_exists('get_mimes'))
+{
+ /**
+ * Returns the MIME types array from config/mimes.php
+ *
+ * @return array
+ */
+ function &get_mimes()
+ {
+ static $_mimes = array();
+
+ if (defined('ENVIRONMENT') && is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
+ {
+ $_mimes = include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
+ }
+ elseif (is_file(APPPATH.'config/mimes.php'))
+ {
+ $_mimes = include(APPPATH.'config/mimes.php');
+ }
+
+ return $_mimes;
+ }
+}
+
+// ------------------------------------------------------------------------
+
if ( ! function_exists('show_error'))
{
/**