summaryrefslogtreecommitdiff
path: root/modules/simpletest/simpletest.module
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-02-13 00:39:01 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-02-13 00:39:01 +0000
commit52c17c6d3ec99a872436ad09377401c25ff0bb55 (patch)
tree7305d46ec03a700f2eb4a2d9f5cf546b4944ac9f /modules/simpletest/simpletest.module
parent6afc39c2e468798f3c15e1faee45e51f1440bb51 (diff)
downloadbrdo-52c17c6d3ec99a872436ad09377401c25ff0bb55.tar.gz
brdo-52c17c6d3ec99a872436ad09377401c25ff0bb55.tar.bz2
#373502 by drewish and sun: Add function to delete unmanaged files recurisevely (with tests).
Diffstat (limited to 'modules/simpletest/simpletest.module')
-rw-r--r--modules/simpletest/simpletest.module23
1 files changed, 1 insertions, 22 deletions
diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module
index 39c08fecb..5476a9795 100644
--- a/modules/simpletest/simpletest.module
+++ b/modules/simpletest/simpletest.module
@@ -550,7 +550,7 @@ function simpletest_clean_temporary_directories() {
foreach ($files as $file) {
$path = file_directory_path() . '/' . $file;
if (is_dir($path) && preg_match('/^simpletest\d+/', $file)) {
- simpletest_clean_temporary_directory($path);
+ file_unmanaged_delete_recursive($path);
$count++;
}
}
@@ -564,27 +564,6 @@ function simpletest_clean_temporary_directories() {
}
/**
- * Remove all files from specified directory and then remove directory.
- *
- * @param string $path Directory path.
- */
-function simpletest_clean_temporary_directory($path) {
- $files = scandir($path);
- foreach ($files as $file) {
- if ($file != '.' && $file != '..') {
- $file_path = "$path/$file";
- if (is_dir($file_path)) {
- simpletest_clean_temporary_directory($file_path);
- }
- else {
- file_unmanaged_delete($file_path);
- }
- }
- }
- rmdir($path);
-}
-
-/**
* Clear the test results tables.
*/
function simpletest_clean_results_table() {