Beispiel #1
0
 public function copyFolder($from, $to)
 {
     $ret = true;
     $allFiles = JFolder::files($from);
     foreach ($allFiles as $oneFile) {
         if (file_exists($to . DS . 'index.html') && $oneFile == 'index.html') {
             continue;
         }
         if (JFile::copy($from . DS . $oneFile, $to . DS . $oneFile) !== true) {
             $this->errors[] = 'Could not copy the file from ' . $from . DS . $oneFile . ' to ' . $to . DS . $oneFile;
             $ret = false;
         }
     }
     $allFolders = JFolder::folders($from);
     if (!empty($allFolders)) {
         foreach ($allFolders as $oneFolder) {
             if (!hikaserial::createDir($to . DS . $oneFolder)) {
                 continue;
             }
             if (!$this->copyFolder($from . DS . $oneFolder, $to . DS . $oneFolder)) {
                 $ret = false;
             }
         }
     }
     return $ret;
 }