summaryrefslogtreecommitdiffstats
path: root/system/core/Common.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-06-15 00:02:16 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-06-15 00:02:16 +0200
commitc9bb0c5b7a3a349a5c255b02b5cc7ddbe32132e5 (patch)
tree905ff3f3153720c1d1547092e54feaf0e46568a6 /system/core/Common.php
parent3061ee737ff2c1853428482e1704b0973b621118 (diff)
parentf11a1939c25de1e327c7c02001c8fbd1ec1fc7b4 (diff)
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/core/Common.php')
-rw-r--r--system/core/Common.php40
1 files changed, 33 insertions, 7 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index 8af7d6323..1708653e7 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,18 +233,18 @@ 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);
}
// Is the config file in the environment folder?
- if (defined(ENVIRONMENT) && file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php'))
+ 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'))
{
/**