You are here

private function Twig_Tests_FileCachingTest::removeDir in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/test/Twig/Tests/FileCachingTest.php \Twig_Tests_FileCachingTest::removeDir()
1 call to Twig_Tests_FileCachingTest::removeDir()
Twig_Tests_FileCachingTest::tearDown in vendor/twig/twig/test/Twig/Tests/FileCachingTest.php
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.

File

vendor/twig/twig/test/Twig/Tests/FileCachingTest.php, line 68

Class

Twig_Tests_FileCachingTest

Code

private function removeDir($target) {
  $fp = opendir($target);
  while (false !== ($file = readdir($fp))) {
    if (in_array($file, array(
      '.',
      '..',
    ))) {
      continue;
    }
    if (is_dir($target . '/' . $file)) {
      self::removeDir($target . '/' . $file);
    }
    else {
      unlink($target . '/' . $file);
    }
  }
  closedir($fp);
  rmdir($target);
}