예제 #1
0
 function PclTarExtractIndex($p_tarname, $p_index, $p_path = "./", $p_remove_path = "", $p_mode = "")
 {
     TrFctStart(__FILE__, __LINE__, "PclTarExtractIndex", "tar={$p_tarname}, index='{$p_index}', 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_index is really an integer
     if (is_integer($p_index)) {
         // ----- Call the extracting fct
         if (($v_result = PclTarHandleExtractByIndexList($p_tarname, "{$p_index}", $p_list, $p_path, $p_remove_path, $v_tar_mode)) != 1) {
             TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
             return 0;
         }
     } else {
         if (is_string($p_index)) {
             // ----- Call the extracting fct
             if (($v_result = PclTarHandleExtractByIndexList($p_tarname, $p_index, $p_list, $p_path, $p_remove_path, $v_tar_mode)) != 1) {
                 TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
                 return 0;
             }
         } else {
             // ----- Error log
             PclErrorLog(-3, "Invalid variable type {$p_index}");
             // ----- Return
             TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
             return 0;
         }
     }
     // ----- Return
     TrFctEnd(__FILE__, __LINE__, $p_list);
     return $p_list;
 }
예제 #2
0
 function PclTarExtractIndex($p_tarname, $p_index, $p_path = "./", $p_remove_path = "", $p_mode = "")
 {
     TrFctStart(__FILE__, __LINE__, "PclTarExtractIndex", "tar={$p_tarname}, index='{$p_index}', 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_integer($p_index)) {
         if (($v_result = PclTarHandleExtractByIndexList($p_tarname, "{$p_index}", $p_list, $p_path, $p_remove_path, $v_tar_mode)) != 1) {
             TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
             return 0;
         }
     } else {
         if (is_string($p_index)) {
             if (($v_result = PclTarHandleExtractByIndexList($p_tarname, $p_index, $p_list, $p_path, $p_remove_path, $v_tar_mode)) != 1) {
                 TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
                 return 0;
             }
         } else {
             PclErrorLog(-3, "Invalid variable type {$p_index}");
             TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
             return 0;
         }
     }
     TrFctEnd(__FILE__, __LINE__, $p_list);
     return $p_list;
 }