function tar_archive($tarname, $file_list) { global $globals; $tar_archive = new softtar($tarname, 'gz'); $res = $tar_archive->createModify($file_list, '', ''); if (!$res) { return false; } return true; }
function untar_archive($tarname, $untar_path, $file_list = array()) { global $globals; // Create directory if not there if (!is_dir($untar_path)) { @mkdir($untar_path); } $tar_archive = new softtar($tarname); if (empty($file_list)) { $res = $tar_archive->extractModify($untar_path, ''); } else { $res = $tar_archive->extractList($file_list, $untar_path); } if (!$res) { return false; } return true; }