Esempio n. 1
0
 function moveTestFiles()
 {
     if (!$this->conf['TEST_BASE_PATH'] || $this->conf['TEST_BASE_PATH'] == $this->conf['TEST_PHP_SRCDIR']) {
         return;
     }
     $this->writemsg("moving files from {$this->conf['TEST_PHP_SRCDIR']} to {$this->conf['TEST_BASE_PATH']}\n");
     $l = strlen($this->conf['TEST_PHP_SRCDIR']);
     $files = array();
     $dirs = array();
     foreach ($this->test_files as $file) {
         if (strpos($file, $this->conf['TEST_PHP_SRCDIR']) == 0) {
             $newlocation = $this->conf['TEST_BASE_PATH'] . substr($file, $l);
             $files[] = $newlocation;
             $dirs[dirname($file)] = dirname($newlocation);
         } else {
             // XXX what to do with test files outside the
             // php source directory?  Need to map them into
             // the new directory somehow.
         }
     }
     foreach ($dirs as $src => $new) {
         mkpath($new);
         copyfiles($src, $new);
     }
     $this->test_files = $files;
 }
Esempio n. 2
0
function copysubdir($srcdir, $destdir)
{
    $dir = opendir($srcdir);
    while ($file = readdir($dir)) {
        if (!($file != ".") && !($file != "..")) {
            $dircontent = $srcdir . "/" . $file;
            if (is_dir($dircontent)) {
                if (!file_exists($destdir . "/" . $file)) {
                    createFolder($destdir . "/" . $file);
                }
                copyfiles($dircontent, $destdir . "/" . $file);
            }
        }
    }
    closedir($_dirrun);
}