diff options
author | Andrey Andreev <narf@devilix.net> | 2014-01-20 14:03:43 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-01-20 14:03:43 +0100 |
commit | ea801ab4ab80042638ffddc6056483a1ec43fa80 (patch) | |
tree | f75f30c0df6a8f861ca7df22af09fa3240b0bbd6 /system/helpers/file_helper.php | |
parent | 1c08d557a21ecb0f79cd1a1de4e06817a26e0537 (diff) | |
parent | 4d0571666d03511ac5b4a1f2a6882ccb1509a209 (diff) |
Merge branch 'develop' into feature/user-guide-cleanup
Diffstat (limited to 'system/helpers/file_helper.php')
-rw-r--r-- | system/helpers/file_helper.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 4b45a62d0..0587740b1 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -79,11 +79,19 @@ if ( ! function_exists('write_file')) } flock($fp, LOCK_EX); - fwrite($fp, $data); + + for ($written = 0, $length = strlen($data); $written < $length; $written += $result) + { + if (($result = fwrite($fp, substr($data, $written))) === FALSE) + { + break; + } + } + flock($fp, LOCK_UN); fclose($fp); - return TRUE; + return is_int($result); } } |