1 backdrop_web_test_case.php private BackdropWebTestCase::recursiveCopy($src, $dst)

Recursively copy one directory to another.

File

core/modules/simpletest/backdrop_web_test_case.php, line 1615

Class

BackdropWebTestCase
Test case for typical Backdrop tests.

Code

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