You are here

function drush_ftools_exec_unlink_all in Features Tools 7.2

Execute all unlink files add so revert the file to their definitions in code.

Parameters

...: (Optional) A list of unlink files to exclude from being executed.

File

./ftools.drush.inc, line 76

Code

function drush_ftools_exec_unlink_all() {
  module_load_include('inc', 'features', 'features.export');
  $files_to_exclude = func_get_args();

  //prepare arguments with respect to excluded unlink files
  $available_files = _ftools_get_unlink_files();
  $args = array();

  //does this file exist?
  $basename = false;
  foreach ($available_files as $available_file) {
    $exclude = false;
    foreach ($files_to_exclude as $exclude_file) {
      if ($available_file->filename == $exclude_file || $available_file->name == $exclude_file) {
        $exclude = true;
      }
    }
    if (!$exclude) {
      $args[] = $available_file->filename;
    }
  }
  drush_invoke('ftools-exec-unlink', $args);
}