diff options
author | Greg Aker <greg.aker@ellislab.com> | 2010-01-15 01:09:34 +0100 |
---|---|---|
committer | Greg Aker <greg.aker@ellislab.com> | 2010-01-15 01:09:34 +0100 |
commit | 3e9519e07af366f9bd7b48de34db689f573d37ea (patch) | |
tree | 716e075ad085e8063b633248f67c558c37ace6c6 | |
parent | c710211f85e3eb2107c167f6a66161f2b82c1c1c (diff) |
Update to file helper to return FALSE on failure.
-rw-r--r-- | system/helpers/file_helper.php | 8 | ||||
-rw-r--r-- | user_guide/changelog.html | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 114b2927a..2be06ac4f 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -124,7 +124,9 @@ if ( ! function_exists('delete_files')) $path = rtrim($path, DIRECTORY_SEPARATOR); if ( ! $current_dir = @opendir($path)) - return; + { + return TRUE; + } while(FALSE !== ($filename = @readdir($current_dir))) { @@ -148,8 +150,10 @@ if ( ! function_exists('delete_files')) if ($del_dir == TRUE AND $level > 0) { - @rmdir($path); + return @rmdir($path); } + + return TRUE; } } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f54c00769..0e49bbdce 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -84,6 +84,7 @@ SVN Revision: </p> <li>Non-backwards compatible change made to <kbd>get_dir_file_info()</kbd> in the <a href="helpers/file_helper.html">File Helper</a>. No longer recurses by default so as to encourage responsible use (this function can cause server performance issues when used without caution).</li> <li>Modified the second parameter of <kbd>directory_map()</kbd> in the <a href="helpers/directory_helper.html">Directory Helper</a> to accept an integer to specify recursion depth.</li> + <li>Modified <kbd>delete_files()</kbd> in the <a href="helpers/file_helper.html">File Helper</a> to return FALSE on failure.</li> </ul> </li> </ul> |