You are here

function asset_rmdir in Asset 6

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

File

inc/asset_wizard.inc, line 1006

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;
  }
}