Beispiel #1
0
 private function fetchFolder($folderGuid, $space, $source, $target)
 {
     $folderDb = new App_Model_Db_Table_Folder();
     $folder = $folderDb->fetchRow("guid LIKE \"" . $folderGuid . "\"");
     $message = $space . " - " . $folder->title . " ( " . $folder->guid . " ) <br>";
     $this->printMessage($message, "red", "bold");
     $tgtPath = $target . "/" . $folder->title;
     $tgtPath = rtrim($tgtPath);
     if (!is_dir($tgtPath)) {
         if (!mkdir($tgtPath, 0777, true)) {
             die('Failed to create folders...[' . $tgtPath . "]");
         }
     }
     $this->copycatalog($folderGuid, $space . "&nbsp;&nbsp;&nbsp;&nbsp;", $source, $tgtPath);
     $folders = $folderDb->fetchChildren($folderGuid);
     if (count($folders) > 0) {
         foreach ($folders as $data) {
             echo "<br>";
             $this->fetchFolder($data->guid, $space . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $source, $tgtPath);
         }
     }
 }