You are here

function omega_tools_copy_recursive in Omega Tools 7.3

@todo

4 calls to omega_tools_copy_recursive()
omega_tools_cache_get in ./omega_tools.module
@todo
omega_tools_move in ./omega_tools.module
@todo
omega_tools_subtheme_create in ./omega_tools.module
@todo
omega_tools_subtheme_wizard_finished_form_submit in includes/omega_tools.wizard.inc
@todo

File

./omega_tools.module, line 263

Code

function omega_tools_copy_recursive($source, $destination) {
  if (is_dir($source)) {
    if (!file_prepare_directory($destination, FILE_CREATE_DIRECTORY)) {
      return FALSE;
    }
    $directory = dir($source);
    while (FALSE !== ($read = $directory
      ->read())) {
      if ($read != '.' && $read != '..') {
        if (!omega_tools_copy_recursive($source . '/' . $read, $destination . '/' . $read)) {
          return FALSE;
        }
      }
    }
    $directory
      ->close();
  }
  else {
    file_unmanaged_copy($source, $destination);
  }
  return TRUE;
}