public function UnishTestCase::recursive_copy

8.0.x UnishTestCase.php public UnishTestCase::recursive_copy($src, $dst)
master UnishTestCase.php public UnishTestCase::recursive_copy($src, $dst)
1 call to UnishTestCase::recursive_copy()
drushScriptCase::create_site_local_drush in tests/drushScriptTest.php
Copy UNISH_DRUSH into the specified site-local location.

File

tests/Unish/UnishTestCase.php, line 223

Namespace

Unish

Class

UnishTestCase

Code

public function recursive_copy($src, $dst) {
  $dir = opendir($src);
  $this->mkdir($dst);
  while (false !== ($file = readdir($dir))) {
    if (($file != '.') && ($file != '..')) {
      if (is_dir($src . '/' . $file)) {
        $this->recursive_copy($src . '/' . $file, $dst . '/' . $file);
      }
      else {
        copy($src . '/' . $file, $dst . '/' . $file);
      }
    }
  }
  closedir($dir);
}