You are here

function asset_rmdir in Asset 5

Same name and namespace in other branches
  1. 6 asset_wizard.inc \asset_rmdir()
  2. 6 inc/asset_wizard.inc \asset_rmdir()
1 call to asset_rmdir()
asset_wizard_form_validate in ./asset_wizard.inc
Validate callback for asset_wizard_form().

File

./asset_wizard.inc, line 1022

Code

function asset_rmdir($folder) {
  if (is_dir($folder)) {
    foreach (scandir($folder) as $value) {
      if ($value != "." && $value != "..") {
        $value = $folder . "/" . $value;
        if (is_dir($value)) {
          asset_rmdir($value);
        }
        elseif (is_file($value)) {
          @unlink($value);
        }
      }
    }
    return rmdir($folder);
  }
  else {
    return FALSE;
  }
}