Example #1
0
 function PclTarAddList($p_tarname, $p_filelist, $p_add_dir = "", $p_remove_dir = "", $p_mode = "")
 {
     TrFctStart(__FILE__, __LINE__, "PclTarAddList", "tar={$p_tarname}, file={$p_filelist}, p_add_dir='{$p_add_dir}', p_remove_dir='{$p_remove_dir}', mode={$p_mode}");
     $v_result = 1;
     $p_list_detail = array();
     if ($p_mode == "" || $p_mode != "tar" && $p_mode != "tgz") {
         if (($p_mode = PclTarHandleExtension($p_tarname)) == "") {
             TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
             return PclErrorCode();
         }
     }
     if (is_array($p_filelist)) {
         $v_result = PclTarHandleAppend($p_tarname, $p_filelist, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir);
     } else {
         if (is_string($p_filelist)) {
             $v_list = explode(" ", $p_filelist);
             $v_result = PclTarHandleAppend($p_tarname, $v_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir);
         } else {
             PclErrorLog(-3, "Invalid variable type p_filelist");
             $v_result = -3;
         }
     }
     if ($v_result != 1) {
         TrFctEnd(__FILE__, __LINE__, 0);
         return 0;
     }
     TrFctEnd(__FILE__, __LINE__, $p_list_detail);
     return $p_list_detail;
 }
Example #2
0
 function PclTarAddList($p_tarname, $p_filelist, $p_add_dir = "", $p_remove_dir = "", $p_mode = "")
 {
     TrFctStart(__FILE__, __LINE__, "PclTarAddList", "tar={$p_tarname}, file={$p_filelist}, p_add_dir='{$p_add_dir}', p_remove_dir='{$p_remove_dir}', mode={$p_mode}");
     $v_result = 1;
     $p_list_detail = array();
     // ----- 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 PclErrorCode();
         }
     }
     // ----- Look if the $p_filelist is really an array
     if (is_array($p_filelist)) {
         // ----- Call the add fct
         $v_result = PclTarHandleAppend($p_tarname, $p_filelist, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir);
     } else {
         if (is_string($p_filelist)) {
             // ----- Create a list with the elements from the string
             $v_list = explode(" ", $p_filelist);
             // ----- Call the add fct
             $v_result = PclTarHandleAppend($p_tarname, $v_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir);
         } else {
             // ----- Error log
             PclErrorLog(-3, "Invalid variable type p_filelist");
             $v_result = -3;
         }
     }
     // ----- Return
     if ($v_result != 1) {
         TrFctEnd(__FILE__, __LINE__, 0);
         return 0;
     }
     TrFctEnd(__FILE__, __LINE__, $p_list_detail);
     return $p_list_detail;
 }