diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-06-07 20:29:23 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-06-07 20:29:23 +0200 |
commit | 3427797a2899506adbe5317671fe0b3c27c2a6a6 (patch) | |
tree | 199fd08da90a1e37f5c7f4d75e4af957dc5e7278 /system/helpers/file_helper.php | |
parent | 968690491f625ddf59a5136b55ae1b9a2cf98a9a (diff) | |
parent | 25d47aec0417e52af43985663ebc1f62931f13cd (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop-db-sqlite
Diffstat (limited to 'system/helpers/file_helper.php')
-rw-r--r-- | system/helpers/file_helper.php | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index d53d986f9..be616f62d 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -44,38 +44,15 @@ if ( ! function_exists('read_file')) * * Opens the file specfied in the path and returns it as a string. * + * This function is DEPRECATED and should be removed in + * CodeIgniter 3.1+. Use file_get_contents() instead. + * * @param string path to file * @return string */ function read_file($file) { - if ( ! file_exists($file)) - { - return FALSE; - } - - if (function_exists('file_get_contents')) - { - return file_get_contents($file); - } - - if ( ! $fp = @fopen($file, FOPEN_READ)) - { - return FALSE; - } - - flock($fp, LOCK_SH); - - $data = ''; - if (filesize($file) > 0) - { - $data =& fread($fp, filesize($file)); - } - - flock($fp, LOCK_UN); - fclose($fp); - - return $data; + return @file_get_contents($file); } } |