You are here

function filefield_paths_trash in File (Field) Paths 6.2

Recursively delete empty directories from top down.

1 call to filefield_paths_trash()
_filefield_paths_include_trash_cron in includes/trash.inc
Implements hook_cron().
3 string references to 'filefield_paths_trash'
_filefield_paths_include_trash_cron in includes/trash.inc
Implements hook_cron().
_filefield_paths_include_trash_filefield_paths_file_postprocess in includes/trash.inc
Implements hook_filefield_paths_file_postprocess().
_filefield_paths_include_trash_file_delete in includes/trash.inc
Implements hook_file_delete().

File

includes/trash.inc, line 46
Trash cleanup functionality for FileField Paths module.

Code

function filefield_paths_trash($directory) {
  while ($directory != file_directory_path()) {
    $directory_array = explode('/', $directory);
    if (@rmdir($directory) === TRUE) {
      array_pop($directory_array);
      $directory = implode('/', $directory_array);
      continue;
    }
    break;
  }
}