summaryrefslogtreecommitdiffstats
path: root/system/helpers/file_helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/helpers/file_helper.php')
-rw-r--r--system/helpers/file_helper.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 334eef87c..2bd8bce10 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -1,4 +1,4 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
@@ -128,7 +128,7 @@ if ( ! function_exists('delete_files'))
return FALSE;
}
- while(FALSE !== ($filename = @readdir($current_dir)))
+ while (FALSE !== ($filename = @readdir($current_dir)))
{
if ($filename != "." and $filename != "..")
{
@@ -311,7 +311,7 @@ if ( ! function_exists('get_file_info'))
$fileinfo['readable'] = is_readable($file);
break;
case 'writable':
- // There are known problems using is_weritable on IIS. It may not be reliable - consider fileperms()
+ // There are known problems using is_weritable on IIS. It may not be reliable - consider fileperms()
$fileinfo['writable'] = is_writable($file);
break;
case 'executable':
@@ -352,7 +352,16 @@ if ( ! function_exists('get_mime_by_extension'))
if ( ! is_array($mimes))
{
- if ( ! require_once(APPPATH.'config/mimes.php'))
+ if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
+ {
+ include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
+ }
+ elseif (is_file(APPPATH.'config/mimes.php'))
+ {
+ include(APPPATH.'config/mimes.php');
+ }
+
+ if ( ! is_array($mimes))
{
return FALSE;
}