summaryrefslogtreecommitdiffstats
path: root/system/helpers/file_helper.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-07 13:57:04 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-07 13:57:04 +0200
commit0f0b76980cb07f39b20c8591882aeae3854f016c (patch)
tree28ee4a2375e1d2b7fe28f5826015686ace374981 /system/helpers/file_helper.php
parentc839d28f4230dce0c658338f267b821cc16490a2 (diff)
Deprecated do_hash() and read_file() in favor of hash() and file_get_contents() respectively
Diffstat (limited to 'system/helpers/file_helper.php')
-rw-r--r--system/helpers/file_helper.php31
1 files changed, 4 insertions, 27 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index d53d986f9..b717aaa0d 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);
}
}