Пример #1
0
 function PclTarExtractList($p_tarname, $p_filelist, $p_path = "./", $p_remove_path = "", $p_mode = "")
 {
     TrFctStart(__FILE__, __LINE__, "PclTarExtractList", "tar={$p_tarname}, list, path={$p_path}, remove_path='{$p_remove_path}', mode='{$p_mode}'");
     $v_result = 1;
     // ----- Extract the tar format from the extension
     if ($p_mode == "" || $p_mode != "tar" && $p_mode != "tgz") {
         if (($p_mode = PclTarHandleExtension($p_tarname)) == "") {
             // ----- Return
             TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
             return 0;
         }
     }
     // ----- Look if the $p_filelist is really an array
     if (is_array($p_filelist)) {
         // ----- Call the extracting fct
         if (($v_result = PclTarHandleExtract($p_tarname, $p_filelist, $p_list, "partial", $p_path, $v_tar_mode, $p_remove_path)) != 1) {
             TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
             return 0;
         }
     } else {
         if (is_string($p_filelist)) {
             // ----- Create a list with the elements from the string
             $v_list = explode(" ", $p_filelist);
             // ----- Call the extracting fct
             if (($v_result = PclTarHandleExtract($p_tarname, $v_list, $p_list, "partial", $p_path, $v_tar_mode, $p_remove_path)) != 1) {
                 TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
                 return 0;
             }
         } else {
             // ----- Error log
             PclErrorLog(-3, "Invalid variable type p_filelist");
             // ----- Return
             TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
             return 0;
         }
     }
     // ----- Return
     TrFctEnd(__FILE__, __LINE__, $p_list);
     return $p_list;
 }
Пример #2
0
 function PclTarExtractList($p_tarname, $p_filelist, $p_path = "./", $p_remove_path = "", $p_mode = "")
 {
     TrFctStart(__FILE__, __LINE__, "PclTarExtractList", "tar={$p_tarname}, list, path={$p_path}, remove_path='{$p_remove_path}', mode='{$p_mode}'");
     $v_result = 1;
     if ($p_mode == "" || $p_mode != "tar" && $p_mode != "tgz") {
         if (($p_mode = PclTarHandleExtension($p_tarname)) == "") {
             TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
             return 0;
         }
     }
     if (is_array($p_filelist)) {
         if (($v_result = PclTarHandleExtract($p_tarname, $p_filelist, $p_list, "partial", $p_path, $v_tar_mode, $p_remove_path)) != 1) {
             TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
             return 0;
         }
     } else {
         if (is_string($p_filelist)) {
             $v_list = explode(" ", $p_filelist);
             if (($v_result = PclTarHandleExtract($p_tarname, $v_list, $p_list, "partial", $p_path, $v_tar_mode, $p_remove_path)) != 1) {
                 TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
                 return 0;
             }
         } else {
             PclErrorLog(-3, "Invalid variable type p_filelist");
             TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
             return 0;
         }
     }
     TrFctEnd(__FILE__, __LINE__, $p_list);
     return $p_list;
 }