10
While attending the school of hard knocks....
I found the need to be able to untar archives for this module. Go figure.... Anyway, I found a class for untarring tar'd files. Being limited in the knowledge object oriented programming experience is hurting my progress though. Could someone look at this code and tell me what I've done wrong?
I can get it to run through the code fine, but as far as extracting the archive, it doesn't. The script doesn't bomb, just doesn't extract. I know its something simple, but what that simple thing is, I am blind too.
####################################################### UNTAR FUNCTION #############################################################
/*
function untar() {
global $HTTP_POST_VARS;
global $dir, $unzip, $action;
$dir = $HTTP_POST_VARS['dir'];
$unzip = $HTTP_POST_VARS['unzip'];
$action = $HTTP_POST_VARS['action'];
// Include the Tarlib class
include XOOPS_ROOT_PATH.'/modules/xadmintools/class/class.tar.php';
$showcontents = "$dir/$unzip";
$untar = new gzfile($unzip);
$untar->extract('$unzip');
echo $showcontents;
@unlink($dir."/$unzip");
echo "
>>> $unzip Deleted! ";
redirect_header("unzip.php",10,"$unzip successfully extracted, and was deleted from server!");
}
######################################################### END UNTAR FUNCTION ###############################################################
*/
Or better yet, what variables would I need to get the tar class to work that comes with the XOOPS core?
Some sort of direction is greatly needed on this, and I'll take any advice given!
Any and all help on this is greatly appreciated!
Thanks!